GreatGBL
http://v1.freep.cn/3tb_1607111044219m31512293.png

Hello, see the figure above. I am beginner in PLC so I have some noob questions I want to ask.

It is the simple code of PLC, I builded the environment and uploaded the Wcode by web interface. There is some question I want to ask

1. How to trigger the buttion? I test connect the real buttion between GND and IO2, it was succeed while there is nothing happened connection with VCC.

2.When I delete the device in red block (on the figure), why the lcd(IO13) flash automatic, I think the device as delay.

3.when I push the button, why the LCD(IO13) is turn off ? From the logic, I think the LCD is turn on when I push the buttion ,if isn't it would be turn off. I dont understand why it is oppoiste/

Thanks for your answer
Quote 0 0
thiagoralves
All your questiona have only one answer: your circuit is wrong. You shouldn't connect the button directly to GND neither VCC. You need to connect it to VCC with a pulldown resistor. If you don't know what a pulldown resistor is, Google it a little bit, it will be worth knowing. Basically, if you just wire a button to the pin and connect the button to VCC or GND, when the button is not pressed, the pin is disconnected, which means that it is neither 0 or 1. In electronics, we say the pin is floating. When it happens, reading the pin can give you sometimes 1 and sometimes 0. That's why you need to put a pulldown resistor, so that the pin will remain in 0 and only go to 1 when you press the button. Do that and you will see that the circuit will behave as expected.
Quote 1 0