FB_JsonReadWriteDataType
![FB_JsonReadWriteDataType 1:](Images/jpg/13430919947__Web.jpg)
In order to use UTF-8 characters, e.g. in the automatic generation of metadata via the function block FB_JsonReadWriteDataType, the check box for the support of UTF-8 in the symbolism must be activated in the TwinCAT project. To do this, double-click on SYSTEM in the project tree, open the Settings tab and activate the corresponding check box.
![FB_JsonReadWriteDataType 2:](Images/png/4382966027__en-US__Web.png)
![]() | Strings in UTF-8 format The variables of type STRING used here are based on the UTF-8 format. This STRING formatting is common for MQTT communication as well as for JSON documents. In order to be able to receive special characters and texts from a wide range of languages, the character set in the Tc3_IotBase and Tc3_JsonXml libraries is not limited to the typical character set of the data type STRING. Instead, the Unicode character set in UTF-8 format is used in conjunction with the data type STRING. If the ASCII character set is used, there is no difference between the typical formatting of a STRING and the UTF-8 formatting of a STRING. Further information on the UTF-8 STRING format and available display and conversion options can be found in the documentation for the Tc2_Utilities PLC library. |
Outputs
Name | Type |
---|---|
initStatus | HRESULT |
Methods
Name | Description |
---|---|
FB_JsonReadWriteDataType | Metadata can be added via PLC attributes to the JSON representation of a PLC data structure on an FB_JsonSaxWriter object. |
Creates the JSON representation of a PLC data structure on an FB_JsonSaxWriter object. | |
Creates the JSON representation of a PLC data structure on an FB_JsonSaxWriter object. | |
Creates the JSON representation of a symbol and copies it to a variable of data type STRING. | |
Creates a corresponding JSON representation of PLC attributes on a symbol. | |
Returns the complete (ADS) symbol name of a transferred symbol. | |
Returns the data type name of a transferred symbol. | |
Creates the corresponding JSON representation of a symbol. | |
Creates the corresponding JSON representation of a symbol. | |
Creates a corresponding JSON representation of PLC attributes on a symbol. | |
Reads the size of the JSON representation of a symbol. | |
Reads the size of the JSON representation of PLC attributes on a symbol. | |
Returns the complete (ADS) symbol name of a transferred symbol. | |
Extracts a string containing a valid JSON message. |
Requirements
TwinCAT version | Hardware | Libraries to be integrated |
---|---|---|
TwinCAT 3.1, Build 4022 | x86, x64, ARM | Tc3_JsonXml |
- AddJsonKeyPropertiesFromSymbol
- AddJsonKeyValueFromSymbol
- AddJsonValueFromSymbol
- CopyJsonStringFromSymbol
- CopyJsonStringFromSymbolProperties
- CopySymbolNameByAddress
- GetDataTypeNameByAddress
- GetJsonFromSymbol
- GetJsonStringFromSymbol
- GetJsonStringFromSymbolProperties
- GetSizeJsonStringFromSymbol
- GetSizeJsonStringFromSymbolProperties
- GetSymbolNameByAddress
- SetSymbolFromJson