Increment counter w...
 
Notifications
Clear all

Increment counter when rotating endlessly

1 Posts
1 Users
0 Likes
89 Views
(@Dan_S)
Posts: 0
New Member Guest
 

I can reset the bit for the encoder wraparound, but what would the code be for a counter while the motor just spins endlessly.
The application is testing sections of vacuum hose. We have a weight on the end where, if it fails, the motor will stop. That part works using the Bt bit and watching the voltage:

WHILE Bt 'During trajectory...
IF UJA>28100 'True if hose broke
OFF
ENDIF
LOOP

For the encoder I took this from the manual, but found nothing on the counter:

IF Bw 'Test flag
PRINT("Wraparound Occurred")
Zw 'Reset flag
ENDIF

My question is how do you increment a counter to track revolutions, and if that counter overflows, can I cascade a second counter?
Thanks All

 
Posted : 22/10/2019 4:44 am
Share: