101BExtended instructions
8.4 Interrupts
S7-1200 Programmable controller
280
System Manual, 11/2011, A5E02486680-05
Parameter and type
Data type
Description
SIGN
1
IN
Word
Not used by the S7-1200: Any value is accepted. A value must be
assigned to prevent errors.
RET_VAL
OUT
Int
Execution condition code
STATUS
OUT
Word
QRY_DINT instruction: Status of the specified time-delay interrupt OB,
see the table below
1
Only for SRT_DINT
Operation
The SRT_DINT instruction specifies a time delay, starts the internal time delay timer, and
associates a time delay interrupt OB subprogram with the time delay timeout event. When
the specified time delay has elapsed, a program interrupt is generated that triggers the
execution of the associated time delay interrupt OB. You can cancel an in-process time
delay interrupt before the specified time delay occurs by executing the CAN_DINT
instruction. The total number of active time delay and cyclic interrupt events must not exceed
four.
Adding time delay interrupt OB subprograms to your project
Only time delay interrupt OBs can be assigned to the SRT_DINT and CAN_DINT
instructions. No time delay interrupt OB exists in a new project. You must add time delay
interrupt OBs to your project. To create a time-delay interrupt OB, follow these steps:
1.
Double-click the "Add new block" item in the "Program blocks" branch of the project tree,
select "Organization block (OB)", and choose "Time delay interrupt".
2.
You have the option to rename the OB, select the programming language, or select the
block number. Switch to manual numbering if you want to assign a different block number
than the number that was assigned automatically.
3.
Edit the time delay interrupt OB subprogram and create programmed reaction that you
want to execute when the time delay timeout event occurs. You can call other FC and FB
code blocks from the time delay interrupt OB, with a maximum nesting depth of four.
4.
The newly assigned time delay interrupt OB names will be available when you edit the
OB_NR parameter of the SRT_DINT and CAN_DINT instructions.
QRY_DINT parameter STATUS
Table 8- 98 If there is an error (REL_VAL <> 0), then STATUS = 0.
Bit
Value
Description
0
In RUN
0
1
In startup
0
The interrupt is enabled.
1
1
The interrupt is disabled.
0
The interrupt is not active or has elapsed.
2
1
The interrupt is active.