The operator is an extension of the IEC 61131-3 standard.
The operator is used for defining the number of bytes that are required by the variable
x. The data type of the return value is ULINT on 64-bit platforms and UDINT on all other platforms.
The operator XSIZEOF should be used instead of the operator SIZEOF. Because the data type of the return value is fixed, problems do not occur for XSIZEOF, which do occur in the case of the operator SIZEOF.
Example
Variable udiVarX is
ST:
udiVarX : UDINT; (* Data type for 64-bit platforms: ULINT *)
udiVarX := XSIZEOF(<variable>);
The variable udiVarX contains the number of bytes that the variable <variable> requires.
See also