MQTT_GetState block

Short summary

Name

MQTT_GetState

→POU type

→function

Category

more system blocks, MQTT

Graphical interface

images/download/thumbnails/414780461/MQTT_GetState-version-1-modificationdate-1534501345204-api-v2.png

Available since

  • version 1.32.0 (for logi.CAD 3) and version 2.3.1403 of the →runtime system (as replacement for the obsolete MQTT_IsConnected block) – initial variant

  • version 1.108.0 (for logi.CAD 3) and version 3.18.0 of the →runtime system – enhancement: data type MQTT_RC for output rc (instead of DINT); data type MQTT_SUBSCRIBER_STATE for return value (instead of SINT)

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/warning.svg This block is supported for →Raspberry Pi.

Functionality

The block determines the connection state to a given →MQTT broker. The connection is specified by the connection handler.

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/information.svg The data is transferred by means of an already existing MQTT broker

(see "Preparing/Realizing data transfer via MQTT")
.

Inputs, outputs, return value


Identifier

→Data type

Description

Inputs:

ch

DINT

connection handler of interest (as obtained by the MQTT_Connect block)

Outputs:

rc

MQTT_RC

return code of involved MQTT functions as specified in data type MQTT_RC

Return value:

MQTT_SUBSCRIBER_STATE

returns the current state of the given connection handler as specified in data type MQTT_SUBSCRIBER_STATE

Input EN and output ENO are available when →calling the block. See "Execution control: EN, ENO" for information on input EN and output ENO.

See:

Example for usage within ST-editor

See "MQTT_Publish block" and "MQTT_Receive block".

When creating your application within the ST-editor, enter a call of a block by typing the text as requested by the syntax or use Content Assist.