NWT.Stuff
Hi 

I'm working on a conversion project from Python to OpenPLC.  All Graphics and Animation has already been done for the old Architecture. This is using PHP and XML HttpRequest to schedule html animation updates.

My original plan was to use PHP Modbus for the Modbus communications but it's proving really tricky to manage the TCP/IP sockets as I want to address a single open socket in a large number of php files (some of which are called by XML HttpRequests).

So I was thinking why not do the modbus communications in XML HttpRequests. e.g. inputs every 100ms. outputs the same.

Does this sound like a goer ? and could somebody point me in the direction of some useful resources to give this a go ?

Many Thanks in advance,  Kevin  
Quote 0 0
thiagoralves
What I would do is create a middleware software in python that queries OpenPLC in Modbus and makes the data available through PHP and XML HttpRequests for your frontend animation. That's the easiest way if you don't want to touch your graphics.

That being said, the correct way of doing this is actually using a SCADA software to display your HMI. SCADA software can talk Modbus, DNP3, EtherNet/IP natively, no need for any type of conversion. OpenPLC has ScadaBR as an open source HMI builder that can run in your browser. It is pretty cool if you're willing to refactor your HMIs. There are other solutions that are either free or very cheap, such as AdvancedHMI (visual studio based HMI) or VTScada (free for up to 50 points).
Quote 0 0
NWT.Stuff
Thanks Thiago, Will research all your suggestions.  Think it's probably time to go back to the drawing board and revisit the objectives.

For example:-
- The correct way / SCADA is my preference from a technical point of view
- However I'm looking at Small Home Automation Project - so i only need MAX 8 DI, 8 DO and 4 ANA IN per RPI drop.
- Max 10 %MW control words.
- Reliable is probably my main criteria
- Not a commercial activity so I'm happy as long as it works and looks good 🙂

Maybe next step for me should be to look at the comms scheduling/loading and calculate what I really need for communication transaction and then link to the proposed solutions that you suggested.

You're open source platform is capable of doing what you spend a lot of money with Allen Bradley, Siemens, Schneider etc.  I'm sure they are looking to open source as a serious threat. My days of Industrial Automation are well over and I'm very happy being an enthusiast and experimenting & supporting projects like yours 🙂

P.S. The easiest & quickest way for me is the "middleware python route". However if I told you there was a MySQL Database available and that my Python/MySQL skills were equivalent would that change anything ?

P.P.S. Will give you a good example of how OpenPLC simplified my "Home Control".  I used to have a scheduled MySQL task for a Swimming Pool Recirculation Cycle. Now I just pop a value (cycle time in secs) into a Modbus MW Word and it kicks off a timer to run the pump. Totally the right way to control equipment like that 🙂

Keep Up the good work. Kevin

Quote 0 0
NWT.Stuff
Leading on from you're first suggestion I've gone with the attached png file.

Just wish I had discovered uModbus for Python a few eweeks ago 🙂
 
Quote 0 0