36
Function Block Specifications
Section 2-1
Retain Data through Power Interruptions and Start of Operation
Internal variables retain the value from the last time that the instance was
called. In addition, the Retain Option can be selected so that an internal vari-
able will also retains its value when the power is interrupted or operation
starts (the mode is switched from PROGRAM to RUN or MONITOR mode).
When the Retain Option is selected, the value of the variable is retained when
the power is interrupted or operation starts unless the CPU Unit does not
have a backup battery. If the CPU Unit does not have a good battery, the value
will be unstable.
When the Retain Option is not selected, the value of the variable will not be
held when the power is interrupted or operation starts. Even variables not set
to be retained, however, can be held at the start of operation by turning ON
the IOM Hold Bit (A50012) and can be held during power interruptions by set-
ting the PLC Setup, as shown in the following table.
Note
The IOM Hold Bit (A50012) is supported for compatibility with previous mod-
els. To hold the values of variables in function blocks, however, use the
Retain
Option
and not the IOM Hold Bit.
Initial Value
An initial value can be set for an internal variable that is not being retained
(i.e., when the Retain Option not selected). An initial value cannot be set for
an internal variable if the Retain Option is selected.
Internal variables that are not being retained will be initialized to 0.
The initial value will not be written to the internal variable if the IOM Hold Bit
(A50012) is ON
.
Variables
Condition
Status
Variables set to
Retain
Start of operation
Retained
Power ON
Retained
SIGN IN16 tmp
EN
+L IN32 tmp OUT32
tmp
DINT
EN
BOOL
IN16
INT
IN32
DINT
ENO
BOOL
OUT32
DINT
D1000
0.0
10.0
D200
ADD_INT_DINT
EN
ENO
IN16 OUT32
IN32
D100
Internal variable tmp
is not displayed.
Algorithm (Body)
Variable table
Name
Internal
Input
Input
Input
Output
Output
Type
Variables
Condition
IOM Hold Bit (A50012) setting
OFF
ON
IOM Hold Bit Status at Startup
(PLC Setup) selected
IOM Hold Bit Status at Startup
(PLC Setup) not selected
Variables not
set to
Retain
Start of operation Not retained
Retained
Retained
Power ON
Not retained
Retained
Not retained
Auxiliary Area control bit
Initial value
IOM Hold Bit (A50012)
ON
The initial value will not be set.
OFF
The initial value will be set.
Summary of Contents for CX-PROGRAMMER V8.1
Page 3: ...iv...
Page 5: ...vi...
Page 7: ......
Page 15: ...xvi...
Page 19: ...xx...
Page 25: ...xxvi Application Precautions 4...
Page 26: ...Part 1 Function Blocks...
Page 27: ......
Page 153: ...128 Procedures Section 3 2...
Page 154: ...Part 2 Structured Text ST...
Page 155: ......
Page 159: ...134 CX Programmer Specifications Section 4 2...
Page 205: ...180 Procedures Section 6 1...
Page 207: ...182 System defined external variables supported in function blocks Appendix A...
Page 229: ...204 Revision History...
Page 230: ......