GetTimeSinceLastBrokerMessage

GetTimeSinceLastBrokerMessage 1:

This method specifies the time (in ms) since the last message from the message broker. The time is reset to 0 with every new message from the message broker. It does not matter whether these are ping messages or regular publish/subscribe messages.

The MQTT specification defines that an MQTT client itself determines the time after which it will accept a timeout in the direction of the message broker. This is possible with this method from the PLC. The keep alive time, on the other hand, specifies the time (multiplied by 1.5) after which the message broker assumes a client time-out if there are no messages from the client.

Syntax

METHOD GetTimeSinceLastBrokerMessage : UDINT

GetTimeSinceLastBrokerMessage 2: Return value

Name

Type

Description

GetTimeSinceLastBrokerMessage

UDINT

The time in milliseconds since the last message from the message broker.