Open armanruet opened 3 weeks ago
Hi,
please do call the publisher each cycle.
Then send of Publish reacts on rising edge, so for each send try this have to go true and then back false. For checking if send is done, please use the output done: set send to true --> wait for done --> send to false call the publish at least one time and then set send to true again...
any more questions?
BR Stefan
Is it possible to give an example!!
Hi Stefan
As a beginner with Codesys and MQTT, I have found your repository extremely helpful in understanding and implementing MQTT communication in my PLC project. I have successfully set up some logic with my devices and controller, but I'm facing a challenge in making the system work continuously based on incoming MQTT messages. My goal is to have the PLC execute a specific logic sequence whenever it receives a message on a predefined topic from the MQTT broker. This logic should then publish the corresponding steps continuously in a loop until a new message is received, triggering a different logic sequence. Currently, I can only manage to run the system once and publish the results, but I want the PLC to execute the logic immediately after receiving a message from the broker and keep publishing the logic steps in a loop until a new message arrives. I followed the following Function blocks:
In PLC_PRG I did this logic for publishing
Can you please help me in which way I can run this process continuously?