kihtrak
Hello there, 
I tried running your sample project listed on the instructional page. Uploading the file to the server, compiling without errors everything went fine. But, I don't see the desired output. The circuit just stays inactive. 
( I tried connecting the switch and the led as told by you , for raspberry pi ). Am I missing something? Kindly help me fix this. 

Thanks in advance. 
Reply 0 0
thiagoralves
Are you using %IX0.0 for your input? In that case, did you notice that this input is reversed due to internal pull-up resistors on the RPi board? If you're using %IX0.0 with the RPi board you must use a negated contact in your program and wire your switch to GND, otherwise the LED will stay on forever.
Reply 0 0
kihtrak
I used %IX0.2 for the button and %QX0.0 for the led. And, I didn't use the ground in the rPI rather I grounded it on the breadboard. 
Reply 0 0
kihtrak
Also, once I upload the file on the server and it compiles without any error, does the OpenPLC work on it's own or do I have to follow any more procedure after it? 
Reply 0 0
thiagoralves
It should run right after compilation. Does the LED light up at any given moment if you wire 3v3 or gnd directly to %IX0.2?
Reply 0 0
kihtrak
Let me attach the photos of my connections. Kindly let me know the mistake am doing.  The BROWN wire is connected to pin 1 (3.3 V), the BLACK to %IX0.2 and the yellow to %QX0.0. IMG_20170919_171037.jpg  IMG_20170919_171058.jpg 
Reply 0 0
thiagoralves
From the picture your circuit looks very odd. Your LED must be connected to GND somewhere and I don't see it. It seems that it is getting 3v3 from the parallel contact of the button (perhaps?), and if that is the case, it is also wrong. Also, if you tried to light up your LED by connecting it straight to 3v3 and GND you probably burned it. In that case, go find another LED because this one will not light up anymore. LEDs work with a very small current, therefore you must use a resistor in series (something like 330R would work). The correct LED circuit should be:

                 Resistor
%QX0.0----/\/\/\/\----LED(Anode)    LED(Cathode)-----GND

Also, since you are using %IX0.2 you must add pull-down resistor or else the input will be floating whenever the button is not pressed. Just add a resistor (10K should work) to ground on the black wire.

I strongly suggest you to look for some basic electronics tutorial, it will help you work around your breaboard circuits.
Reply 0 0
kihtrak
Right, in the beginning I used a resistor both for the led ( to prevent it from burning ) and one more to pull down as well. But, still I didn't get the results. 
Hence, I wanna give it a try by connecting the 3.3v directly to the led to see if there's any small spark, at least! No effect. Then , I decided to have a switch in between to see if it works ( since I used the st file of yours ), still nothing worked. For grounding, I did use the breadboard before, but since I'd no proper results I wanted to use the grounding on the rPI. 
But, I didn't use 10K for pulling down, I used 1K resistor for the %IX 0.2. Let me do that. And, do I need to connect the 3.3v for the led, or just the gpio %IX0.2 is suffice? 
Reply 0 0
thiagoralves
kihtrak wrote:
Hence, I wanna give it a try by connecting the 3.3v directly to the led to see if there's any small spark, at least! No effect.

If you connected 3v3 directly to the LED anode and it didn't light up then for sure your LED is dead. 

kihtrak wrote:
And, do I need to connect the 3.3v for the LED, or just the gpio %IX0.2 is suffice?

What you just said doesn't make sense. Assuming you're talking about the output %QX0.0, if you connect it to the LED anode pin, and connect the LED cathode pin to a resistor and then to ground, the LED will be controlled by %QX0.0. If you remove %QX0.0 and put 3v3 in its place (LED anode pin) it should light up constantly. If not, the LED is dead.
Reply 0 0
Reply