ns=2;s=DEPRAG Smart/Network/MQTT/ActiveClients/0/StartFullyParameterized
Parameterizes the MQTT client with all parameters 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
bMqttStartFullyParameterized : BOOL;
OutputDataMqttStartFullyParameterized : ST_VoidOutputData;
hrMqttStartFullyParameterized : HRESULT;
fbMqtt : FB_Mqtt;
END_VAR
hrMqttStartFullyParameterized := fbMqtt.StartFullyParameterized(
bExecute := bMqttStartFullyParameterized,
ConnectionHandle := depragSmartConnection.ConnectionHandle,
nAutoReconnectDelayInSeconds := 3,
nConnectionCheckIntervalInSeconds := 2,
nMaxPendingMessages := 100,
PendingMessagesOverflowStrategy := MqttPendingMessagesOverflowStrategy.DropOldestQueuedMessage,
nMaxTopicFiltersInSubscribeUnsubscribePackets := 100,
sClientName := 'SmartTest',
bCleanSession := FALSE,
ProtocolVersion := MqttProtocolVersionSmart.V311,
nKeepAlivePeriodInSeconds := 5,
sWillMessage := 'WillMessage',
sWillTopic := 'WillTopic',
WillQualityOfService := MqttQualityOfServiceLevel.ExactlyOnce,
nWillDelayIntervalInSeconds := 5,
SslProtocol := SslProtocols.Tls12,
bIgnoreCertificateChainErrors := TRUE,
bIgnoreCertificateRevocationErrors := TRUE,
sClientId := '0',
OutputData => OutputDataMqttStartFullyParameterized);
IF hrMqttStartFullyParameterized <> S_FALSE THEN
bMqttStartFullyParameterized := 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".