Omron CX-PROGRAMMER V8.1 Operation Manual page 115

Function blocks/ structured text
Table of Contents

Advertisement

Procedures
1,2,3...
Using Structured Text
Note
Copying User Program Circuits and Pasting in Ladder Programming of Function
Block Definitions
Source Instruction
Operand: Address Only
Note
90
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)
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.
For details on structured text specifications, refer to SECTION 5 Structured
Text (ST) Language Specifications in Part 2: Structured Text (ST).
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.
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.
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.
Section 3-2

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sysmac ws02-cxpc1-v8Sysmac cx-programmer 8.1

Table of Contents