14
Variables
Section 1-3
Outputs:
Output variables can output data to output parameters outside of
the instance. The default output variable is an ENO (Enable Out)
variable, which passes the instance’s execution status.
Externals:
External variables are either system-defined variables registered
in advance with the CX-Programmer, such as the Condition Flags
and some Auxiliary Area bits, or user-defined global symbols for
use within instances.
For details on variable usage, refer to the section on
Variable Type (Usage)
under
Variable Definitions
in
2-1-2 Function Block Elements
.
The following table shows the number of variables that can be used and the
kind of variable that is created by default for each of the variable usages.
1-3-3
Variable Properties
Variables have the following properties.
Variable Name
The variable name is used to identify the variable in the function block. It
doesn’t matter if the same name is used in other function blocks.
Note
The variable name can be up to 30,000 characters long, but must not begin
with a number. Also, the name cannot contain two underscore characters in a
row. The character string cannot be the same as that of a an index register
such as in IR0 to IR15. For details on other restrictions, refer to
Variable Defi-
nitions
in
2-1-2 Function Block Elements
.
Data Type
Select one of the following data types for the variable:
BOOL, INT, UINT, DINT, UDINT, LINT, ULINT, WORD, DWORD, LWORD,
REAL, LREAL, TIMER, COUNTER
For details on variable data types, refer to
Variable Definitions
in
2-1-2 Func-
tion Block Elements
.
AT Settings (Allocation to
an Actual Addresses)
It is possible to set a variable to a particular I/O memory address rather than
having it allocated automatically by the system. To specify a particular
address, the user can input the desired I/O memory address in this property.
This property can be set for internal variables only. Even if a specific address
is set, the variable name must still be used in the algorithm.
Refer to
Variable Definitions
in
2-1-2 Function Block Elements
for details on
AT settings and
2-4-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 only. Only one-dimensional
arrays are supported by the CX-Programmer Ver. 5.0.
• 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.
Summary of Contents for CS1-H Series
Page 3: ...iv...
Page 5: ...vi...
Page 7: ...viii TABLE OF CONTENTS...
Page 15: ...xvi Application Precautions 4...
Page 151: ...136 Procedures Section 3 2...
Page 153: ...138 Data Types Appendix A...
Page 177: ...162 External Variables Appendix C...
Page 181: ...166 Revision History...