Access to MDI parameters outside linuxcnc

More
4 years 2 months ago #250420 by arabel1a
Hello!
Is there a simple way to get MDI parameters (like #<_feed>, #<_x>, etc) outside from linuxcnc (bash script or python executable) ? Or, maybe, there is another simple way to transfer more than 2 parameters to M-function? 
Thank you.

Please Log in to join the conversation.

More
4 years 1 month ago #251090 by andypugh
I don't think that there is a way to get G-code parameters in a bash script (though I could be wrong)

In Python you can get the same data from the status structure:
linuxcnc.org/docs/html/config/python-int...ding_linuxcnc_status
But there isn't a way to read G-code parameters directly. Except in a Remap. (This is because a remap runs in the context of the interpreter...)

I guess that you are using an M100 - M199? If you switch to a Python remap (M200 maybe?) then you can read the parameter values.
Sample code is in stdglue: github.com/LinuxCNC/linuxcnc/blob/master...n-stdglue/stdglue.py

Line 52, for example, uses self.params["name"]

Please Log in to join the conversation.

Time to create page: 0.080 seconds
Powered by Kunena Forum