Advanced Function Instruction
7 -5 2
FUN 69
RTI
RETURN FROM INTERRUPT
FUN 69
RTI
z
The function of this instruction is similar to RTS. Nevertheless, RTS is used to end the execution of sub
program, and RTI is used to end the execution of interrupt service program. Please refer to the explanation
of RTS instruction.
z
A RTI instruction can be shared by more than one interrupt service program. The usage is the same as the
sharing of an RTS by many subroutines. Please refer to the explanation of CALL instruction.
z
The difference between interrupts and call is that the sub program name (LBL) of a call is defined by user,
and the label name and its call instruction are included in the main program or other sub program.
Therefore, when PLC performs the CALL instruction and the input “EN”=1 or “EN
↑
” (
instruction)
changes from 0
→
1, the PLC will call (execute) this sub program. For the execution of interrupt service
program, it is directly used with hardware signals to interrupt CPU to pause the other less important works,
and then to perform the interrupt service program corresponding to the hardware signal (we call it the
calling of interrupt service program). In comparing to the call instruction that need to be scanned to
execute, the interrupt is a more real time in response to the event of the outside world. In addition, the
interrupt service program cannot be called by label name; therefore we preserve the special “reserved
words” label name to correspond to the various interrupts offered by PLC (check FUN65 explanation for
details). For example, the reserved word X0+I is assigned to the interrupt occurred at input point X0; as
long as the sub program contains the label of X0+I, when input point X0 interrupt is occurred (X0:
), the
PLC will pause the other lower priority program and jump to the subroutine address which labeled as X0+I
to execute the program immediately.
z
If there is a interrupt occurred while CPU is handling the higher priority (such as hardware high speed
counter interrupt) or same priority interrupt program (please refer to Chapter 10 for priority levels), the PLC
will not execute the interrupt program for this interrupt until all the higher priority programs were finished.
z
If the RTI instruction cannot be reached and performed in the interrupt service routine, may cause a serious
CPU shut down. Consequently, no matter how you control the flow of program, it must be assured that the
RTI instruction will be executed in any interrupt service program.
z
For the detailed explanation and example for the usage of interrupts, please refer to Chapter 10 for
explanation.
Содержание FBs-CBE
Страница 78: ...MEMO ...
Страница 111: ...4 6 X0 X1 Node A Y0 Y1 Node B differential down Incerse differential up t Scan time Inverse t t ...
Страница 141: ...Basic Function Instruction 6 16 FUN 2 SKP SKIP START FUN 2 SKP Y2 Y1 Y0 T201 10S X0 X1 X2 0 10 0 ...
Страница 305: ...MEMO ...
Страница 348: ...MEMO ...