Omron Sysmac NJ-series User Manual page 561

Machine automation controller cpu unit built-in ethernet/iptm port
Hide thumbs Also See for Sysmac NJ-series:
Table of Contents

Advertisement

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
A
B
C
D
First byte +
(integer multiple of 4)
A.a A.b
First byte +
(integer multiple of 4)
B.c B.d
First byte +
(integer multiple of 4)
C[0].a C[0].b
C[1].a C[1].b
First byte +
(integer multiple of 4)
D[0].c D[0].d
D[1].c D[1].d
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User's Manual (W506)
Alignment [bytes]
Amount of memory that is allocated [bytes]
4
4
4
4
4
8
4
8
Memory
Bytes
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
Data Type Definitions
Name
Data type
Union UNI_A
UNION
a
DWORD
Variable A,
b
WORD
4 bytes
Name
Data type
Union UNI_B
UNION
c
WORD
Variable B,
d
DWORD
4 bytes
Variable Table
Name
Data type
Variable A
Union UNI_A
Variable C,
Variable B
Union UNI_B
8 bytes
Variable C
ARRAY[0..1] OF UNI_A
Variable D
ARRAY[0..1] OF UNI_B
Variable D,
8 bytes
Appendices
A
A-59

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sysmac nx-seriesSysmac nx1p2-10 seriesSysmac nx1p2-90 seriesSysmac nj501-5 seriesSysmac nj501-4 seriesSysmac nj501-3 series ... Show all

Table of Contents