LL programming help requested

sinha_nsit

Member
Join Date
Aug 2007
Location
varanasi
Posts
17
This is apparently very simple application, but I have not been able to write a ladder program for it so far:

Input: two maintained type ON/OFF switches

Output: A lamp

Objective: The lamp should switch ON when both switches are ON. It should switch OFF when both switches are OFF. Any other combination, i.e., one switch ON and the other OFF, should not change the previous status of output.

The difficulty: How to retain the previous status, which may be both ON or OFF for the same combination of input conditions?
Thanks.
 
It is simple. Series the 2 switches in a normally open fashion to SET an output, and series the 2 switches in a normally closed fashion to RESET the output

Cheers
 
Last edited:
Something like this?

ladder.jpg
 
Or you can set the output on with (I1 and I2) on and then only reset with not(I1 and I2).But the one give above is better.

A I 1.0
A I 1.1
S M 20.0
AN I 1.0
AN I 1.1
R M 20.0
A M 20.0
= Q 0.0
 
Ken Moore said:
Dirt, I believe there is an error in your ladder. Either switch can turn off the lamp in your example.

Please check ladder logic again, to set the coil for M 0.0 you need to have both switches off.

Edit: Maybe I'm blind, but I don't see the fault.
 
Last edited:
Thanks a lot.

Both methods work nicely, but "set output" / "reset output" method is more straightforward and easy to comprehend.
Thanks again.
 
sinha_nsit said:
Thanks a lot.

Both methods work nicely, but "set output" / "reset output" method is more straightforward and easy to comprehend.
Thanks again.

It may be easy to comprehend, but be aware that if the internal flag bit used to control the output is retentive, then you may have the device unintentionally turn on after a power cycle.

Yes, I realize this is only for a lamp, but if the principle is applied to a device that can move, there is a potential safety hazard.

When using latch/unlatch (or SET/RESET) commands to control devices, it is generally a good practice to use the "FIRST SCAN" bit/OB of the processor to force them all into a safe state on program warm/cold restart.
 
I would prefer the set/reset solution. The LL solution isn't quite correct, because the lamp will still be on for one scan after both switches are switched off. Of course, this is just a student exercise and no one would notice the difference if the light stayed on an extra scan, but in real life there are many cases where the logical state of a device could be used elsewhere in the program, and the inconsistent state of the device against the switches could cause problems.
 
Error of one scan time will usually be there in many LL programs, specially those involving timers. it requires to be judged whether this would have any undesirable effect.
 

Similar Topics

Hi all, i am the new controls guy at the plant and i have inherited a pc from the previous controls guy with Siemens tia portal version 16 and 17...
Replies
20
Views
878
Hi can you help, have a book stitching machine with collates pages in 8 stages. I have installed a camera system that will give an input to...
Replies
24
Views
1,890
I don't have much experience in programming. I can do simple configuration. it is like this. i want to add something to the existing ladder...
Replies
39
Views
6,191
Hello there, I'm practically new to the PLC world, I'm quite familiar with Siemens TIA Portal but I'm currently tasked to program Schneider PLCs...
Replies
5
Views
1,861
Hello All, As you can guess by the title I am a total noob to programming PLC's. So my problem is that I have an old Pallet wrapper that uses an...
Replies
21
Views
4,924
Back
Top Bottom