Nosaj66au
Hi Open PLCer, I'm new to this group however programmed my first PLC about 40 years ago, now days, IOT is my thing and I'm very familiar with most open source IOT software and work heavily in docker. OPENPLC tweaked my attention as recently I need some automation that really should have been done in a PLC but I end up hashed something together in Node Red but it was just messy.
Members with some experience my be able to answer this question. Would it be possible in a function block, to receive an MQTT JSON structured payload and simple update PLC variables or variable structures for element which are matched in payload and  then send out an MQTT payload in a JSON format, of selected variable that have changed during the last sweep?             
Regard 
Jason
Reply 0 0
thiagoralves
You can send and receive MQTT messages on some platforms (arduino-based boards with WiFi or Ethernet connectivity). The JSON parsing is the problem, as you would have to do that on the PLC program which is very difficult. You can try using the Arduino Extension to craft something on the JSON parsing as this is easier to be done in C than IEC languages (Arduino Extension allows you to run Arduino sketches alongside your PLC program). 
Reply 1 0
Nosaj66au
Many thanks for your fast response. At the moment my interest more around Linux / docker environments, I see the Arduino / ESP's MPU as remote I/O and plan to use (https://tasmota.github.io/docs/) Tasmota firmware . Having been in the Automation and controls space most of my work life. Micro distributed control only works at small scale or repetitive applications. I have approximately 60 ESP install in my home automation system, doing everything from lighting to water management, heating controls etc.  I have look at the OPPENPLC Modbus TCP option but this approach has many drawbacks. Ethernet IP being Pub Sub is better but again heavy on a WIFI network. After studying your source a MQTT I/O driver/server may be the go. Possibly later including Sparkplug B.  What are your thoughts?
 
  
 
Many thanks 
Jason 
Reply 0 0
Nosaj66au
Just a but more brain dumping, my current system does auto discovery of the Tasmota devices, this method could be used to auto generate the variable lists at the PLC layer food for thought? Tasmota currently has around 50 different field device drivers and configs can be push out via MQTT. Oh the possibilities?? 🙂
Reply 0 0
Reply