Omron NJ-series User Manual page 220

Machine automation controller cpu unit software
Hide thumbs Also See for NJ-series:
Table of Contents

Advertisement

Precautions for Correct Use
Precautions for Correct Use
The total amount of memory required by all variables is not equal to the total of the data sizes of
each of those variables. This is because the first position where data is stored in memory is auto-
matically set to a multiple of the alignment value for that data type. This results in some empty
space in memory between data types. For example, even if the data types are the same, the
overall memory space required depends on the order of data types, as shown below.
Example:
DWORD -> DWORD -> WORD: Requires a total of
10 bytes.
Byte
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
You must be aware of the alignment values for different data types when you exchange data
such as structure variables between devices so that you can properly align the position of the
data in memory. Refer to A-7 Variable Memory Allocation Methods for details.
 Derivative Data Types
A derivative data type is a data type with user-defined specifications. Derivative data types are reg-
istered in the Data Type View in the Sysmac Studio. The following is a list of the derivative data
types.
Type
Structures
Unions
Enumerations
Refer to 6-3-6 Derivative Data Types for details.
 Specifications for Data Types
The following array specifications and range specifications are possible for all data types.
Type
Array specification
Range specification
Refer to 6-3-7 Array Specifications and Range Specifications for Data Types for details.
NJ-series CPU Unit Software User's Manual (W501)
DWORD data
The beginning of the
data type is a
multiple of four.
DWORD data
The beginning of the
data type is a
WORD data
multiple of two.
This data type consists of multiple data types placed together into a single lay-
ered structure.
This data type allows you to handle the same data as different data types
depending on the situation.
This data type uses one item from a prepared name list as its value.
An array is a group of elements with the same data type. You specify the number
(subscript) of the element from the first element to specify the element. You can
specify arrays for both basic data types and derivative data types.
You can specify a specific range for a data type in advance.
You can specify a range for any integer basic data type.
DWORD -> WORD -> DWORD: Requires a total of
12 bytes.
Byte
First byte
First byte+1
DWORD data
First byte+2
First byte+3
First byte+4
WORD data
First byte+5
First byte+6
Not used.
First byte+7
First byte+8
First byte+9
DWORD data
First byte+10
First byte+11
Description
Description
6 Programming
The beginning of the
data type is a multiple
of two.
The beginning of the
data type is a multiple of
four, i.e., first byte + 8.
6
6-33

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents