- Posts: 58
- Thank you received: 2
Implementation of M code control executable program
- chen1234
- Offline
- Senior Member
-
Less
More
5 years 3 months ago #216009
by chen1234
Implementation of M code control executable program was created by chen1234
Use an executable program in a shell script and name the script M3. Can it be executed on linuxcnc? Or how can I use this executable program to make it an M code.
Please Log in or Create an account to join the conversation.
- chen1234
- Offline
- Senior Member
-
Less
More
- Posts: 58
- Thank you received: 2
5 years 3 months ago #216010
by chen1234
Replied by chen1234 on topic Implementation of M code control executable program
The M code uses an executable program to control the laser switch. The executable program is implemented by the laser control api. I want the M code to call this program. How should the M code be written?
Please Log in or Create an account to join the conversation.
- rodw
- Offline
- Platinum Member
-
Less
More
- Posts: 12170
- Thank you received: 4153
5 years 3 months ago #216024
by rodw
Replied by rodw on topic Implementation of M code control executable program
Whats wrong with using spindle.0.on? It triggers on with M3 and off with M5
The following user(s) said Thank You: chen1234
Please Log in or Create an account to join the conversation.
- chen1234
- Offline
- Senior Member
-
Less
More
- Posts: 58
- Thank you received: 2
5 years 3 months ago #216025
by chen1234
Replied by chen1234 on topic Implementation of M code control executable program
Thank you for your reply. I want to use M3 to complete the laser turn on, and M5 to complete the laser turn off, but it cannot be achieved on Linuxcnc. What do I need to do? There is no M3 in Remappable Codes (
linuxcnc.org/docs/2.8/html/remap/remap.h...map:remappable-codes
), what should I do?
thanks,
chen
thanks,
chen
Please Log in or Create an account to join the conversation.
- tommylight
- Offline
- Moderator
-
Less
More
- Posts: 22011
- Thank you received: 7491
5 years 3 months ago #216030
by tommylight
Replied by tommylight on topic Implementation of M code control executable program
M3 will turn laser/spindle/plasma/nuke and M5 will turn them off ( maybe not the last one
), ther is just the way it was set up:
If setup to use PWM it will require alsoan S value, whatever value from 1 to nnnn.
It has to be wired in hal to spinle.on, not to spindle.forward or spindle.reverse.
If setup to use PWM it will require alsoan S value, whatever value from 1 to nnnn.
It has to be wired in hal to spinle.on, not to spindle.forward or spindle.reverse.
The following user(s) said Thank You: chen1234
Please Log in or Create an account to join the conversation.
- Aciera
- Offline
- Administrator
-
Less
More
- Posts: 4819
- Thank you received: 2177
5 years 3 months ago - 5 years 3 months ago #216035
by Aciera
Replied by Aciera on topic Implementation of M code control executable program
You can use shell script in a remap. Here is an example file called 'M234' for a remap of M234:
The code will of course need to be adapted to your api.
This file is in a folder named 'mcodes' inside your machine config folder
Then you need to add this to the [RS274NGC] section of your INI file:
You can also use python for remap.
If you want to use M3 in your gcode you might have to call your custom M-code remap by connecting an MDI-command to the spindle.0.on pin:
and add this to the [HALUI]-section of your INI:
Code:
#!/usr/bin/tclsh
# your tclsh-script here!
The code will of course need to be adapted to your api.
This file is in a folder named 'mcodes' inside your machine config folder
Then you need to add this to the [RS274NGC] section of your INI file:
Code:
USER_M_PATH = ./mcodes
You can also use python for remap.
If you want to use M3 in your gcode you might have to call your custom M-code remap by connecting an MDI-command to the spindle.0.on pin:
Code:
net spindle-enable <= spindle.0.on => halui.mdi-command-00
Code:
MDI_COMMAND = M234 ( the first MDI_COMMAND entry in the [HALUI]-section corresponds to halui.mdi-command-00 )
Last edit: 5 years 3 months ago by Aciera. Reason: changed M code number
The following user(s) said Thank You: chen1234
Please Log in or Create an account to join the conversation.
Time to create page: 0.187 seconds