In compiler version 3.5.16.0 and higher, the XSIZEOF
operator should be used instead of this operator.
The operator is an extension of the IEC 61131-3 standard.
Syntax:
<return value> := SIZEOF( <variable name> | <date type name> );
The operator determines the number of bytes which are needed in the passed variable or data type. An unsigned value is always returned. The type of the return value is adapted to that of the passed operand (variable or data type).
Return value: |
Data type of the return value which is used implicitly |
---|---|
|
|
|
|
|
|
|
|
Example in ST
PROGRAM PLC_PRG VAR aData_1 : ARRAY[0..4] OF INT; iReturnValue : INT; END_VAR
iReturnValue := SIZEOF(aData_1); (* iReturnValue := USINT#10; *)
The result in iReturnValue
is 10
.
-
See also: ⮫ XSIZEOF