MQTT_PUBLISH  topic$, data$, QoS_number
Purpose Publish a topic and a message to the connected MQTT Broker with a specific QoS .
Examples
MQTT_PUBLISH "test/topic", "Hello From TRi "+STR$(X), 1
Comments:

  1. The topic$ is a text string (up to 70 chars max) that contains the topic and sub-topics that the PLC want to publish to the broker.
  2. The data$ is a text string that contain the data associated with the "topic$".
Note: You use the same MQTT_PUBLISHcommand whether the communication with the MQTT broker is encrypted or not. The encryption status is already established by the MQTT_CONNECT command and would not need to be specified here.

 

See Also MQTT_CONNECT, MQTT_STATUS(), MQTT_SUBSCRIBE

backbutton.gif (507 bytes)  Basic to TBASIC Reference Manual