LWORD_TO_OCTET8
Converts the binary data of type LWORD to type T_OCTET8. The LWORD bytes are converted and swapped during the conversion according to the following scheme: the least significant byte becomes the last and the most significant converted byte becomes the first octet of the octet string.
Namespace: Tc3_Collections
Library: Tc3_Collections (Tc3_Collections.compiled-library)
FUNCTION LWORD_TO_OCTET8 : T_OCTET8
VAR_INPUT
in: LWORD;
END_VAR
Inputs
Name | Type | Description |
---|---|---|
in | LWORD | The LWORD value to be converted. |
Return value
Name | Type | Description |
---|---|---|
LWORD_TO_OCTET8 | Octet string with the maximum length of 8 octets. |
Example
METHOD FINAL Sample_LWORD_TO_OCTET8 : BOOL
VAR
o: T_OCTET8;
END_VAR
o:=LWORD_TO_OCTET8(16#0102030405060708);
(* o:=[16#01,16#02,16#03,16#04,16#05,16#06,16#07,16#08] *)
Sample_LWORD_TO_OCTET8:=TRUE;