![Omron SYSMAC CX-Programmer 9 Operation Manual Download Page 65](http://html1.mh-extra.com/html/omron/sysmac-cx-programmer-9/sysmac-cx-programmer-9_operation-manual_744241065.webp)
39
Function Block Specifications
Section 2-1
• An array can be set only for internal variables or input-output variables.
• Any data type except for STRING can be specified for an array variable,
as long as it is an internal variable.
• When entering an array variable name in the algorithm of a function block
definition, enter the array index number in square brackets after the vari-
able name. The following three methods can be used to specify the index.
(In this case the array variable is a[].)
• Directly with numbers (for ladder or ST language programming)
Example: a[2]
• With a variable (for ladder or ST language programming)
Example: a[n], where n is a variable
Note
INT, DINT, LINT, UINT, UDINT, or ULINT can be used as the vari-
able data type.
• With an equation (for ST language programming only)
Example: a[b+c], where b and c are variables
Note
Equations can contain only arithmetic operators (+,
−
, *, and /).
An array is a collection of data elements that are the same type of data. Each
array element is specified with the same variable name and a unique index.
(The index indicates the location of the element in the array.)
A one-dimensional array is an array with just one index number.
Example: When an internal variable named SCL is set as an array variable
with 10 elements, the following 10 variables can be used:
SCL[0], SCL[1], SCL[2], SCL[3], SCL[4], SCL[5], SCL[6], SCL[7], SCL[8], and
SCL[9]
Note
Use an array variable when specifying the first or last of multiple words in an
instruction operand to enable reusing the function block if an internal variable
with a AT property cannot be set for the operand and an external variable can-
not be set. When using an array setting for an input-output variable, specify
the address of the first word for the input parameter (CX-Programmer version
7.0 or higher). When using an array setting for an internal variable, prepare an
array variable with the number of elements for the required size, and after set-
DINT/UDINT/DWORD
1,024
LINT/ULINT/LWORD
512
Data type
Number of elements
SCL
0
1
2
3
4
5
6
7
8
9
Specify SCL[3] to access this data element.
WORD variable
WORD variable
WORD variable
WORD variable
WORD variable
WORD variable
WORD variable
WORD variable
WORD variable
WORD variable
Settings for variable SCL as an array
variable with element numbers 0 to 9.
Summary of Contents for SYSMAC CX-Programmer 9
Page 2: ......
Page 4: ...iv ...
Page 6: ...vi ...
Page 8: ......
Page 16: ...xvi ...
Page 20: ...xx ...
Page 26: ...xxvi Application Precautions 4 ...
Page 27: ...Part 1 Function Blocks ...
Page 28: ......
Page 154: ...128 Procedures Section 3 2 ...
Page 155: ...Part 2 Structured Text ST ...
Page 156: ......
Page 160: ...134 CX Programmer Specifications Section 4 2 ...
Page 206: ...180 Procedures Section 6 1 ...
Page 208: ...182 System defined external variables supported in function blocks Appendix A ...
Page 230: ...204 Revision History ...
Page 231: ......