- Posts: 598
- Thank you received: 0
Digital Input
1 year 6 months ago #326812
by vre
Digital Input was created by vre
If i have this in hal
and this subroutine code
How can change this code to check if spindle is stopped
if i have not set this pin
In reality spindle is connected to mesa daughter card 7i33
and i want to check from subroutine code if it is stopped.
Code:
#M66 Digital Inputs
net spindle-stoped motion.digital-in-03 mesa_input_pin
Code:
M66 P3 L3 Q4 ;Check for spindle stopped - wait up to 4 seconds for digital input 3 to turn on
o307 if [#5399 LT 0]
(abort, spindle not stopped)
o307 endif
How can change this code to check if spindle is stopped
if i have not set this pin
Code:
net spindle-stoped motion.digital-in-03 mesa_input_pin
In reality spindle is connected to mesa daughter card 7i33
and i want to check from subroutine code if it is stopped.
Please Log in to join the conversation.
1 year 6 months ago #326819
by andypugh
Replied by andypugh on topic Digital Input
is "mesa-input-pin" just a placeholder?
I don't really understand the question. Are you wanting to not have the HAL entry for some reason?
I don't really understand the question. Are you wanting to not have the HAL entry for some reason?
Please Log in to join the conversation.
1 year 6 months ago #326840
by vre
Replied by vre on topic Digital Input
The code needs a digital input pin for stopped-spindle to work
because i do not have this stopped-spindle digital input how can check
in subroutine code if spindle is stopped ?
mesa_input_pin can be hm2_7i80.0.gpio.003.in
because i do not have this stopped-spindle digital input how can check
in subroutine code if spindle is stopped ?
mesa_input_pin can be hm2_7i80.0.gpio.003.in
Please Log in to join the conversation.
1 year 6 months ago #326847
by rodw
Replied by rodw on topic Digital Input
Probably what you need is spindle.0.at-speed but its true when running
Being a mesa card your pin probably has a matching .not signal otherwise, use the not component to invert the signal
Being a mesa card your pin probably has a matching .not signal otherwise, use the not component to invert the signal
Please Log in to join the conversation.
1 year 6 months ago #326852
by vre
Replied by vre on topic Digital Input
So this code does the same thing?
(pwmgen.00 is the spindle pwmgen)
(pwmgen.00 is the spindle pwmgen)
Code:
o307 if [#<_hal[[pwmgen.00.enable]> GT 0]
(abort, spindle not stopped)
o307 endif
Please Log in to join the conversation.
1 year 6 months ago #326895
by andypugh
Replied by andypugh on topic Digital Input
If you want to be sure that the spindle is actually stopped, then use something like a HAL "wcomp" to provide a "true" signal when the spindle encoder velocity is very close to zero.
linuxcnc.org/docs/stable/html/man/man9/wcomp.9.html
linuxcnc.org/docs/stable/html/man/man9/wcomp.9.html
Please Log in to join the conversation.
Time to create page: 0.091 seconds
