90
Procedures
Section 3-2
1,2,3...
1.
After inputting the variable name in the New Variable Dialog Box, click the
Advanced
Button. The Advanced Settings Dialog Box will be displayed.
2.
Select
Array Variable
in the
Array Settings
and input the maximum number
of elements in the array.
When the name of an array variable is entered in the algorithm in the func-
tion block definition, square brackets surrounding the index will appear af-
ter the array name.
For example, if you create a variable named PV with a maximum of 3 ele-
ments, PV[0], PV[1], and PV[2] could be specified as instruction operands.
There are three ways to specify indices.
• Directly with numbers, e.g., PV[1] in the above example (for ladder pro-
gramming or ST language programming)
• With a variable, e.g., PV[a] in the above example, where “a” is the
name of a variable with a data type of INT (for ladder programming or
ST language programming)
• With an equation, e.g., PV[a+b] or PV[a+1} in the above example,
where “a” and “b” are the names of variables with a data type of INT
(for ST language programming only)
Using Structured Text
When using structured text, a dialog box will not be displayed to register the
variable whenever a variable name that has not been registered is input. Be
sure to always register variables used in standard text programming in the
variable table, either as you need them or after completing the program.
(Place the cursor in the tab page on which to register the variable, right-click,
and select
Insert Variable
from the pop-up menu.
Note
For details on structured text specifications, refer to
SECTION 5 Structured
Text (ST) Language Specifications
in
Part 2: Structured Text (ST).
Copying User Program Circuits and Pasting in Ladder Programming of Function
Block Definitions
A single circuit or multiple circuits in the user program can be copied and
pasted in the ladder programming of function block definitions. This operation,
however, is subject to the following restrictions.
Source Instruction
Operand: Address Only
Addresses are not registered in the function block definition variable tables.
After pasting, the addresses will be displayed in the operand in red. Double-
click on the instruction and input the variable name into the operand.
Note
Index Registers (IR) and Data Registers (DR), however, do not require modifi-
cation after pasting and function in the operand as is.
Select
Array Variable.
Input the number of elements.
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: ......