- Posts: 10
- Thank you received: 0
Access to MDI parameters outside linuxcnc
4 years 2 months ago #250420
by arabel1a
Access to MDI parameters outside linuxcnc was created 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.
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.
4 years 1 month ago #251090
by andypugh
Replied by andypugh on topic Access to MDI parameters outside linuxcnc
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"]
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
