carefree
I can't seem to control the pins. I have a simple one line ladder program compiled via the openPLC Editor - also tried the Hello World program - but can't seem to get any response from the Pi. OpenPLC via port 8080 seems to load, compile, start, etc. just fine but no output. One odd thing is: Monitoring shows the points correctly but I cannot force a value to True by going to Details, checking the Force... box, then Saving - doesn't do a thing.

Also, Is there a trouble shooting list somewhere? I'd like to be sure I have control of the pins and also be able to check if the pins are working properly - manually run some CLI commands maybe?
Quote 0 0
thiagoralves
From openplcproject.com website:
Quote:
By default OpenPLC runtime is installed with a blank driver. This means that it won't be able to control your Raspberry Pi pins straight away. To enable the Raspberry Pi driver, go to the "Hardware" section and from the popup menu, select either "Raspberry Pi" or "Raspberry Pi - Old model (2011 model B)" depending on your board. Click on "Save changes" and wait for a little bit while the driver is applied.
Quote 0 0
carefree
That's what's so frustrating. First I followed your youtube introductory series on the Pi and openLC - never got any IO pin response. Since someone else had started with this Pi I thought well maybe something was installed that locked access to the pins so I decided to start over. I reloaded Raspbian then started with the openPLCproject getting started stuff, lastly did all the steps on the https://www.openplcproject.com/reference-your-first-project and the https://www.openplcproject.com/reference-uploading-your-project pages. The one exception to the instructions for the project is that I used %IX0.6, %IX0.7, and %QX0.4. This is a Pi 4 Model B so I used the Raspberry Pi selection for the driver as instructed in the tutorials. 

Wow, I think I just found the problem! Thinking about the GPIO pins I Ooogled it and found the wiringPI.com site, ran the command to check version and came up with 2.50 but the output about the PI model, etc. was garbled. Happened upon this page: http://wiringpi.com/wiringpi-updated-to-2-52-for-the-raspberry-pi-4b/ so did the update and the version command now shows the correct info. I think this is going to solve my problem though I can't look at another screen tonight - I have to get to bed. But, before I go - have you seen this page?: http://wiringpi.com/wiringpi-deprecated/ Sounds like there could be some pretty serious consequences for projects like openPLC.
Quote 0 0
carefree
Update: that did solve the problem of no IO pin control - all the intro-programs I created work as they should now. The monitoring panel of the openPLC runtime still does not allow me to force a point on/off. I gather that's something that should be working - is that correct? - at least for the older Pi's?. 
Quote 0 0
carefree
FYI (mine too) This is what the GPIO readall command returns when it's run right after booting the Pi:
AfterBoot.png 
Then after starting the OpenPLC runtime by clicking Start PLC:
AfterStartPLC.png 
Interesting that there appear to be more negated inputs than I remember you mentioning in your tutorials.
Notice that it does ID the Pi 4B properly.

Note that I'm an absolute newbie at this PLC thing.
I worked for GM as an electrician back before PLCs were ever used. We just had huge relay/contactor panels - and ladder diagrams.
I've just been assigned a project to control the temperature of s hot springs pool; and ladder logic is something I know pretty well.
So that's why I'm all of a sudden a big bother here. Trying to get this project off the ground started out with two whole days of Grrrrr!@#Why???WhyNot???
All's well that ends well though - and I did learn some stuff I might never have known if it all just worked.
Thanks a lot!
Quote 0 0
thiagoralves
I've never tested OpenPLC on the new Pi 4. Since it relies on WiringPi, I was just confident that it would work given that WiringPi is officially supported by Raspbian (it comes pre installed in the image). Hopefully the Raspberry Pi foundation will update their Raspbian image to include this most recent WiringPi that is compatible with the Pi 4.

The fact that WiringPi won't be supported anymore worries me. Perhaps I will have to find out an alternative GPIO control library in C to replace WiringPi.

Thanks for the findings!
Quote 1 0
jara257
Hi Thiago, 
Im having similar issues as the previous user but in my case I can see the change of state in the gpio readall table when I run the Hello World program. At the editor I can force the PB1 to get the LAMP on and similarly I can turn it off by forcing PB2. (So that is all working)
Capture.png
The problem  is when I upload the program on the webserver the MONITORING screen shows a completely different state that the real one when I run the GPIO READALL code at the terminal as you can see on the following screens. The first terminal table is the result right after uploading the code, not pressing any pushbutton 
Capture2.png 
Notice that on the second table from the terminal the Input %IX0.0 is true (1) as I result of me holding the pushbutton while running the code and I can do the same with %IX0.2. Unfortunately I am not getting any result from any output.

Below is the RunTime LOG:
OpenPLC Runtime starting...
Interactive Server: Listening on port 43628
Skipping configuration of Slave Devices (mbconfig.cfg file not found)
Warning: Persistent Storage file not found
Issued start_modbus() command to start on port: 502
Server: Listening on port 502
Server: waiting for new client...
Issued start_dnp3() command to start on port: 20000
DNP3 ID manager: Starting thread (0)
DNP3 ID DNP3_Server: Listening on: 0.0.0.0:20000
Issued start_modbus() command to start on port: 502
Modbus server already active. Restarting on port: 502
Server: Error accepting client!
Terminating Server thread
Modbus server was stopped
Server: Listening on port 502
Server: waiting for new client...
Issued start_dnp3() command to start on port: 20000
DNP3 server already active. Restarting on port: 20000
DNP3 ID DNP3_Server: Operation aborted.
DNP3 ID manager: Exiting thread (0)
DNP3 server was stopped
DNP3 ID manager: Starting thread (0)
DNP3 ID DNP3_Server: Listening on: 0.0.0.0:20000
Issued start_enip() command to start on port: 44818
Server: Listening on port 44818
Server: waiting for new client...
Issued stop_pstorage() command
Issued start_modbus() command to start on port: 502
Modbus server already active. Restarting on port: 502
Server: Error accepting client!
Terminating Server thread
Modbus server was stopped
Server: Listening on port 502
Server: waiting for new client...
Issued start_dnp3() command to start on port: 20000
DNP3 server already active. Restarting on port: 20000
DNP3 ID DNP3_Server: Operation aborted.
DNP3 ID manager: Exiting thread (0)
DNP3 server was stopped
DNP3 ID manager: Starting thread (0)
DNP3 ID DNP3_Server: Listening on: 0.0.0.0:20000
Issued start_enip() command to start on port: 44818
EtherNet/IP server already active. Restarting on port: 44818
Server: Error accepting client!
Terminating Server thread
EtherNet/IP server was stopped
Server: Listening on port 44818
Server: waiting for new client...
Issued stop_pstorage() command
Server: Client accepted! Creating thread for the new client ID: 19...
Server: waiting for new client...
Server: Thread created for client ID: 19
Modbus Server: client ID: 19 has closed the connection
Terminating Modbus connections thread
Server: Client accepted! Creating thread for the new client ID: 19...
Server: waiting for new client...
Server: Thread created for client ID: 19


Is there anything to solve this issue? 

Thanks for your help
  
Quote 0 0
thiagoralves
I don't see any incoherence here. I'm pretty sure you're pressing the wrong button. The only difference between the first and second table is that pin 11 (%IX0.3) is false on the first table and true on the second. There isn't any %IX0.3 on your program, so that's irrelevant for the LAMP (%QX0.6) to be true or false. Check https://www.openplcproject.com/getting-started-rpi (PIN MAPPING section) for the correct mapping to make sure you wired your circuit appropriately. Also, there is a note on the same section that reads: "Also, take note that the first two inputs (%IX0.0 and %IX0.1) have hardware pullups, which means that if you don't connect anything to them, they will both read as TRUE." This is what I can see at the Monitoring page. PB1 (%IX0.0) seems to be true all the time.
Quote 0 0
jara257
Thanks a lot for your help.
I was following another mapping as I was confused about the labels for each pin. I had follow your mapping and now is working ok. Now finally I can start doing what I want. Thanks again for your time
Quote 0 0
xale12
I just buy a new Raspberry pi 4 .When I started openPLC runtime in Pi 3 it run correctly but when I used it in PI 4 it is not working hmm ..Can you help me ..
Quote 0 0
thiagoralves
Define "it is not working". It can be a multitude of things.
Quote 0 0
Wjaguar95
Hi, the same happens to me, i just bought a raspberry pi 4, and the exact same program with the exact same circuit on the protoboard did work on a raspberry pi 3 model b, but not on the raspberry 4. in the Monitor screen, the value of a push button does not change the state when you push it, but in node red it seems to detect when theres a change. So it seems to be a problem of open plc, maybe some library or some update is missing. I will apreciate some help!!
Quote 0 0
thiagoralves
A couple things:
1. It is always recommended to have OpenPLC on a clean Raspbian image. Other programs like NodeRed can interfere with the GPIO configuration and conflict with OpenPLC
2. Make sure you have enabled Raspberry Pi driver on the Hardware menu
3. Make sure you have updated wiringpi to the latest version: http://wiringpi.com/wiringpi-updated-to-2-52-for-the-raspberry-pi-4b/
Quote 0 0
xale12
I read the previous comment , so I thought that open plc can not use in pi 4 . Is that right?
Quote 0 0
thiagoralves
I don’t have a Pi4 to test, but if you read the whole thread you’ll see that most people had just misunderstandings (outdated version of wiringpi, wrong pin mapping, etc) and got it working in the end
Quote 0 0