PLC Ladder Logic

aalberto

Member
Join Date
Oct 2009
Location
Atlanta
Posts
8
I need help on writing a ladder program to recognize a first scan on power on to start a timer:

I am using VersaPro to write the ladder program and this is what i need to accomplish:

During the first 30 seconds after power-on, flash the light on for 1 second and off for 0.5 seconds repeatedly. After 30 seconds, have the light go steady on for 10 seconds and then go off. If switch is cycled on then off, the program should restart as if a first scan.

Please help me as I am so confuse on ladder logic programing...
I understand the problem but i dont understand how to translate it to ladder logic program.

Thanks in advance
 
I'm not familiar with your processor as you never mentioned what processor your using however look for a first cycle input instruction.
 
Since you mentioned Versa Pro software you must be using a GE Fanuc PLC. The PLC has internal bits that will be useful. The first scan bit in GE Fanuc PLCs is %S001, named "FST_SCN". It is true during the first scan of the program following the transition from stopped to running.

There is another internal bit that turns on and off at exactly the frequency your instructor wants. You can find it in the variable declarations table. I'll leave it up to you find it. Its name is "T_SEC".

Use the FST_SCN bit to turn on an internal bit. You'll need to keep that bit turned on following the first scan. Use the internal to start a timer with a preset of 30 seconds. That would be 300 tenths of a second or 3000 hundredths of a second. While that timer is enabled, but not yet completed, use the T_SEC contact to flash your lamp on and off. Use the timer's completed state to enable a second timer with a preset of 10 seconds. While the first timer is done, but before the second timer is done, turn the lamp on continuously, and then turn it off when the second timer is complete.

That's as much as I'm willing to offer until you show us an example of what you've done.
 
yes it is a GE Fanuc Series 90-30. I kinda understand what the problem is asking but i guess im just lacking the basics of PLC. I will post what i have once i take a screen shot.
 
After messing with it for a bit, I know that Up counter is needed for the 30 sec. I need help on understanding the counter:

LadderLogic.jpg
 
Forget about counters for the time being. This lab is about timers.

I see you located the first scan bit, %S001. That's good. Do you understand the concept of the PLC's scan mechanism? Once you get familiar with that, you'll understand why you need to have that %S001 contact turn on an internal contact which will be used to enable a timer. For this lab, the only timer you'll need is the TMR instruction, but you'll have to choose whether you want to use tenths of a second, hundredths of a second, or thousandths of a second as your time base.
 
Ok I think im getting the hang of this! I've been able to make the light flash on for 1 sec and off for 0.5 sec. Now Im stuck, I dont know how to make it do that for only 30 secs and after 30, steady for 10 then off: (i circled where its flashing)

LadderLogic-1.jpg


Any Hints would help. Also can i accomplish this in one 'system' rather than have 3 like i just did?
 
OK, several points:

First, you have provided no way to turn %M00001 off. In so doing, you have made it the equivalent of the built-in %S0007 variable.

Second, your rungs 2 and three have duplicated the operation of the T_SEC variable I referred to in my earlier post. Not that there's anything wrong with that. In fact, your rungs give you the ability to modify the on and off times by varying the presets of the two timers.

Third, the way you set up the enable and reset nodes of your ONDTR timer on rung 3 makes it work the same as the TMR instruction. Once again, there's nothing wrong with that, but you should experiment with the TMR instruction to understand the difference.

Finally, at this stage of your learning, don't worry about trying to combine things into a single rung. Nobody gives out prizes for programming ladder logic in the fewest number of rungs, and the effort to do so can often lead to logic that's hard to debug. If you have to make a choice between less memory usage and greater clarity, choose clarity. The people who have to live with your logic will thank you. In fact, you'll thank you when you look at the logic six months from now.
 
ok so ive been messing with it for the past few days and i think im close to it. I just dont have the access to the program right now to try it.

The only problem i have now is:

when i stop the program, the timers does not reset. Is there something that i have do/add so that when i stop it and restart it, the timer starts from zero again?
 
Try substituting regular on-delay timers (TMR) instead of your retentive on-delay timers (ONDTR). TMRs automatically reset to zero when the input turns off.

Notice that a TMR instruction has no 'reset' input... o_O

🍻

-Eric
 

Similar Topics

I have a machine which is undergoing upgradation. As part of the process two SEW drives are being replaced., existing Gen B with new Gen C. The...
Replies
3
Views
181
Hey guys, I am trying to pull the ladder logic out of some ancient Honeywell S9000 PLCs, but I can't find the software anywhere (google search...
Replies
10
Views
4,877
I need to know how to take a schematic like this and solve it for let’s say a run time of 5 seconds By solve I mean determine which rungs are...
Replies
33
Views
9,099
Thanks ahead for any insight or assistance... I am a machine designer of 25+ Years in a relatively new "one man band" position, I've never had...
Replies
130
Views
156,406
Disclaimer, I do not know much about PLC’s, and am completely stuck on how to proceed, so any help is appreciated! I have an Allen Bradley...
Replies
15
Views
7,313
Back
Top Bottom