Omron CX-PROGRAMMER V9 - REV 12-2009 Operation Manual page 157

Table of Contents

Advertisement

OMRON
Errors will not occur in the following cases even though operation will not be normal.
1.
The name of each structure symbol in one PLC must be unique.
For example, do not register structure symbols with the same name as both a global symbol and a
local symbol. Also, do not register structure symbols with the same name for two local symbols.
2.
The name of a program or function block cannot be used as the name of a structure symbol or
member in the same PLC.
Specifying Arrays
Variables can be specified as arrays with CX-Programmer Ver. 7.2 or higher (see note).
Variables can be specified as any data type, excluding STRING and NUMBER.
Note:
An array variable is specified if more than one variable of the same data type is being used and those variables
are to be managed as a group.
Perform the following procedure to specify an array variable.
1.
Enter the variable name in the New Variable or Edit Variable Dialog Box and click the Advance Settings
Button. The Detailed Settings Dialog Box will be displayed.
2.
Check the Array Variable checkbox in the array settings field and enter the maximum number of elements.
In ladder, ST, and SFC languages, the array variable name must be followed by the subscript in square brackets
[ ].
For example, the variable name "PV" with three maximum elements would be specified as PV[0], PV[1], and
PV[2] in the instruction operand.
Subscripts can be specified only by directly using numbers. Subscripts cannot be specified by using variables.
Using Subscripts with Array Variables on the CJ2
When using a CJ2 CPU Unit, the number of the element can be directly input using the subscript of an array
variable in the ladder program. The number of the element can also be indirectly specified using a word address
or symbol. The word address or symbol that indirectly specifies the number of the element is placed into
brackets [ ] after the array variable name.
The format to specify the subscript of an array variable is as follows:
A[B]
Subscript: Element number, word address,
symbol
Array variable name
The above example specifies the element that is offset from start address (A) by the value specified by the
subscript (B) (see note) based on the data type of the array variable.
An offset address cannot be used as an operand in an instruction for which immediate refreshing is specified.
Note:
E15_, E16_, E17_, E18_, E19_, E1A_, E1B_, E1C_, E1D_, E1E_, E1F_, FB, G, H, HR,
IO, IR, L, LR, S, ST, T, TIM, TK, TN, TR, W, and S
Predefined Character Strings
The following predefined character strings cannot be used. (These are not case
sensitive.)
BOOL, CHANNEL, COUNTER, DINT, DWORD, INT, LINT, LREAL, LWORD,
NUMBER, REAL, STRING, TIMER, UDINT, UDINT_BCD, UINT, UINT_BCD,
ULINT, ULINT_BCD, WORD, and STRUCT
Using the Same Structure Symbol Name More Than Once
Programs and Function Blocks with the Same Names as Structure Symbols or Members
Only one-dimensional arrays are possible with CX-Programmer.
When setting a subscript for an array variable, do not specify a subscript that would cause the
resulting address to be outside of the memory area that contains the first word in the array. Be
particularly careful when using a word address or symbol to specify the subscript. Depending
PART 1: CX-Programmer
CHAPTER 4 – Reference
CX-Programmer _Page 77

Advertisement

Table of Contents
loading

Table of Contents