ns=2;s=DEPRAG Smart/Network/MQTT/ActiveClients/0/StartDefault
Lightweight function to connect 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
bMqttStartDefault : BOOL;
OutputDataMqttStartDefault : ST_VoidOutputData;
hrMqttStartDefault : HRESULT;
fbMqtt : FB_Mqtt;
END_VAR
hrMqttStartDefault := fbMqtt.StartDefault(
bExecute := bMqttStartDefault,
ConnectionHandle := depragSmartConnection.ConnectionHandle,
sClientName := 'SmartTest',
sWillMessage := 'WillMessage',
sWillTopic := 'WillTopic',
bIgnoreCertificateChainErrors := TRUE,
bIgnoreCertificateRevocationErrors := TRUE,
sClientId := '0',
OutputData => OutputDataMqttStartDefault);
IF hrMqttStartDefault <> S_FALSE THEN
bMqttStartDefault := 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".