Digital Input
- vre
- Online
- Platinum Member
-
Less
More
- Posts: 637
- Thank you received: 17
21 Apr 2025 14:07 - 21 Apr 2025 21:31 #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.
#M66 Digital Inputs
net spindle-stoped motion.digital-in-03 mesa_input_pin
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
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.
Last edit: 21 Apr 2025 21:31 by vre.
Please Log in or Create an account to join the conversation.
- andypugh
-
- Offline
- Moderator
-
Less
More
- Posts: 23288
- Thank you received: 4936
21 Apr 2025 17:12 #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 or Create an account to join the conversation.
- vre
- Online
- Platinum Member
-
Less
More
- Posts: 637
- Thank you received: 17
21 Apr 2025 21:27 - 21 Apr 2025 21:29 #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
Last edit: 21 Apr 2025 21:29 by vre.
Please Log in or Create an account to join the conversation.
- rodw
-
- Offline
- Platinum Member
-
Less
More
- Posts: 11201
- Thank you received: 3735
21 Apr 2025 22:47 #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 or Create an account to join the conversation.
- vre
- Online
- Platinum Member
-
Less
More
- Posts: 637
- Thank you received: 17
21 Apr 2025 23:11 #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)
o307 if [#<_hal[[pwmgen.00.enable]> GT 0]
(abort, spindle not stopped)
o307 endif
Please Log in or Create an account to join the conversation.
Time to create page: 0.079 seconds