Variable Alignment [bytes]
Amount of memory that is allocated
[bytes]
G 2 8
H 2 8
Data Type Definitions
Name
Structure
STR_C
a
b
Data type
STRUCT
ARRAY[0..7] OF BOOL
BYTE
Variable E,
4 bytes
Variable F,
4 bytes
Variable G,
8 bytes
Variable H,
8 bytes
E.a[0] to E.a[7]
E.b
F.c
F.d[0] to F.d[7]
G[0].a[0] to G[0].a[7]
G[0].b
G[1].a[0] to G[1].a[7]
G[1].b
H[0].c
H[0].d[0] to H[0].d[7]
H[1].c
H[1].d[0] to H[1].d[7]
Bytes
Memory
First byte
First byte + 1
First byte + 2
First byte + 3
First byte + 4
First byte + 5
First byte + 6
First byte + 7
First byte + 8
First byte + 9
First byte + 10
First byte + 11
First byte + 12
First byte + 13
First byte + 14
First byte + 15
First byte + 16
First byte + 17
First byte + 18
First byte + 19
First byte + 20
First byte + 21
First byte + 22
First byte + 23
Variable Table
Name
Variable E
Variable F
Variable G
Variable H
Data type
Structure STR_C
Structure STR_D
ARRAY[0..1] OF STR_C
ARRAY[0..1] OF STR_D
Name
Structure STR_D
c
d
Data type
STRUCT
BYTE
ARRAY[0..7] OF BOOL
First byte +
(integer multiple of 2)
First byte +
(integer multiple of 2)
First byte +
(integer multiple of 2)
First byte +
(integer multiple of 2)
Not used.
Not used.
Not used.
Not used.
Not used.
Not used.
Not used.
Not used.
Not used.
Not used.
Not used.
Not used.
Not used.
Unions
For a union variable, the members overlap in the same memory locations.
The alignment of a union is largest alignment of all of the members. The amount of memory that is
allocated is the largest amount of memory that is allocated for any of the members.
Example: The alignments and the amounts of memory that are allocated for the four variable declara-
tions given in the following figure are given in the following table.
Variable Alignment [bytes]
Amount of memory that is allocated
[bytes]
A 4 4
B 4 4
C 4 8
D 4 8
Appendices
A-54
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)