Connecting a web application to a PLC

phrtaylor

Member
Join Date
Nov 2022
Location
Montreal, Quebec
Posts
2
Hi PLC talk people,

I have a beginner question.

I am looking at requirements to build a cloud hosted web application that can connect to a PLC (in my case a SIMATIC 300).
The web application needs to send commands to and receive events from the PLC, I would like to know what infrastructure you would recommend we investigate.

I imagine the following.
1. The PLC is running an OPC-UA server.
2. We have OPC-UA PUB/SUB MQTT Broker.
(does this run on a cloud server? I assume a router on premises would need to be in the middle).
3. The Web application can authenticate with the OPC-UA Broker and subscribe to events, publish commands.


We would like to be able to visualize the equipment operation from the web application. this part we are completely comfortable with.


I imagine there are massive gaps in my description.
Would you be able to point me at areas we need to consider.

Thanks
 
Ignition is probably my best advice. The Cheap Charlie solution would be Node Red. You'd have to make some "fancy" netowrking to separate the plant from the users, but that's not rocket science nowadays.
 
The S7 300 does not have an integrated OPC UA server, that's a 1200/1500 feature. That said, once you move that to a PC something like your solution could make sense.

There are some more elegant options if you are talking about a 1500. its web server has a REST interface, and it has both an Lhttp library for communicating with web servers as well as OPC UA Pub/Sub and MQTT libraries. The 300's are much older, though, and have a lot less integrated comm options.

The trick is the requirement for 2 way communication. There are lots of middleware devices/SW to send data up to the cloud, but fewer to send cloud data back to the PLC, or do both.

A different solution to the problem could be using a local HMI/SCADA package that has a web interface with local/remote web clients. This way the communication aspects are all built in, and the PLC doesn't need to be internet facing. The HMI PC would presumably be in some kind of DMZ, where it can reach down to PLC and up to web. Your SCADA package of choice probably has that feature these days. If you want to stick with Siemens WinCC V7 (WebUX option) and WinCC Unified both can; I'm pretty sure Ignition can as well.
 
Last edited:
Look at the PLCNext PLCs they have MQTT & OPC UA servers and Cloud drivers from their SharePoint. They are built for the new connected world and talk Profinet natively so support all the Siemens IO. Also have Cyber security certificates ( IEC 62443-2 compliant)

https://www.plcnext.help/te/About/Home.htm
 
Last edited:
Looking at the picture on this link, it seems the IDE is within the PLC itself. Surely Matlab isn't within the PLC itself, but the C++ or C# code would be. Really confusing what they mean by this.
PLCNext will run blocks and Simulink code from Matlab, it will also run addons written in python C++ or C#. Well worth looking into and has a load of bolt-on functionality, The PLC is also a small Linux Box, so can run software such as Grafan and Telegram.
 
So that's what they mean by it. The provenance of the code to be run.

Silly question, but how would the PLC logic interface with the underlying DB used by Grafana? I imagine the DB kept in the PLC would be fairly small (a week's worth of data possibly?) but it's a nice application. Not sure Grafana is the best for industrial trending (I found the zooming and such a bit lacking for analysis), but it certainly holds up to tools costing far more (looking at you GE).
 
Assuming the S7-300 already exists and that the amount/frequency of data to transfer is modest then you could install an e W o n Flexy. The Flexy will speak directly to the s7-300 and also contains an MQTT client capable of establishing an encrypted channel to an MQTT server.

You would need to Install and setup the e W O N flexy, configure the PLC comms channel, create tags linked to your PLC data, write a script to publish the tags to MQTT and create an MQTT subscription to revieve messages. To use TLS you also need ot install a certificate.

I have similar systems running and use Telegraf to fetch data from MQTT for storage in an InFluxDB database. Grafana is used to display dashboards.

Nick
 
Last edited:
you should check out these guys https://ingeardrivers.com/
i have been using their drivers for years with Net Studio you can build gust about anything you want
I would be careful putting controls on the web
I have systems setup where I run the same HMI multiple computers I even run them over the internet using a VPN it works great and i have all the same functions and information that the local operator has as single develeper license is all you need
 

Similar Topics

Hi I have to modify ladder logic (using a notebook with RSLogix 5000) in a CompactLogix PLC with eweb module. The PLC is on a remote LAN, and...
Replies
9
Views
4,143
I have a piece of equipment that is operated by a PanelView Plus 600 HMI touch screen via RS232 into a Micrologix 1500 PLC. I am trying to...
Replies
5
Views
108
Hi, Seeking consultation on an implementation matter, and have a question about Modicon Compact 984 communication through RS485: Three Modicon...
Replies
3
Views
87
I have Toyopuc PLC PC10G-CPU and some communication modules of it. With this modules I'm able to connect with Ethernet, Ethernet/IP, FLnet, FRMT...
Replies
0
Views
52
Hi, We are setting up an Aveva Plant SCADA node with the intention to connect it to a Wonderware Historian node. Everywhere I look online I see...
Replies
1
Views
117
Back
Top Bottom