- Posts: 58
- Thank you received: 0
Implementation of M code control executable program
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 to join the conversation.
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 to join the conversation.
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
Please Log in to join the conversation.
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 to join the conversation.
- tommylight
-
- Away
- Administrator
-
Less
More
- Posts: 22010
- Thank you received: 3
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.
Please Log in to join the conversation.
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 )
Please Log in to join the conversation.
5 years 3 months ago #216047
by bevins
Replied by bevins on topic Implementation of M code control executable program
I thought M100 - M199 were not suppose to be remapped. I'm pretty sure that is in the docs somewhere.
Please Log in to join the conversation.
5 years 3 months ago #216048
by Aciera
Replied by Aciera on topic Implementation of M code control executable program
Thanks bevins, I changed the number.
Please Log in to join the conversation.
5 years 2 months ago #216538
by andypugh
Replied by andypugh on topic Implementation of M code control executable program
Just to throw something else into the mix: It is probably possible to use M3/M5 as normal, but feed the spindle.N.on HAL pin into a custom HAL component that uses the Laser API to switch it on and off.
Please Log in to join the conversation.
Time to create page: 0.092 seconds
