MQTT_ERROR_ID (Enum)
Parameter |
Value |
Description |
---|---|---|
MQTT_ERR_NO_ERROR |
0 |
No error. |
MQTT_ERR_CONN_ SERVICE_UNAVAIL |
16#3001 |
The Network Connection has been made but the MQTT service is unavailable on the specified port. |
MQTT_ERR_COMMUNICATION_TIMEOUT |
16#3013 |
The timeout value for the communication has been exceeded. |
MQTT_ERR_REC_PACKET_TOO_LONG |
16#3017 |
Received topic is too long. |
MQTT_ERR_PING_NO_ANSWER |
16#301A |
The MQTT broker did not answer the ping. MQTT client has passed the KeepAlive or MQTT broker is unreachable. |
MQTT_ERR_CONN_CLIENT_ID_NOT_ALLOWED |
16#301F |
The Client identifier is correct UTF-8 but not allowed by the Server. |
MQTT_ERR_CONN_ REFUSED_PROTOCOL |
16#3020 |
The Server does not support the level of the MQTT protocol requested by the Client. |
MQTT_ERR_CONN_REFUSED_CONNECTION |
16#3025 |
Connection refused, maybe the IP address is malformed. |
MQTT_ERR_UNSPECIFIED_ERROR |
16#302B |
Internal library returned an unspecified error. |
MQTT_ERR_NETWORK_ERROR |
16#302D |
General network error. |
MQTT_ERR_CONN_AUTH_FAILED |
16#3217 |
Authentication failed: Bad username, password OR client id. |
MQTT_ERR_CONN_TLS_HANDSHAKE_FAILED |
16#3230 |
Error on TLS handshake. |
MQTT_ERR_CONN_SERVER_CERT_NOT_VALID |
16#3231 |
Server certificate not valid. Check if PLC date has been set correctly. |
MQTT_ERR_CONN_SERVER_CERT_NOT_PEM |
16#3232 |
Server certificate format is not formatted as PEM. |
MQTT_ERR_CONN_SERVER_CERT_EXPIRED |
16#3233 |
Server certificate has expired. |
MQTT_ERR_CONN_CLIENT_CERT_NOT_VALID |
16#3234 |
Client certificate not valid. Check if PLC date has been set correctly. |
MQTT_ERR_CONN_CLIENT_CERT_NOT_PEM |
16#3235 |
Client certificate or client key format is not formatted as PEM. |
MQTT_ERR_CONN_CLIENT_CERT_EXPIRED |
16#3236 |
Client certificate has expired. |
MQTT_ERR_INPUT_02_0 |
16#4020 |
Function block Input 02 error (error case 0), specific error depends on used function block:
|
MQTT_ERR_INPUT_03_0 |
16#4030 |
Function block Input 03 error (error case 0), specific error depends on used function block:
|
MQTT_ERR_INPUT_03_1 |
16#4031 |
Function block Input 03 error (error case 1), specific error depends on used function block:
|
MQTT_ERR_INPUT_04_0 |
16#4040 |
Function block Input 04 error (error case 0), specific error depends on used function block:
|
MQTT_ERR_INPUT_06_0 |
16#4060 |
Function block Input 06 error (error case 0), specific error depends on used function block:
|
MQTT_ERR_INPUT_07_0 |
16#4070 |
Function block Input 07 error (error case 0), specific error depends on used function block:
|
MQTT_ERR_INPUT_08_0 |
16#4080 |
Function block Input 08 error (error case 0), specific error depends on used function block:
|
MQTT_ERR_INPUT_12_0 |
16#4120 |
Function block Input 12 error (error case 0), specific error depends on used function block:
|
MQTT_ERR_INPUT_12_1 |
16#4121 |
Function block Input 12 error (error case 1), specific error depends on used function block:
|
MQTT_ERR_FATAL_ERROR |
16#5FFFF |
Fatal error state machine. |
MQTT_QOS (Enum)
Parameter |
Value |
Description |
---|---|---|
QOS_0 |
- |
Fire and forget (At most once delivered). |
QOS_1 |
- |
Simple acknowledgement (At least once delivered). |
QOS_2 |
- |
Complex acknowledgement (Exactly once delivered). |
MQTT_MESSAGE
This structure is used for messages which can be published or used for LastWill on MqttConnect(FB).
Variable name |
Data type |
Default value |
Description |
---|---|---|---|
sTopic |
STRING(MQTT_MAX_TOPIC_LEN) |
Empty string |
Topic where this message belongs to. |
pbyPayload |
POINTER TO BYTE |
0 |
Payload which should be sent. |
dwLen |
DWORD |
0 |
Length of the payload. |
eQos |
MQTT_QOS |
QOS_0 |
Quality of Service level. |
xRetainFlag |
BOOL |
FALSE |
True = message must be stored by the server, False = server must not store this message. |
MQTT_CONNECTION
Internal data required by the library to operate. This structure allocates memory and it is used to identify the MQTT connection you want to work with
Parameter |
Data type |
Range |
---|---|---|
abyConn |
Array |
MQTT_CLIENT_STRUCT_SIZE |
abyTxBuf |
Array |
MQTT_TX_BUF_SIZE |
abyRxBuf |
Array |
MQTT_RX_BUF_SIZE |
abyMsgBuf |
Array |
MQTT_MSG_BUF_SIZE |