E_BACNETSTRINGENCODINGTYPES
The enumeration contains a list of the string encodings supported by the BACnet driver. Under TwinCAT BACnet/IP the default character set is ANSI/UTF-8. Mixing of character sets may occur, particularly with external systems (clients). Therefore, the following character sets are decoded in the PLC with the block FB_BACnet_StringExtDecode: ANSI/UTF-8, UCS-2, UCS-4 and ISO8859-1.
The decoding should be generally applied to each read string. If the PLC detects an unsupported character set, the decoding block returns an error code. The decoded string is stored in the PLC in Windows-1252 encoding (also CP 1252) (1-byte character according to ISO 8859-1 and supplements).
TYPE E_BACNETSTRINGENCODINGTYPES :
(
BACnetStringEncodingTypes_AnsiUtf8 := 0,
BACnetStringEncodingTypes_DBCS := 1,
BACnetStringEncodingTypes_JIS := 2,
BACnetStringEncodingTypes_UCS4 := 3,
BACnetStringEncodingTypes_UCS2 := 4,
BACnetStringEncodingTypes_ISO8859 := 5,
)
END_TYPE
BACnetStringEncodingTypes_AnsiUtf8
: ANSI X3.4 and UTF-8 encoding according to ISO 10646 (using the PLC block FB_BACnet_StringExtDecode decodable to Windows-1252)
BACnetStringEncodingTypes_DBCS
: IBM™/Microsoft™ DBCS: double-byte code with specific (possibly proprietary) codepage
BACnetStringEncodingTypes_JIS
: JIS C 6226 (Japanese characters)
BACnetStringEncodingTypes_UCS4
: UCS-4 according to ISO 10646: 4-byte Unicode (using the PLC block FB_BACnet_StringExtDecode, decodable to Windows-1252)
BACnetStringEncodingTypes_UCS2
: UCS-2 according to ISO 10646: 2-byte Unicode (using the PLC block FB_BACnet_StringExtDecode, decodable to Windows-1252)
BACnetStringEncodingTypes_ISO8859
: Latin-1 according to ISO 8859-1 (0x00 to 0x7F corresponding to US-ASCII; 0xA0 to 0xFF ISO 8859-1-specific). The printable characters are compatible with Windows-1252.