Access to MDI parameters outside linuxcnc
- arabel1a
- Offline
- New Member
Less
More
- Posts: 10
- Thank you received: 4
25 Aug 2022 17:39 #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 or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
Less
More
- Posts: 23170
- Thank you received: 4860
03 Sep 2022 09:37 #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 or Create an account to join the conversation.
Time to create page: 0.060 seconds