You are on page 1of 3

Structure Symbols

Specifying Structure Symbols


A data structure is a user-defined data type that can contain more than one data type.
Names can be assigned to the data types.
(Supported only for CX-Programmer version 9.0 or higher and CJ2 CPU Units.)
Ladder Program Notation for and Inputting Structure Symbols
In a Ladder Program, the structure symbol name and member name are separated by a period.
Example:
Note: If a member is also a data structure, another period is used to specify the member.
Creating Data Types for Data Structures
Inserting New Data Types for Data Structures
1. Double-click the Data Types Icon in the project workspace.
2. Select Struct from the Insert Menu.
The Edit Structure Dialog Box will be displayed.
3. Input a name for the structure data type.
4. Click the OK Button. The structure data type will be inserted into the data type view.
Inserting a New Member
1. To add a member as the last member of the structure data type, select the data structure.
To insert a new member before a member, select the member.
2. Select Member from the Insert Menu.
The Edit Structure Dialog Box will be displayed.
3. Input a name for the member.
Select the data type of the new member.
Set the array size to 0 if the new member is not an array.
If the new member is an array, input the number of elements in the array.
4. Click the OK Button. The member will be inserted.
Registering Data Structure Symbols
Page 1 of 3 Structure Symbols
15.2.2013 mk:@MSITStore:C:\Program%20Files\OMRON\CX-One\CX-Programmer\cx-p.chm::/...
To insert a symbol into the symbol table, select a registered structure data type in data type view.
Rules for Address Allocation to Structure Symbols
When the first address is set for a structure symbol, addresses are automatically allocated in the order of
member registrations.
If there are members with a BOOL data type, addresses are allocated as described below. Some addresses
may not be used.
BOOL Members Mixed with Non-BOOL Members
Addresses in different words are allocated to the members.
Example:
D0.0 is allocated to Member1 (BOOL) and D1 is allocated to the next member, Member2 (INT).
Consecutive BOOL Members
Bits in the same word are allocated to consecutive BOOL members.
Example:
D0.0 is allocated to Member1 (BOOL) and D0.1 is allocated to the next member, Member2 (BOOL).
If more than 16 consecutive bits are required, bits in the next word are allocated.
Non-consecutive BOOL Members
Addresses in different words are allocated to the BOOL members.
Example:
D0.0 is allocated to Member1 (BOOL), D1 is allocated to Member2 (INT), and D2.0 is allocated to Member3
(BOOL).
BOOL Members That Are Arrays Next to BOOL Members That Are Not Arrays
Addresses in different words are allocated to the members that are arrays and to the members that are not.
Example:
D0.0 is allocated to Member1 (BOOL) and bits starting with D1.0 are allocated to the next member,
Member2 (BOOL array).
Consecutive BOOL Array Members
Addresses in different words are allocated to the BOOL members.
Example:
Bits starting with D0.0 are allocated to Member1 (BOOL array) and bits starting with D1.0 are allocated to
the next member, Member2 (BOOL array).
Specifications of Structure Symbols
Member Data Types
The following data types can be used for members.
BOOL, WORD, DWORD, LWORD, INT, DINT, LINT, UNIT, UDINT, ULINT, REAL, LREAL, and user-defined
structure data types
Memory Areas That Can Be Allocated to Structure Symbols
Addresses in the following memory areas can be allocated to structure symbols.
CIO
WR
HR
DM
EM
In the symbol table, specify an address in one of the above areas as the first address of the data structure.
Symbol Tables in Which Structure Symbols Can Be Registered
Structure symbols can be registered in the following symbol tables.
- Global symbol table
- Local symbol tables for ladder, ST, and SFC*1 programs
- Symbol (variable) tables for function blocks (internal variables, input-output variables, and external
variables)
Page 2 of 3 Structure Symbols
15.2.2013 mk:@MSITStore:C:\Program%20Files\OMRON\CX-One\CX-Programmer\cx-p.chm::/...
*1 Structure symbols cannot be used on the SFC Chart View or Sub-chart View
Size of Structure Symbols
The maximum size of one structure symbol is as follows:
Internal variables:32000CH
Input-output variables:2048CH
Maximum Number of Structure Symbols
The number of structure symbols that is created for one PLC must satisfy the following formula: Number of
structure symbols + Number of members in those structure symbols 4,000
Example: A data structure with three members must be counted as 4 elements in determining if the maximum
number of data structures has been exceeded.
Nesting Levels for Data Structures within Data Structures
A data structure can be used as the member of another data structure.
Data structures can be nested to up to eight levels.
Subscripts of Data Structure Arrays
Either constants or symbols*1 can be used as subscripts of data structure arrays.
Addresses and formulas cannot be used.
*1: Symbols can be used only for the first data structure array.
Subscripts of Array Data Structures
The subscripts must be constants.
Symbols, addresses, and formulas cannot be used.
Precautions for Data Structure Symbols
Character Restrictions for Structure Symbol Names, Structure Data Type Names, and Member Names
Character Strings That Would Be Confused with Area Specifications
Names that start with the following characters followed by only numbers cannot be used.
A, AC, AR, C, CF, CNT, D, DIFF, DM, DR, E, EM, E0_, E1_, E2_, E3_, E4_, E5_, E6_, E7_, E8_, E9_, EA_,
EB_, EC_, ED_, EE_, EF_, E10_, E11_, E12_, E13_, E14_, 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 ] ,[ STRUCT]
Errors will not occur in the following cases even though operation will not be normal.
1. Using the Same Structure Symbol Name More Than Once
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. Programs and Function Blocks with the Same Names as Structure Symbols or Members
The name of a program or function block cannot be used as the name of a structure symbol or member in
the same PLC.
Page 3 of 3 Structure Symbols
15.2.2013 mk:@MSITStore:C:\Program%20Files\OMRON\CX-One\CX-Programmer\cx-p.chm::/...