ns=2;s=DEPRAG Smart/Network/MQTT/ActiveClients/0/IsConnected
Indicates whether the MQTT client is connected to the MQTT broker.
In addition to the parameters already explained, the following variables must be created / transferred for the implementation in TwinCAT 3:
VAR
bMqttIsConnected : BOOL;
OutputMqttIsConnected : BOOL;
hrMqttIsConnected : HRESULT;
fbMqtt : FB_Mqtt;
END_VAR
hrMqttIsConnected := fbMqtt.IsConnected(
bExecute := bMqttIsConnected,
ConnectionHandle := depragSmartConnection.ConnectionHandle,
ClientId := '0',
Output => OutputMqttIsConnected);
IF hrMqttIsConnected <> S_FALSE THEN
bMqttIsConnected := 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".