Encodes a WString into an UTF-8 encoded byte stream.
LGF_EncodeUtf8 (FC) | ||||||||
---|---|---|---|---|---|---|---|---|
WString | sourceString | Ret_Val | Word | |||||
DInt | startPos | bytesUsed | UInt | |||||
Array[*] of Byte | encodedByteStream | Array[*] of Byte | ||||||
Identifier | Data type | Description |
---|---|---|
sourceString | WString | Character that shall be converted to UTF-8 |
startPos | DInt | Position in encoded byte stream to start insert encoded WChars (Array lower bound is added) |
Identifier | Data type | Description |
---|---|---|
Ret_Val | Word | 16#0000 - 16#7FFF: Status of the FC, 16#8000 - 16#FFFF: Error identification |
bytesUsed | UInt | Number of Bytes converted. Ranges from 1 to 3. |
Identifier | Data type | Description |
---|---|---|
encodedByteStream | Array[*] of Byte | UTF-8 conformant byte sequence. B0 stores first Byte, B1 second and B2 third Byte. B3 is not used |
Code / Value | Identifier / Description |
---|---|
16#0000 | STATUS_NO_ERROR Status: No error |
16#8201 | ERR_START_POS_OUTSIDE Error: Parameter `startPos` is outside array bounds |
16#8202 | ERR_COUNT_EXCEEDS_BOUNDS Error: Lenght of array reached |
Version & Date | Change description | |
---|---|---|
01.00.00 | Siemens Online Support | |
2022-12-16 | First released version |