Hi,
when using Auto External , which signal is used to stop the program? the $MOVE_ENABLE ?
Thanks
Hi,
when using Auto External , which signal is used to stop the program? the $MOVE_ENABLE ?
Thanks
YES
I always use interrupts with the BRAKE and RESUME statements inside of them.
The flag which is linked to the interrupts is set from within the SPS.
My usual program structure is like the following:
DEF main_application_loop( )
;INT_stop is a global boolean variable
INTERRUPT DECL 16 WHEN INT_stop DO int16_stop()
INTERRUPT ON 16
LOOP
isr_called_from_cycle=FALSE
WAIT SEC 0.012 ;this prevents overloading the CPU
;here i am waiting for requests from SPS
IF cycle1_request THEN
cycle1_request=FALSE
cycle1_run()
ENDIF
ENDLOOP
END
Display More
DEF int16_stop ( )
BRAKE F
INT_stop=FALSE
IF ISR_called_from_cycle THEN
RESUME
;this allows the robot interpreter to return to the main_application_loop() function
;the flag allows the RESUME statement to be executed ony if a function has been
;called from within the main_application_loop, because that loop never returns
ENDIF
END
You can use alternative "HALT" command without signal.