- Posts: 19311
- Thank you received: 4655
Please Log in or Create an account to join the conversation.
Yes, I looked at both and it seemed PyVCP was the faster track to get things going. I have started working with GladeVCP now and the event handlers are great. The problem I run into is that GladeVCP seems to be targeted at a specific set of tasks and if you need to do something outside that box, you are in for some headaches.andypugh wrote: You might want to re-think using PyVCP and switch to GladeVCP instead. That allows you to allocate Python event handler code to the controls.
Not sure I understand this. mb2hal is the Modbus communications. Without that there would be nothing to import. I had to extensively modify a Modbus library to get it to run on an Arduino DUE when that board first came out and I had to go back and modify it again to work with mb2hal. Really not up for writing an all new Modbus for LinuxCNC.You might not want mb2hal at all, you might want to write your own Python userspace component that imports Modbus and handles all comms.
However, if that seems too much work, I would suggest a Python userspace component that creates HAL pins to connect to the mb2hal pins. The only reason not to do this is that it requires the extra step of net-ing all the HAL pins together.
This page here describes how to do it:
linuxcnc.org/docs/2.7/html/hal/halmodule.html
Though you could actually embed all the code (and pin creation) in your Glade panel handler.
You can do quite a lot with LinuxCNC from the Python interface:
linuxcnc.org/docs/2.7/html/config/python-interface.html
This page has some info on Python and Modbus, though I feel that there should not be any need to install any new packages to do what you want to do.
stackoverflow.com/questions/17081442/python-modbus-library
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.