SIZEOF
Type | Function |
Description | Determines the number of bytes reserved for the input variable in the controller memory and outputs it as UDINT value. The function is especially useful for determining the size of user-defined ARRAYs, STRUCTs or STRINGs.If, for example, an array consists of DINT elements, each element would occupy 4 bytes. The total number of bytes reserved for the input variable would be calculated as follows: Number of array elements x Number of bytes occupied by an elementIn case of DINT elements, the number of array elements would be multiplied by 4 (see also the example below). |
Notes | The size of the same ARRAY, STRUCT or STRING applied to the input differs depending on the used controller type. |
Parameters | Input
![]() ![]() |
Example | ![]() |
Specialities for STRUCTs | In the controller memory, a STRUCT is stored as follows:
![]() |