Elmo HARSFEN0602 Network Hardware User Manual


 
HARSFEN0602
AUTO_ I6 12
Called when a digital input #6 configured to the
“GPI (General purpose Input)” function is
activated. Refer the IL command.
4096
Table 5-1 – Automatic subroutines and their priority
All the automatic routines, except AUTOEXEC, are activated only if a program is running.
Example:
Consider the program
##LOOP
gotoLOOP
**A go forever loop
#@AUTO_I3 **Subroutine definition
**Subroutine body
return **Subroutine end
The forever loop in the first two lines of the routine is intended to make the program run forever, so that the
automatic routine will be able to handle the digital input #3 event.
The #@AUTO_I3 routine will be called if digital input #3 is sensed and not masked.
The digital input #4 will not invoke any automatic action in the user program, since no #@AUTO_I4 routine
is defined to handle digital input #3 event. A user has an option for explicit call of an automatic routine, if it
is desired. The syntax for an auto routine call is the same as for a user function.
5.6.9.2 Automatic Routines Arbitration
Priority and pending automatic routines
Each automatic subroutine has its assigned priority, according to Table
5-1 above.
When the conditions to the activation of two implemented automatic subroutines arise simultaneously the
automatic subroutine with the higher priority will be called.
The other automatic subroutine will be marked as pending. It will execute at the first time it has the
permission to execute – even if the reason for its call does not exist any more.
5.6.9.3 The Automatic Subroutine Mask
Automatic subroutines may be masked, i.e. set inactive. For example, it may be desired to limit the
automatic response to a certain digital input will be limited to certain situations.
This is done using the MI command.
Example:
An amplifier is commanded by a PLC. The Amplifier has an autoexec routine, which activates its program
upon boot. The PLC sends instructions to the Amplifier using RS232 communication for task parameters and
a digital input to start an action immediately. The Amplifier sets output according to the state of the program.
For safety, the Amplifier is not allowed to perform any task before digital input 2 is set:
function autoexec () **Declare the autoexec function
mi=8; **Inhibit the routine #@AUTO_I1
op=1; **Set output to indicate start.
….
while (!IB[2]) ** Wait for setting the digital input 2
end
goto #@TEST_PARS; **Jump to subroutine
##LOOP **Label LOOP
**Label LOOP body