ns=2;s=DEPRAG Smart/Network/MQTT/ActiveClients/0/Unsubscribe
Unsubscribes a MQTT Topic from the MQTT Broker.
In addition to the parameters already explained, the following variables must be created / transferred for the implementation in TwinCAT 3:
VAR
bMqttUnsubscribe : BOOL;
OutputDataMqttUnsubscribe : ST_VoidOutputData;
hrMqttUnsubscribe : HRESULT;
fbMqtt : FB_Mqtt;
END_VAR
hrMqttUnsubscribe := fbMqtt.Unsubscribe(
bExecute := bMqttUnsubscribe,
ConnectionHandle := depragSmartConnection.ConnectionHandle,
sTopic := 'testSmart/test',
sClientId := '0',
OutputData => OutputDataMqttUnsubscribe);
IF hrMqttUnsubscribe <> S_FALSE THEN
bMqttUnsubscribe := FALSE;
END_IF
For examples and explanations regarding the calls of nodes via Siemens TIA Portal please refer to the sub-menu "Siemens TIA Portal" in section "Getting Started".