- Posts: 6803
- Thank you received: 2181
Please Log in or Create an account to join the conversation.
no, i need to change a parameter, not a pin, so i cannot link a signal to a parameter..Tower wrote:
dab77 wrote: (...)
In the meantime I also want to ask: instead of calling "os.system("command")", is there a way to directly change a Hal Parameter in python? I've looked in the code, but didn't find anything about that..
Well, there are few ways how to solve this, you can create HAL Python Userspace component which will create the HAL pins which you will be changing in your Python written program. And then you connect these pins inside the HAL layer to actual pins you need to change. That is described here: linuxcnc.org/docs/html/hal/halmodule.html .
Or you can create Python wrappers around the C hallib functions. That is probably quite a bit of work, but you can find the inspiration here: github.com/machinekit/machinekit-hal/tre...al/cython/machinekit
Or you can create direct connector to the HAL shared memory space and change values here. This is the most hard-core option and I would not recommend this.
Please Log in or Create an account to join the conversation.
really, i couldn't find those functions anywhere!cmorley wrote:
Well, there are few ways how to solve this, you can create HAL Python Userspace component which will create the HAL pins which you will be changing in your Python written program. And then you connect these pins inside the HAL layer to actual pins you need to change. That is described here: linuxcnc.org/docs/html/hal/halmodule.html .
You don't have to connect pins. There are some functions to do direct commands - depends on the version of linuxcnc.
in 2.7 fairly limited:
linuxcnc.org/docs/2.7/html/hal/halmodule...l#_helpful_functions
in 2.8 + a fair bit better (get_value is very useful):
linuxcnc.org/docs/2.8/html/hal/halmodule...l#_helpful_functions
Chris
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.