FB_IotMqtt5UserProperties

The function block enables the definition and handling of UserProperties. UserProperties are key/value pairs that describe optional metadata and can be used, for example, with PublishProperties.
![]() | Number of UserProperties The processing of UserProperties in the PLC real-time task cycle requires a certain amount of time, which is why it is better to keep it low. |
Syntax
Definition:
FUNCTION_BLOCK FB_IotMqtt5UserProperties
VAR_OUTPUT
bError : BOOL;
hrErrorCode : HRESULT;
END_VAR
Outputs
Name | Type | Description |
---|---|---|
bError | BOOL | Becomes TRUE as soon as an error situation occurs. |
hrErrorCode | HRESULT | Returns an error code if the bError output is set. An explanation of the possible error codes can be found in the Appendix. |
Properties
Name | Type | Access | Description |
---|---|---|---|
nUserPropertyCnt | UINT | Get | Specifies the number of UserProperties included. |
Methods
Name | Description |
---|---|
AddUserProperty | Adds a UserProperty to the list. The property is specified by its name and value. |
ClearUserProperties | Deletes all UserProperties contained in the list. |
GetUserPropertyByIdx | Returns the name and value of a UserProperty specified by its position (index) in the list. |
GetUserPropertyValueByName | Returns the value of a UserProperty specified by its name. |
SetUserProperties | Deletes all UserProperties contained in the list and adds a set of UserProperties specified by an array of objects of type MqttUserProperty. |
Requirements
Development environment | Target platform | PLC libraries to include |
---|---|---|
TwinCAT v3.1.4026.0 | IPC or CX (x86, x64, ARM) | Tc3_IotBase (>= v3.4.2.0) |