myu
Hi, I am new to OpenPLC and PLC programming. I created a web app using Python and Django framework to take in a user input and check if it's valid. This web app will also be running on a web server.
 
I was wondering if it is possible to connect the web app to OpenPLC Runtime and use it as a variable input. If it is, how would I go about doing this? I saw videos on how to connect using SCADABR as a HMI but I'm unsure about how to do this if I created a web app from scratch.
 
I appreciate any help on this issue.
Reply 0 0
thiagoralves
I don't know exactly what you want to accomplish with this, but the easiest way to send anything to the PLC runtime is by using Modbus. The Modbus protocol allows you to arbitrarily read and write any register location in the PLC.
Reply 0 0
myu
To give you some context, I am writing a program for a VIN (Vehicle Identification Number) Scriber. The web app takes in an VIN input from the user and queries it against an sql database to see if there are duplicates of that VIN. If the VIN is valid, I want to be able to send this input to the VIN Scriber for inscription. 
 
I have a Raspberry Pi that I want to use for this project and the VIN Scriber can be connected through a network. 
 
Do you have any ideas/tips on how to start a project like this? 
Reply 0 0
thiagoralves
You could send that information over using Modbus just fine. There are several Modbus libraries you can use with Python, where pymodbus is one of the most popular. I just don’t understand why you need a PLC runtime for this. Can’t you just implement everything in a Python script?
Reply 0 0
myu
I am not familiar with Python scripting. This is my first project using Python so I am learning everything on the go. 
 
The web app is meant to be used on a tablet. I'm not sure if that's compatible to run a script. 
 
I think I am having trouble visualizing how everything connects together. I understand that the web app should be acting as a master with the scriber acting as a slave but how does the raspberry pi fit into this? I plan on having the web app run on a web server rather than the raspberry pi so how would the raspberry pi be connected to the web app and scriber? 
 
Sorry if the questions are basic. 
Reply 0 0
thiagoralves
I think the main question is: why do you need a PLC runtime to build this? It doesn't look like you need a PLC at all.
Reply 0 0
myu
I think the VIN Scriber requires a PLC program to be written to execute orders as it is an industrial machine. The VIN Scriber can also communicate through an IP address. 
 
How would you do this without runtime?
Reply 0 0
thiagoralves
I'm not familiar with this hardware, and most likely OpenPLC isn't either, which means it won't work with it. Writing code to integrate OpenPLC with your hardware just to create an application for it might be an overkill. Perhaps it will be better and easier to just write an application in Python, C, C#, Node, etc that talks to your VIN scriber directly and does what you want.
Reply 0 0
Reply