5-59
5 Understanding Programming
CJ2 CPU Unit Software User’s Manual
5-5 Symbols
5
5-5-7 Symbol Data Types
For example, the same member (e.g., the speed) can be specified for each machine.
Combining Data Structures with Arrays
Placing Structure Variables in an Array
When there is a large volume of data in the same form, as with recipe data for different products,
structure variables can be placed in an array. This is used to create a database. In this case, the
structure variable becomes one record and each member becomes a field in the database.
For example, this can be used to specify the processing results for each production lot.
C
C
C
Structure Variables Called Machine1, Machine2, and Machine3
Machine1
Machine2
Machine3
Speed of machine 1
Speed of machine 2
Speed of machine 3
Member variable
Member variable
Member variable
Speed
Direction
Alarm
Speed
Direction
Alarm
Speed
Direction
Alarm
C
B
C
A
B
C
A
C
B
C
A
B
C
Array S(x) of Structure Variables
Member
Member
Member
A of S(2)
A of S(1)
A of S(0)
S(0)
S(1)
S(2)
B
C
B
C
002
108
001
105
C
B
C
000
100
0
°
C
Example of Structure Variables in an Array: Product Processing Results (x)
Product processing results (2)
Product processing results (1)
Product processing results (0)
Member
Member
Member
Lot
Lot
Lot
Temperature
Alarm
°
C
°
C
Product processing results (2) = Temperature
for lot 002
Product processing results (1) = Temperature
for lot 001
Product processing results (0) = Temperature
for lot 000