HARSFEN0602
goto ##LOOP; **Endless loop
#@TEST_PARS **Subroutine
op=2; **Set output 2
wait 2000; **Wait 2 seconds for testing the part
mi=0; **Enable automatic handling of digital in #1
goto ##LOOP;
return **End of the autoexec function
#@AUTO_I1 **Automatic handler for digital input #1
op=3; **Set output 3 to indicate din 1 sensed.
**Subroutine body.
return **Subroutine end
exit **Exit from the program
The mask may also be used for preventing that switch bouncing will generate spurious routine calls
Example:
A machine performs a periodic task.
Digital input #1 is connected to a sensor to which the Amplifier should react.
The code below limits the automatic response to digital input #1during to executing the #@AUTO_I1
routine code, even though the digital input #1 may bounce.
##LOOP; **Repetitive task
MI=0; **Re-enable automatic routine
goto ##LOOP;
#@AUTO_I1 **Automatic handler for digital input #1
MI=MI|8; **Prevent nested calls to #@AUTO_I1
**Subroutine body
return **Subroutine end