PendingApplicationMessagesCount

Read TwinCAT TIA
Network MQTT Client ActiveClients One client

ns=2;s=DEPRAG Smart/Network/MQTT/ActiveClients/0/PendingApplicationMessagesCount

Number of messages not yet transmitted in the local buffer memory. The messages still have to be transferred to the MQTT broker.

Examples:

In addition to the parameters already explained, the following variables must be created / transferred for the implementation in TwinCAT 3:

Beckhoff parameter:

    bMqttReadPendingApplicationMessageCount
    A boolean variable that can be used to trigger the execution of the ReadPendingApplicationMessageCount command.
    OutputMqttReadPendingApplicationMessageCount
    A variable of type "DINT" to which the return value of the ReadPendingApplicationMessageCount method is written.
    hrMqttReadPendingApplicationMessageCount
    This can be used to monitor the execution of the command. Error codes have the type HRESULT.
    fbMqtt
    An instance of the "FB_Mqtt" function block supplied with the DEPRAG Smart library.
    ClientId
    A String(255) variable that specifies the client that should execute the command.
    ConnectionHandle
    "ConnectionHandle" received when establishing a connection between DEPRAG Smart Server and your OPC UA client.


VAR
   bMqttReadPendingApplicationMessageCount    : BOOL;
   OutputMqttReadPendingApplicationMessageCount  : DINT;
   hrMqttReadPendingApplicationMessageCount   : HRESULT;

   fbMqtt  : FB_Mqtt;
END_VAR

hrMqttReadPendingApplicationMessageCount := fbMqtt.ReadPendingApplicationMessageCount(
       bExecute    := bMqttReadPendingApplicationMessageCount,
       ConnectionHandle  := depragSmartConnection.ConnectionHandle,
       ClientId   := '0',
       Output    => OutputMqttReadPendingApplicationMessageCount);
IF hrMqttReadPendingApplicationMessageCount <> S_FALSE THEN 
    bMqttReadPendingApplicationMessageCount := 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".