Using the Properties dialog, you can assign a DUT one of two ways of occupying memory:
with overlapping elements
with non-overlapping elements
All elements of the data type BOOL are lumped together in a block and allocated one after the other in a memory area reserved for bits:
When any ARRAY OF BOOL is used, the simple Bool allocation begins at a 16-bit word address.
When no ARRAY OF BOOL is used the memory allocation depends on the number of boolean members:
Number of Boolean elements |
Start of memory allocation |
Memory allocation |
---|---|---|
1 |
at any bit address: R0, R1, R2, … |
|
2 |
at any even bit address, e.g. R0, R2, R4, … |
|
4 |
at digit boundary, e.g. R0, R4, R8, … |
|
8 |
at byte boundary, e.g. R0, R8, R10, … |
|
9 or more |
at word address, e.g. R0, R10, R20, … |
|
3 |
at any bit address: R0–R2 : used R3, R7: unused and filled-up |
DUTs with filled-up members (O: filled-up bit that cannot be used) |
5–7 |
at any bit address: R0–R4 : used R5–R7: unused and filled-up |
If no user address is assigned and 3 or 5–7 Boolean elements are used in a DUT, the occupied memory is filled-up to the next byte or digit boundary.
This filled-up bool cannot be used.
All elements of the data type ARRAY OF BOOL are lumped together in a block and allocated in a memory area reserved for bits, beginning at a 16-bit word address.
When one or more ARRAY OF BOOL are used: the memory allocation of the simple Bool and each ARRAY OF BOOL are allocated at Word address
Word area:
Bool area:
The free bits are not occupied by the DUT and will be used for other (simple) Boolean elements, which fit into these empty spaces.
When array of bool should be used, it is suggested to use a multiple of 16 simple bool and using arrays of bool with a multiple of 16 bool as well.
All other elements are lumped together in a block and allocated one after the other in a memory area reserved for 16-bit words.
Due to the optimization in memory layout, the Boolean addresses of the DUT elements are not in the same order as defined in the DUT declaration list.
When accessing a DUT with DUT sub elements by user addresses, the memory layout should be checked using .csv export or monitoring window.
DUT (DUTwithoutBOOLs) without elements of the data type BOOL:
How DUTs with non-overlapping elements occupy memory:
16-bit word area |
|
---|---|
DT100 |
wWORD1 |
DT101 |
dwWORD1 |
DT102 |
|
DT103 |
iINT1 |
DT104 |
diDINT1 |
DT105 |
|
DT106 |
wWORD2 |
DT107 |
dwWORD2 |
DT108 |
|
DT109 |
iINT2 |
DT110 |
diDINT2 |
DT111 |
|
DT112 |
rREAL1 |
DT113 |
|
DT114 |
sSTRING1 |
DT115 |
|
DT116 |
|
DT117 |
|
DT118 |
sSTRING2 |
DT119 |
|
DT120 |
|
DT121 |
The variables String1 and String2 must have the same length and be at the end of the declaration.
DUT DUTwithBOOLs with elements of the data type BOOL (no address defined by the user):
How DUTs with non-overlapping elements occupy memory:
Bit area |
16-bit word area |
|||
---|---|---|---|---|
R100 |
bBool1 |
DT100 |
wWORD1 |
|
R101 |
bBool2 |
DT101 |
dwWORD1 |
|
R102 |
bBool3 |
DT102 |
||
R103 |
bBool4 |
DT103 |
iINT1 |
|
DT104 |
diDINT1 |
|||
R110 |
Bools[0] |
DT105 |
||
R111 |
Bools[1] |
DT106 |
wWORD2 |
|
R112 |
Bools[2] |
DT107 |
dwWORD2 |
|
R113 |
Bools[3] |
DT108 |
||
R114 |
Bools[4] |
DT109 |
iINT2 |
|
DT110 |
diDINT2 |
|||
DT111 |
||||
DT112 |
rREAL1 |
|||
DT113 |
||||
DT114 |
sSTRING1 |
|||
DT115 |
||||
DT116 |
||||
DT117 |
The variable STRING1 must be located at the end of the declaration.
DUT with arrays:
How DUTs with non-overlapping elements occupy memory:
16-bit word area |
|
---|---|
DT100 |
String1_Max |
DT101 |
String1_Act |
DT102 |
String1_Char12 |
DT103 |
String1_Char34 |
DT104 |
String2_Max |
DT105 |
String2_Act |
DT106 |
String2_Char12 |
DT107 |
String2_Char34 |
DT108 |
String_Parts[1,1] |
... |
... |
DT115 |
String_Parts[2,4] |
DT116 |
String1 |
DT117 |
|
DT118 |
|
DT119 |
|
DT120 |
String2 |
DT121 |
|
DT122 |
|
DT123 |
|
DT124 |
Strings[1] |
DT125 |
|
DT126 |
|
DT127 |
|
DT128 |
Strings[2] |
DT129 |
|
DT130 |
|
DT131 |
The variables String1, String2 and Strings must have the same length and be at the end of the declaration.