LWORD_TO_OCTET6
Converts the binary data of type LWORD to type T_OCTET6. The two most significant bytes are ignored and not converted. The remaining LWORD bytes are converted and swapped during 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_OCTET6 : T_OCTET6
VAR_INPUT
in: LWORD(0..16#FFFFFFFFFFFF);
END_VAR
Inputs
Name | Type | Description |
---|---|---|
in | LWORD(0..16#FFFFFFFFFFFF) | The LWORD value to be converted. |
Return value
Name | Type | Description |
---|---|---|
LWORD_TO_OCTET6 | Octet string with the maximum length of 6 octets. |
Example
METHOD FINAL Sample_LWORD_TO_OCTET6 : BOOL
VAR
o: T_OCTET6;
END_VAR
o:=LWORD_TO_OCTET6(16#010CCD010001);
(* o:=[16#01,16#0C,16#CD,16#01,16#00,16#01] *)
Sample_LWORD_TO_OCTET6:=TRUE;