ns=2;s=DEPRAG Smart/Network/MQTT/ActiveClients/0/StartDefaultWithoutWillMessage
Parameterizes the MQTT client and establishes a connection to the specified MQTT broker.
In addition to the parameters already explained, the following variables must be created / transferred for the implementation in TwinCAT 3:
VAR
bMqttStartDefaultWithoutWillMessage : BOOL;
OutputDataMqttStartDefaultWithoutWillMessage : ST_VoidOutputData;
hrMqttStartDefaultWithoutWillMessage : HRESULT;
fbMqtt : FB_Mqtt;
END_VAR
hrMqttStartDefaultWithoutWillMessage := fbMqtt.StartDefaultWithoutWillMessage(
bExecute := bMqttStartDefaultWithoutWillMessage,
ConnectionHandle := depragSmartConnection.ConnectionHandle,
sClientName := 'SmartTest',
bIgnoreCertificateChainErrors := TRUE,
bIgnoreCertificateRevocationErrors := TRUE,
sClientId := '0',
OutputData => OutputDataMqttStartDefaultWithoutWillMessage);
IF hrMqttStartDefaultWithoutWillMessage <> S_FALSE THEN
bMqttStartDefaultWithoutWillMessage := 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".