6 Programming
6-40
NJ-series CPU Unit Software User’s Manual (W501)
Expressing Structure Variables and Structure Variable Members
Specifying Members
The individual pieces of data that make up a structure are called “members.” You can express indi-
vidual members of a structure by putting a period after the variable name that represents the entire
structure followed by the member name that you want to access. You can even have a structure that
is the member of another structure.
Example: abc.x: Member x of structure variable abc
abc.Order.z: Member z of member structure variable Order of structure variable abc
Specifying the Structure
The structure represents all members that make up the structure. A structure is expressed by the
name of the structure variable. In the example above, you would write abc.
Creating a Structure
1
Create a structure data type in the Data Type Table.
Specify the data type name, members, and the data type.
2
Specify the member name and the structure data type from above as the data type and register
the variable in the variable table.
Structure Specifications
The specifications of structure data types are given in the following table.
Item Specification
Structure names Names are not case sensitive. Prohibited characters and character length restrictions
are the same as for variable names.
Member data types Refer to the table on the data types of structure members that is given below for details.
Member attributes Member Name
Comment
Data Type Table
red
green
RGB
blue
ItemNoITEM
Color
Data type
MemberName
INT
INT
INT
INT
RGB
Variable Table
Variables
red
Data type RGB
green
Desk
blue
ItemNo
red
green
Chairs[0]
Color
blue
ItemNo
red
green
Chairs[1]
Color
blue
RGB
ARRAY[0..1]OF ITEM
Desk
Chairs
Data type
Variable name
Data type ITEM
Data type ITEM