user defined m code and e-stop

More
02 Jul 2014 22:55 #48389 by johns00056
I am using M100 to start ( and M101 to stop)through spindle coolant and would like it to stop if I e-stop the machine.
And it should stay off when I un- estop and machine-on.

#!/bin/bash
# file to turn on thru spindle coolant
halcmd setp hm2_5i25.0.7i84.0.4.output-02 true
exit 0


#!/bin/bash
# file to turn off thru spindle coolant
halcmd setp hm2_5i25.0.7i84.0.4.output-02 false
exit 0

I am not sure how to approach the problem. I suppose that I could use the

iocontrol.0.coolant-mist pin, but I am already using that pin for air blast.

It is not really a safety problem, just inconvenient.

Please Log in or Create an account to join the conversation.

More
03 Jul 2014 13:33 #48411 by emcPT
Use an "AND component" with the e-stop, so that the output will only be ON if ESTOP is not pressed.

Please Log in or Create an account to join the conversation.

More
03 Jul 2014 13:37 #48412 by ArcEye
Hi

I am using M100 to start ( and M101 to stop)through spindle coolant and would like it to stop if I e-stop the machine.
And it should stay off when I un- estop and machine-on.


You will need to explain what it is you are stopping and starting.

What you describe that you want, happens by default, with normal connections.

regards

Please Log in or Create an account to join the conversation.

More
04 Jul 2014 07:28 - 04 Jul 2014 07:31 #48422 by johns00056
I got it working great, now! Thanks for the help, it is easy when you know how.


loadrt and2 names=tsc

addf tsc servo-thread

net thruspicool tsc.out => hm2_5i25.0.7i84.0.4.output-02 ## closes contactor to start through spindle coolant motor ###

net estop-loop iocontrol.0.user-enable-out => tsc.in1 # input to and2 component #see user defined M code M100 ##
# the above is false if LINUX CNC is in e-stop ####

The following is the M100 file -

#!/bin/bash
# file to turn on thru spindle coolant using the and2 HAL component
halcmd setp tsc.in0 true
exit 0

The previous way that I had it configured, the 7i84 output 02 stayed on when the Axis GUI was e-stopped.


and2 - Two-input AND gate

SYNOPSIS
loadrt and2 [count=N|names=name1[,name2...]]

FUNCTIONS
and2.N

PINS
and2.N.in0 bit in
and2.N.in1 bit in
and2.N.out bit out
out is computed from the value of in0 and in1 according to the
following rule:

in0=TRUE in1=TRUE
out=TRUE

Otherwise,
out=FALSE
Last edit: 04 Jul 2014 07:31 by johns00056.

Please Log in or Create an account to join the conversation.

Time to create page: 0.058 seconds
Powered by Kunena Forum