I am currently trying to establish an MQTT connection to PLCnext. The values of user-specific process data should be sent as a pure string (no JSON) to a broker and read from there. The following working environment is used:
EDULINE starter kit with AXC F 2152, FW: 2021.05
PLCnext Engineer 2021.3
MQTT_Client_Library_3
As a programming language I use ST and optionally FBD.
Hiveqm’s public broker is used as the MQTT broker, and Hiveqm’s public MQTT client (web client) for testing.
Results:
Connection to MQTT broker: OK
Method Publish: OK; the process data is fast transferred to the broker.
Method Subscriber: OK
Method StartConsuming: OK
Method TryConsumeMessage: No reaction, process data are not received (anyPayload remains empty), no MQTT errors in the output.log file
The process data written by the Hiveqm MQTT client is not received by the TryConsumMessage method, although there is a working connection to the broker. A test with another MQTT client showed that the broker actually sent the written process data. Attached is my FBD program.
Maybe someone would have recommendations for troubleshooting or further testing.
Many thanks for the efforts.
Reinhard
