The operator is an extension of the IEC 61131-3 standard.
The XSIZEOF operator determines the number of bytes which are needed in the passed variable or data type.
In doing so, an unsigned value is always returned. The data type of the return value <return value> is fixed as follows: type ULINT on 64-bit platforms and type UDINT on all other platforms. To generate code which runs on all platforms, the return value can be declared with the __UXINT data type.
Syntax:
<return value> := XSIZEOF( <variable> );
Example 112. Example in ST
PROGRAM PLC_PRG
VAR
uxiReturnValue : __UXINT; (* Datentyp bei 64-bit-Plattformen: ULINT *)
aData_1 : ARRAY[0..4] OF INT;
END_VARuxiReturnValue := XSIZEOF(aData_1);
uxiReturnValue = 10
uxiReturnValue = 10
|
Tip |
|---|---|
|
In the case of assignment to a variable of type |