20
Variables
Section 1-3
Refer to
Variable Definitions
in
2-1-2 Function Block Elements
for details on
AT settings and
2-5-3 AT Settings for Internal Variables
for details on using
AT settings.
Array Settings
A variable can be treated as a single array of data with the same properties.
To convert a variable to an array, specify that it is an array and specify the
maximum number of elements.
This property can be set for internal variables and input-output variables only.
Only one-dimensional arrays are supported by the CX-Programmer Ver. 5.0
and later versions.
• Setting Procedure
Click the
Advanced
Button, select the
Array Variable
option, and input the
maximum number of elements.
• When entering an array variable name in the algorithm in a function block
definition, enter the array index number in square brackets after the vari-
able number.
For details on array settings, refer to
Variable Definitions
in
2-1-2 Function
Block Elements
.
Initial Value
This is the initial value set in a variable before the instance is executed for the
first time. Afterwards, the value may be changed as the instance is executed.
For example, set a boolean (BOOL) variable (bit) to either 1 (TRUE) or 0
(FALSE). Set a WORD variable to a value between 0 and 65,535 (between
0000 and FFFF hex).
If an initial value is not set, the variable will be set to 0. For example, a bool-
ean variable would be 0 (FALSE) and a WORD variable would be 0000 hex.
Retain
Select the
Retain Option
if you want a variable’s data to be retained when the
PLC is turned ON again and when the PLC starts operating.
• Setting Procedure
Select the
Retain Option
.
Size
When a STRING variable is used, the size required to store the text string can
be set to between 1 and 255 characters.
1-3-4
Variable Properties and Variable Usage
The following table shows which properties must be set, can be set, and can-
not be set, based on the variable usage.
(1) The value of the input parameter will be given.
(2) Valid only for STRING variables.
Property
Variable usage
Internals
Inputs
Outputs
In Out
Name
Must be set.
Must be set.
Must be set.
Must be set.
Data Type
Must be set.
Must be set.
Must be set.
Must be set.
AT (specified
address)
Can be set.
Cannot be set. Cannot be set. Cannot be set.
Array specification
Must be set.
Cannot be set. Cannot be set. Must be set.
Initial Value
Can be set.
Cannot be set.
(See note 1.)
Can be set.
Cannot be set.
Retained
Can be set.
Cannot be set.
(See note 1.)
Can be set.
Cannot be set.
Size
Can be set.
(See note 2.)
Cannot be set. Cannot be set. Cannot be set.
Содержание SYSMAC CX-Programmer 9
Страница 2: ......
Страница 4: ...iv ...
Страница 6: ...vi ...
Страница 8: ......
Страница 16: ...xvi ...
Страница 20: ...xx ...
Страница 26: ...xxvi Application Precautions 4 ...
Страница 27: ...Part 1 Function Blocks ...
Страница 28: ......
Страница 154: ...128 Procedures Section 3 2 ...
Страница 155: ...Part 2 Structured Text ST ...
Страница 156: ......
Страница 160: ...134 CX Programmer Specifications Section 4 2 ...
Страница 206: ...180 Procedures Section 6 1 ...
Страница 208: ...182 System defined external variables supported in function blocks Appendix A ...
Страница 230: ...204 Revision History ...
Страница 231: ......