ns=2;s=DEPRAG Smart/Network/MQTT/ActiveClients/0/SubscribeFullyParameterized
Subscribes an MQTT topic from the MQTT broker. The method allows to set all properties of a MQTT subscription.
In addition to the parameters already explained, the following variables must be created / transferred for the implementation in TwinCAT 3:
VAR
bMqttSubscribeFullyParameterized : BOOL;
OutputDataMqttSubscribeFullyParameterized : ST_VoidOutputData;
hrMqttSubscribeFullyParameterized : HRESULT;
fbMqtt : FB_Mqtt;
END_VAR
hrMqttSubscribeFullyParameterized := fbMqtt.SubscribeFullyParameterized(
bExecute := bMqttSubscribeFullyParameterized,
ConnectionHandle := depragSmartConnection.ConnectionHandle,
sTopic := 'testSmart/test',
QualityOfServiceLevel := MqttQualityOfServiceLevel.ExactlyOnce,
bNoLocal := FALSE,
bRetainAsPublished := FALSE,
RetainHandling := MqttRetainHandling.DoNotSendOnSubscribe,
sClientId := '0',
OutputData => OutputDataMqttSubscribeWithQualityOfServiceLevel);
IF hrMqttSubscribeFullyParameterized <> S_FALSE THEN
bMqttSubscribeFullyParameterized := 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".