Access to MDI parameters outside linuxcnc

More
25 Aug 2022 17:39 #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 or Create an account to join the conversation.

More
03 Sep 2022 09:37 #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 or Create an account to join the conversation.

Time to create page: 0.651 seconds
Powered by Kunena Forum