![Omron CX-PROGRAMMER V8.1 Operation Manual Download Page 64](http://html1.mh-extra.com/html/omron/cx-programmer-v8-1/cx-programmer-v8-1_operation-manual_744203064.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 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: ......