rahul
I'm having a problem in running a openplc through raspberry pi. I have raspberry pi installed with openplc and arduino board installed with the openplc firmware. and i uploaded the code and it has been running but the input and output is not working. And the rx and tx on arduino are blinking contineously and i tested the same programming running on raspberry pi alone, its working fine but when i get an arduino in between its not working.please help
the plc log is as shown belowCapture.jpg 
i
d

are
Reply 0 0
thiagoralves
If the rx and tx on the arduino are constantly blinking, it means that it is working. Perhaps you're trying to read the wrong pins on your arduino board or you circuit is not correct. What is the program you're trying to run?
Reply 0 0
rahul
ya i verified the pin but no use, i was trying to run the hello program which is given in the website.
and now i'm getting new error

pi@raspberrypi:~ $ cd OpenPLC_v2
pi@raspberrypi:~/OpenPLC_v2 $ sudo nodejs server.js
Working on port 8080

events.js:72
throw er; // Unhandled 'error' event
^
Error: spawn ENOENT
at errnoException (child_process.js:1000:11)
at Process.ChildProcess._handle.onexit (child_process.js:791:34)

please help me to solve this??
Reply 0 0
thiagoralves
This error means that your openplc executable got corrupted (probably because you uploaded a bad program). Run ./ build.sh again and you should be fine. About the hello world example, have you inserted pull down resistors on the arduino button circuit? Perhaps you wanna try the Reference example instead:  http://www.openplcproject.com/reference-your-first-project
Reply 0 0
rahul
ya its running back now,
my logs look like
Capture.JPG1.jpg  and i uploaded this program
Capture.JPG2.jpg  and my circuit looks like this
WhatsApp Image 2018-05-12 at 8.56.18 PM.jpeg 
but its not working
Reply 0 0
thiagoralves
I don’t see any pull down resistors or button attached to your arduino pin 5 (%IX0.3) from the picture. Also, it is hard to tell if your connections to the relay board are correct from the picture. Perhaps it would be better to use %QX0.3 which is the arduino built in led. Then you can test the program without connecting any output.
Reply 0 0
rahul
It's working now, I haven't changed any hardware or software, I just followed the steps from the beginning again and it's working.Im so thankful
Reply 0 0
rahul
Do this software provides interrupt or does this able to pause operation and continues after ??
Reply 0 0
thiagoralves
No, OpenPLC doesn't support hardware interrupts yet. You can stop the operation by clicking on the stop button on the webserver.
Reply 0 0
rahul
ohh okay, thanks a lot for the replay and all the best for the feature work.
Reply 0 0
rahul
where do i get the sample ladder program for analog input and analog output (both input and output should be analog, im using potentiometer as input and trying to use pwm pin for output)
Reply 0 0
thiagoralves
Just search the forum for "analog" and you will find interesting stuff
https://openplc.discussion.community/post/analog-input-and-output-samples-8279198?highlight=analog&pid=1293744002
https://openplc.discussion.community/post/adc-dac-8511424?pid=1295715030&highlight=analog
Reply 0 0
rahul
Okay thank you, I will try and let you know
Reply 0 0
Reply