![background image](http://html.mh-extra.com/html/omron/sysmac-ny512-1300/sysmac-ny512-1300_user-manual_742451439.webp)
A-53
Appendices
NY-series Industrial Panel PC / Industrial Box PC Built-in EtherNet/IP Port User’s Manual (W563)
A-5
V
ariable Memo
ry
Allocat
ion
Meth
od
s
A
A-5-
1 V
ar
iable Memor
y Allocation Rules
Therefore, the following formula gives the amount of memory that is allocated for a BOOL array.
For 1 to 16 elements, 2 bytes are allocated. For 17 to 32 elements, 4 bytes are allocated.
Specific examples of the rules for memory allocation for variables of each data type are given below.
Variables with One-Byte Alignments (e.g., BYTE)
One byte of memory is allocated for the one-byte alignment.
Example: Two consecutive BYTE variables
Variables with Two-byte Alignments (e.g., BOOL and WORD)
Two bytes of memory are allocated for the two-byte alignment.
Example: Two consecutive BOOL variables
Variables with Four-byte Alignments (e.g., DWORD)
Four bytes of memory are allocated for the four-byte alignment.
The location of the first byte of data in memory is an integer multiple of four bytes. Therefore, if a
variable with a two-byte alignment, such as WORD data, is inserted, two bytes of unused memory
will remain.
Example: Consecutive variables in the following order: DWORD, WORD, and DWORD
Basic Data Types
Amount of memory = 2
Truncate the decimal portion of the result
of the calculation in brackets.
Number of
elements − 1
16
+2
Variable A, 1 byte
Variable B, 1 byte
Variable Table
Name
A
B
Data type
BYTE
BYTE
Bytes
Memory
First byte
First byte + 1
Variable Table
Name
A
B
Data type
BOOL
BOOL
Bytes
Memory
First byte
First byte + 1
First byte + 2
First byte + 3
Variable A, 2 bytes
Variable B, 2 bytes
First byte +
(integer multiple of 2)
First byte +
(integer multiple of 2)
Variable Table
Name
A
B
C
Data type
DWORD
WORD
DWORD
Variable A,
4 bytes
Variable B,
2 bytes
Variable C,
4 bytes
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
Not used.
First byte +
(integer multiple of 2)
First byte +
(integer multiple of 4)
First byte +
(integer multiple of 4)
Содержание Sysmac NY512-1300
Страница 290: ...9 Socket Service 9 32 NY series Industrial Panel PC Industrial Box PC Built in EtherNet IP Port User s Manual W563 ...
Страница 310: ...10 FTP Server 10 20 NY series Industrial Panel PC Industrial Box PC Built in EtherNet IP Port User s Manual W563 ...
Страница 324: ...11 FTP Client 11 14 NY series Industrial Panel PC Industrial Box PC Built in EtherNet IP Port User s Manual W563 ...
Страница 452: ...Appendices A 66 NY series Industrial Panel PC Industrial Box PC Built in EtherNet IP Port User s Manual W563 ...
Страница 453: ...Index 1 NY series Industrial Panel PC Industrial Box PC Built in EtherNet IP Port User s Manual W563 I Index ...
Страница 459: ......