Error Codes
In the event of an error, the function block FB_IotMqttClient sets the output bError and indicates the error with hrErrorCode. All errors are listed in section "ADS Return Codes".
In addition, the output eConnectionState indicates the state of the connection between the client and the MQTT broker at all times. The enumeration offers the following possible states:
TYPE ETcIotMqttClientState :
(
MQTT_ERR_CONN_PENDING:=-1,
MQTT_ERR_SUCCESS:=0,
MQTT_ERR_NOMEM:=1,
MQTT_ERR_PROTOCOL:=2,
MQTT_ERR_INVAL:=3,
MQTT_ERR_NO_CONN:=4,
MQTT_ERR_CONN_REFUSED:=5,
MQTT_ERR_NOT_FOUND:=6,
MQTT_ERR_CONN_LOST:=7,
MQTT_ERR_TLS:=8,
MQTT_ERR_PAYLOAD_SIZE:=9,
MQTT_ERR_NOT_SUPPORTED:=10,
MQTT_ERR_AUTH:=11,
MQTT_ERR_ACL_DENIED:=12,
MQTT_ERR_UNKNOWN:=13,
MQTT_ERR_ERRNO:=14,
MQTT_ERR_EAI:=15,
MQTT_ERR_PROXY:=16
) DINT;
END_TYPE