Description
The "Initialize all retain data" instruction is used to reset the retentive data of all data blocks, bit memories and SIMATIC timers and counters at the same time. The instruction can only be executed within a startup OB because the execution exceeds the program cycle duration.
Parameters
The following table shows the parameters of the "Initialize all retain data" instruction:
|
Parameters |
Declaration |
Data type |
Memory area |
Description |
|---|---|---|---|---|
|
EN |
Input |
BOOL |
I, Q, M, D, L, T, C or constant |
Enable input |
|
ENO |
Output |
BOOL |
I, Q, M, D, L |
Enable output |
|
REQ |
Input |
BOOL |
I, Q, M, D, L, T, C or constant |
If the input "REQ" has the signal state "1", all retentive data are reset. |
|
RET_VAL |
Output |
INT |
I, Q, M, D, L |
Error information: If an error occurs during execution of the instruction, an error code is output in the RET_VAL parameter. |
For additional information on valid data types, refer to "See also".
Parameter RET_VAL
The following table shows the meaning of the values of the RET_VAL parameter:
|
Error code* |
Explanation |
|---|---|
|
0000 |
No error |
|
80B5 |
The instruction cannot be executed because it was not programmed within a startup OB. |
|
General error information |
See also: "GET_ERR_ID: Get error ID locally" |
|
*The error codes can be displayed as integer or hexadecimal values in the program editor. You will find information on changing display formats in "See also". |
|
Example
The following example shows how the instruction works:
If the operands "TagIn_1" and "Tag_REQ" have signal state "1", the instruction is executed. All retentive data of all data blocks, bit memories and SIMATIC timers and counters are reset. If the instruction is executed without errors, the ENO enable output has the signal state "1".