Help with User M Code

More
5 years 10 months ago #192252 by RobotMatic
video


when the program is stopped by emergency or by the ESC button, Linuxcnc turns off the signals M3-M7-M8 for example.

I am using Linuxcnc 2.8 in a 5 axis configuration for a 2 station induction machine where I have created 4 user M codes.

M100 ON Inductor A
M101 OFF Inductor A

M102 ON Inductor B
M103 OFF Inductor B

When I create my special M code, I cannot connect it to any signal, a condition that I must respect for my M code to work.

So, I can't understand how I can make the M codes created run in the same ESC or emergency situation to turn off the inductors.

in my configuration it would be to execute M101-M103


for example

# M100 Encendido Inductor A

halcmd setp parport.0.pin-01-out TRUE

exit 0

Thanks for the help

Please Log in to join the conversation.

More
5 years 10 months ago #192264 by Aciera
Replied by Aciera on topic Help with User M Code
Add this to your .ini file:
Code:
[HALUI] MDI_COMMAND = M101 (OFF Inductor A) MDI_COMMAND = M103 (OFF Inductor B)

Then in your .hal file connect like this as an example:
Code:
net inductors-off <= halui.estop.is−activated => halui.mdi-command-00 => halui.mdi-command-01

Please Log in to join the conversation.

More
5 years 10 months ago #192266 by cmorley
Replied by cmorley on topic Help with User M Code
I think you could use an and2 component.
connect the output to the parallel port pin
connect one input to estop
set the other input from your Mcode file.

Chris

Please Log in to join the conversation.

More
5 years 10 months ago #192336 by RobotMatic
Replied by RobotMatic on topic Help with User M Code
Thank you very much for the help, I will be modifying it. I'm learning a lot thanks to the help of this forum !!! thanksssss

Please Log in to join the conversation.

Time to create page: 0.090 seconds
Powered by Kunena Forum