Simple Ladder Diagram Design HELP

Pablo127

Member
Join Date
Apr 2020
Location
florida
Posts
1
I need help answering a problem regarding the design a ladder diagram for a security light control. The question states when a sensor is activated, the light is activated then after 30 seconds the light automatically turns off. This is an extra credit problem so I'd really appreciate is someone can help me out and explain this to me.
 
Try restating the problem with OR and AND statements:

  • If
    • something is true about sensor A
  • OR/AND
    • something else is true about 30s
  • THEN
    • something should happen with the light




Let's step back a bit, and note that the key thing to understand is that a PLC program's logic is static, to first order, so the same rungs are scanned in left-to-right-top-to-bottom sequence, again and again and again.


Pretty much the only things that change from one program scan to the next program scan are

  1. the time
  2. the states of the inputs
  3. the states of the outputs
  4. the states of any ladder-internal memory
So one way to look at it is that the program logic makes decisions based on the states of the first two items (inputs) at the start of the program scan, over which it has no (direct) control, and sets the state of the last two items (outputs, broadly speaking) at the end of the program scan. And so you likely had little to no trouble constructing a ladder diagram that took note of a sensor's activation (an input) at the start of the program scan, and in response turned on a light (output) at the end of the program scan.


And now you can get no further thinking of ladder logic that way, i.e. like this:



Code:
inputs => [logic] => outputs
which is why you came here.


Don't be alarmed, because


  1. We all started there, and
  2. Nobody can get any further looking at it that way.




HOWEVER, that is only one way to look at PLC programming.


A broader view

  • recognizes that the program logic cannot change the first two (directly), but only react to them (same as above),
  • recognizes that the program can change the last two (same as above),
  • and recognizes that the last two persist from scan to scan (this is new!).
    • This means that any output state that was set on the last scan can be used as an input in the current scan.
So the new model is
Code:
[inputs + previous outputs] => [logic] => new outputs*
          ^                                         |
          |                                         V
          +-----------------------------------------+
* I am using the term [outputs] broadly enough to include any program-internal states such as bits, integers, and other memory, and even certain instructions which may maitain or even change their state automatically according to their nature from program scan to program scan.)

So our question to you is this: once you make the light come on when the sensor activates, can you make anything happen (i.e. change internal or external output states) 30s later to make it go off?


We will add one caveat: make sure that you write to the output that goes to the light only and exactly in one place in your program. There will be great temptation to break that rule: we have all done it, and can assure you with 100% confidence "lies madness that way" - it is indeed the dark side of the source.


We give you this secret handshake, to a higher plane, with but one condition: someday you must pass it on!
 
Two more things:
  1. Good for you for stating up front that this is for extra credit, and not trying to plagiarize
  2. When you grok any of the many possible solutions, you will understand why we have to be so vague to honor your position.
  3. Do check this out; it is well worth the time spent in a thorough read.
(Three more things;))
 
My advice would be to write out what your inputs and outputs are, and then make a list stating the sequence of events, i.e:


1: Switch turns on
2: Something
4: Something
5: Output
6: Something
7: Something


Once you have the basic sequence worked out you can start to think about what ladder elements you will need to build the logic.


And finally once you have the basics working you can start to refine your solution and add extra functionality, for your example you could build the basic logic that turns the light off after 30s from activation first and then add extra functionality so that it only turns off after 30s of no sensor activity.
 
And as if there are not already adequate suggestions here:


I am fairly certain most initial approaches to a problem like this will be "what condition, or AND/OR combinations of conditions, need to be true for the light to be on?" In other words, "light off" is "normal" and you look for the exceptional condition or combination of conditions to turn it on.




Another way to look at it is "what condition, or AND/OR combinations of conditions, need to be true for the light to be off?" In other words, "lights on" is "normal" and you look for the exceptional condition or cobmination of conditions to turn it off.



It might be easier to visualize, and build the program logic for, the latter approach than the former, in which case we could set an internal bit true for the "light off" case, otherwise set it false, and then have the light's discrete output be driven as the inverse of that internal bit.


All of the other ideas stated here apply equally to both the "what makes the light go/stay on" case and the "what makes the light go/stay off" case.
 
Last edited:
First of all think about the problem... So a signal triggers an input to the plc and as this could go off before the 30 seconds (think what you have to do, keep the output on ?).
Also if the signal is triggered again before the time up does it start to time for another 30 seconds?. I will say no more....
 

Similar Topics

Hello to all, I have one problem and hope you'll be able to help. I want to write simple ladder diagram program. I want to programm the...
Replies
10
Views
3,237
I am trying to convert this simple ladder diagram (for Omron Symatic 200) into Pascal, C or Basic. I want to use a PICmicro instead of PLC, but I...
Replies
3
Views
5,841
I have a program that does a 7 second "scan" sensor calibration routine whenever a setting (setting is called assistance level or "AL" and ranges...
Replies
3
Views
201
Hi all, I have a simple question that I have overcomplicated and gotten stuck on. I have a variable, we can call it "light" that I need to stay...
Replies
4
Views
292
I want simple logic for elevator . m going to use four pushbuttons for four levels and four proximity sensors . that's all. m trying this in ab...
Replies
7
Views
2,457
Back
Top Bottom