ST_IotMqtt5Will

By means of the following specifications, a message can be specified which, in case of an irregular disconnection between client and broker, is sent as the last message from the broker to the subscribers who have subscribed to the corresponding topic. This structure is an extension of the previous structure ST_IotMqttWill for MQTT V5.

ST_IotMqtt5Will 1:

No instantiation and assignment of this structure

This structure does not allow instantiation and assignment to FB_IotMqtt5Client or FB_IotMqtt5ClientBase. Instead, the input parameter of the MQTT v5 client function block is used directly.

Syntax

Definition:

TYPE ST_IotMqtt5Will :
STRUCT
    {attribute 'TcEncoding':='UTF-8'}
    sTopic             : STRING(255);
    fbPayload          : FB_IotDataBuffer;
    eQoS               : TcIotMqttQos := TcIotMqttQos.ExactlyOnceDelivery;
    bRetain            : BOOL;
    {attribute 'TcEncoding':='UTF-8'}
    sContentType       : STRING(255);
    {attribute 'TcEncoding':='UTF-8'}
    sResponseTopic     : STRING(255);
    nMsgExpiryInterval : UDINT;
    nDelay             : UDINT;
    bPayloadUtf8       : BOOL;
    fbCorrelationData  : FB_IotDataBuffer;
    fbUserProperties   : FB_IotMqtt5UserProperties;
END_STRUCT
END_TYPE

Parameters

Name

Type

Description

sTopic

STRING(255)

Message topic.

fbPayload

FB_IotDataBuffer

Data buffer for the payload of the message.

eQoS

TcIotMqttQos

The "Quality of Service" offers the following setting options: QoS level 0, QoS level 1, QoS level 2 (See Neuer Knoten).

bRetain

BOOL

If bRetain is TRUE, the broker stores the message in order to make it available to subsequent subscribers.

sContentType

STRING(255)

Describes the encoding of the payload. MIME types such as "text/plain" are particularly suitable for high compatibility.

sResponseTopic

STRING(255)

At this point, the response topic can be specified on which a response from another client is expected.

nMsgExpiryInterval

UDINT

Time in seconds after which a Last Will message expires and is no longer delivered by the broker if the connection is lost.

nDelay

UDINT

Delay interval in seconds until the LastWill message is sent.

bPayloadUtf8

BOOL

Format indicator for the message content.

fbCorrelationData

FB_IotDataBuffer

Data buffer for CorrelationData

fbUserProperties

FB_IotMqtt5UserProperties

UserProperties can be specified at this point.