19
Variables
Section 1-3
• Ladder programming language: Enter hexadecimal numerical values
after the # and decimal values after the &.
• Structured text (ST language): Enter hexadecimal numerical values af-
ter 16# and enter decimal numerical values as is.
Exception: Enter directly or indirectly specified addresses for Index Registers
IR0 to IR15 and Data Registers DR0 to DR15 directly into the instruction
operand.
1-3-2
Variable Usage and Properties
Variable Usage
The following variable types (usages) are supported.
Internals:
Internal variables are used only within an instance. They cannot
be used pass data directly to or from I/O parameters.
Inputs:
Input variables can input data from input parameters outside of
the instance. The default input variable is an EN (Enable) vari-
able, which passes input condition data.
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.
In Out:
Input-output variables can input data from input parameters out-
side of the instance and can return the results of processing in a
function block instance to external parameters.
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, and STRING
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.
Содержание CX-PROGRAMMER V8.1
Страница 3: ...iv...
Страница 5: ...vi...
Страница 7: ......
Страница 15: ...xvi...
Страница 19: ...xx...
Страница 25: ...xxvi Application Precautions 4...
Страница 26: ...Part 1 Function Blocks...
Страница 27: ......
Страница 153: ...128 Procedures Section 3 2...
Страница 154: ...Part 2 Structured Text ST...
Страница 155: ......
Страница 159: ...134 CX Programmer Specifications Section 4 2...
Страница 205: ...180 Procedures Section 6 1...
Страница 207: ...182 System defined external variables supported in function blocks Appendix A...
Страница 229: ...204 Revision History...
Страница 230: ......