Rajesh Anand
Hello everyone. I'm new to the raspberry pi system. I have a raspberry pi plus unipi system connected together and I want to run open PLC in this. I have written a program (a basic one) in the text editor and saved it as .st file (the program is written in structured text format). I would like to know how to compile and run the program in the terminal.
Quote 0 0
thiagoralves
https://www.openplcproject.com/getting-started-unipi

https://www.openplcproject.com/reference-uploading-your-project
Quote 1 0
Rajesh Anand
Hello again. When I try to enter the IP address of the RPi with the port address 8080 to connect to OPENplc web server, I'm not able to connect.  Is there anything I'm missing
Quote 0 0
thiagoralves
Either OpenPLC is not running on the UniPi, you have the wrong IP address, or your computer can’t reach the UniPi. Try to ping the UniPi from your desktop to check connectivity.
Quote 0 0
Rajesh Anand
There is wireless connectivity with RPi and wired one. I tried both the addresses and still it doesn't get connected. Is there any way to check whether the  OpenPLC is running on Unipi?
Is the port number 8080 in all the case? I got some number at the end of IP address which was different and I used that as well.
Quote 0 0
thiagoralves
There are two ways:
1. On the UniPi, open the browser and type localhost:8080. If the OpenPLC page doesn't open, then OpenPLC is not running. If it opens, then you're having connectivity issues between your UniPi and your computer.
2. On the UniPi, open terminal and type
sudo systemctl status openplc

This command will tell you if OpenPLC is running or not, and if it is not running, the command will tell you why.
Quote 0 0
Rajesh Anand
Error: ld.so: object '/usr/share/doc/tmux/.24631/eqoareIJ2hyM.so.armv71' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
sudo: systemct1: command not found

This was the error which I received when I typed that command. What should be done to run the openPLC from the terminal before connecting the unipi to the openPLC web server?
Quote 0 0
thiagoralves
It is not systemct1 it is systemctl (as in system control)
Quote 0 0
Rajesh Anand
Oh Okay. I used that command and got an error. "Unit openPLC.service could not be found".

But I used "sudo nodejs server.js" in the terminal and could access the OpenPLC server by entering "localhost:8080" in the web browser.

1. I installed OpenPLC Editor from your link. When I try to run the application, it doesn't open. Any options left to open the editor in RPi?
2. I installed the openPLC runtime in another separate windows PC and created the program and manually typed the code in a text editor in RPi and it got compiled and finally, in the editor, it says "Compiled without errors" and "Starting OpenPLC Software..." and it stays the same without any action.
Quote 0 0
thiagoralves
Where did you get this outdated OpenPLC installation? NodeJS is used on OpenPLC version 2 and that is not updated for at least two years. You should use OpenPLC version 3 as explained on the openplcproject.com website.

About the editor, you should install it on your computer, not on the PLC (UniPi device). Once you have OpenPLC version 3 installed you should be able to upload a program for your computer following the instructions on the website.
Quote 0 0
Rajesh Anand
I installed the editor in my windows laptop and I connected the Unipi to my windows using ethernet cable (since they are not in the same network? I don't know if this is necessary or not).
 
When I type the IP address of Unipiin my windows laptop browser I couldn't connect to the OpenPLC server. Does that mean openplc should run in my windows too?
Quote 0 0
thiagoralves
The editor should run on your windows pc. The runtime should run on the UniPi. The version of your OpenPLC runtime on the UniPi is very old. You need to update it first. My suggestion is that you start from scratch with a blank Raspbian image and then install OpenPLC runtime on the UniPi following the instructions on the openplcproject.com website. 
Quote 0 0
Rajesh Anand
I updated the OpenPLC runtime to v3 and I compiled the program in the online OpenPLC server. It shows running but where can I see the output of the program (say the addition of two numbers and I gave the numbers in the program itself).
Quote 0 0
thiagoralves
PLCs are not programmed like computers. If you're struggling with this basic concept, I suggest you take a look at some PLC programming courses online. The output of a PLC is its physical pins. If you put the result of your addition on an analog output pin you will see it as a voltage measured on the respective pin.
Quote 0 0
Rajesh Anand
Thanks again. It was really helpful. Im coding in the OpenPLC editor using structural text languag and im actually planning to measure side channels (thermal and power side channels) in the Unipi platform using openPLC. Is there any documentation where I could read about measuring those stuff as I cant find any resources regarding side channels in openPLC? Any suggestions would be useful.
Quote 0 0