Rockwell Automation Publication 1789-UM002K-EN-P - January 2015
143
Develop External Routines
Chapter 7
Packing in Structures
Take care when designing user-defined structures that are shared between the
SoftLogix controller and external routines. The packing mechanisms vary
between the Visual Studio compiler and the Logix Designer compiler. This table
and guidelines help illustrate this situation.
•
Aggregates like arrays and structures start on 4-byte boundaries.
•
Consecutive BOOLs are bit-packed, as are boolean arrays.
•
SINTs and BOOLs are one-byte aligned unless noted above.
•
INT is 2-byte aligned.
•
REAL and DINT are 4-byte aligned.
•
Gaps of one or more bytes may exist between items.
This table shows the Microsoft packing for Visual Studio software, version 6.0. If
you are not using this version of Visual Studio software, consult your
documentation for appropriate packing information.
Logix Designer Application Structure Storage
Member Data Type
Alignment
Packing
Storage
Consecutive BOOLs
4 byte boundaries
bit packed across storage
((N-1 bits / 32) + 1) * 4 bytes
Array <BOOL>
4 byte boundaries
bit packed across storage
((N-1 bits / 32) + 1) * 4 bytes
BOOL
1 byte boundaries
1 per byte of storage
1 byte
SINT
1 byte boundaries
1 per byte of storage
1 byte
INT
2 byte boundaries
1 per 2 bytes of storage
2 bytes
DINT
4 byte boundaries
1 per 4 bytes of storage
4 bytes
REAL
4 byte boundaries
1 per 4 bytes of storage
4 bytes
Array <nonBOOL>
4 byte boundaries
1 per N bytes of storage
(eleSize * eleCount) bytes
<StructureT> (such as, UDT)
4 byte boundaries
1 per N bytes of storage
Ceiling (sizeof(StructureT) / 4) * 4 bytes
Microsoft Win32 Structure Storage (default n=8)
Member Data Type
Alignment
Packing
Storage
BOOL
Min(1,n) byte boundaries
1 per byte of storage
1 byte
Char
Min(1,n) byte boundaries
1 per byte of storage
1 byte
Short
Min(2,n) byte boundaries
1 per 2 bytes of storage
2 bytes
Int
Min(4,n) byte boundaries
1 per 4 bytes of storage
4 bytes
Long
Min(4,n) byte boundaries
1 per 4 bytes of storage
4 bytes
Float
Min(4,n) byte boundaries
1 per 4 bytes of storage
4 bytes
Array <AnyT>
Min(eleAlignment,n) byte boundaries
1 per N bytes of storage
(eleSize * eleCount) bytes
<StructureT> (such as, struct)
Min(largestOfMember,n) byte boundaries
1 per N bytes of storage
Sizeof(StructureT) bytes
Содержание SoftLogix 5800
Страница 1: ...SoftLogix 5800 System Catalog Numbers 1789 L10 1789 L30 1789 L60 User Manual...
Страница 4: ...4 Rockwell Automation Publication 1789 UM002K EN P January 2015 Summary of Changes Notes...
Страница 104: ...104 Rockwell Automation Publication 1789 UM002K EN P January 2015 Chapter 5 Configure and Use Simulated I O Notes...
Страница 110: ...110 Rockwell Automation Publication 1789 UM002K EN P January 2015 Chapter 6 Execute External Routines 9 Click OK...
Страница 148: ...148 Rockwell Automation Publication 1789 UM002K EN P January 2015 Chapter 7 Develop External Routines Notes...
Страница 256: ...256 Rockwell Automation Publication 1789 UM002K EN P January 2015 Appendix E System Performance Tuning Guidelines Notes...
Страница 262: ...262 Rockwell Automation Publication 1789 UM002K EN P January 2015 Appendix G SoftLogix 5800 Revision History Notes...
Страница 270: ...270 Rockwell Automation Publication 1789 UM002K EN P January 2015 Index...
Страница 271: ......