Timer sequences

allan4169

Member
Join Date
Jul 2006
Location
Los Angeles
Posts
2
I need to write a little program that does the following.
I have five outputs where when output # 1 is true then the other four will be true for five minutes each rotating through untill output # 1 is no longer true. What I have is during a step in a program I have to switch between four solenoids that control sampling tubes. They need to keep rotating through #2, #3, #4, and #5 untill that step #1 no longer true. Any help would be most appreciated.
 
Without more information about your PLC we can't be of much help. Try converting the following to ladder - its generic enough that a beginning PLC programmer should be able to do it.



If output 1 is on then
Start timer 1
While timer 1 is timing, turn on output 2
When timer 1 times out
Start timer 2
While timer 2 is timing, turn on output 3
When timer 2 times out
Start timer 3
While timer 3 is timing, turn on output 4
When timer 3 times out
Start timer 4
While timer 4 is timing, turn on output 5
When timer 4 times out
Reset timers 1, 2, 3, and 4.

 
How about with 1 timer and 5 presets

Output 1 on
and Reset Timer off
--- Start Timer

Output 1 on
and Timer <= Time 1
--- Output 2 on

Timer > Time 4
--- Output 5 on

Output 5 off
and Timer > Time 3
--- Output 4 on

Output 5 off
and Output 4 off
and Timer > Time 2
--- Output 3 on

Timer > Time 5
--- Reset Timer
 
How about with 1 timer and 5 presets

Thats definitely one good way of doing it, however it depends a great deal on the PLC. Many low end bricks and picos do not have compare instructions, so I went with a more generic suggestion.

Hopefully Allan will help us out with the PLC brand/model.
 
Reconsider your question...

As long as Input-1 is ON... Run Timer.

For AB-type Timers... Current Time = 0-min (it works towards and beyond preset).
Expired Time = Timer Current Value
(AB-Timers count UP from 0 - they will over-run, what's the point?)

For TI-type Timers... Current Time = 20-min (it works towards 0).
Expired Time = Timer Preset Value - Timer Current Value
(TI-Timers count DOWN from Preset - they don't over-run, time-out is time-out!)

If Run Timer, AND (Expired Time >= 0) AND (Expired Time < 5-min), Output-2.
If Run Timer, AND (Expired Time >= 5) AND (Expired Time < 10-min), Output-3.
If Run Timer, AND (Expired Time >= 10) AND (Expired Time < 15-min), Output-4.
If Run Timer, AND (Expired Time >= 15) AND (Expired Time < 20-min), Output-5.

For AB-type Timers...
If Run Timer and Expired Time >= 20-min... Load Timer Current Value = 0-min.

For TI-type Timers...
If Run Timer and Expired Time >= 20-min... Load Timer Current Value = 20-min.

The Outputs will cycle, each on a 5-min basis, for as long as Input-1 is on.

If Input-1 is still on when the last Output is done, then the sequence begins again.

The question becomes... how do you stop the sequence.

When do you anticipate Input-1 going off?

If an Output happens to be on when Input-1 goes off... should that Output finish the 5-min-cycle? Or should it stop (go off) immediately?

Or... perhaps it is the case that you want the entire set to cycle whenever Input-1 goes on.

You need to better describe your problem.
 
Terry Woods said:
(AB-Timers count UP from 0 - they will over-run, what's the point?)

AB timers do not overrun. They stop accumulating time when the accumulator equals the preset. The only over-run possible is because the timer preset is reached at a point in the scan before the timer instruction is executed, then the overrun is limited to the length of the scan, something all PLCs must deal with.
 
Alaric...

Problems do NOT exist in terms of any particular PLC!

Solutions do NOT exist in terms of any PLC!

It is only the IMPLEMENTATION of the solution that is PLC-specific!

To say that you can not solve the problem without knowing the specific PLC is ridiculous!

GRANTED! Knowing the particular PLC can make it easier for YOU to develop a unique solution to the particular problem for the particular PLC.

HOWEVER... problems are UNIVERSAL!

A "problem" doesn't give-a-hang about what PLC you might be using!

A "problem" simply asks one to... SOLVE ME!

Any reasonable problem (that is, able to be reasoned out) can be solved with normal, everyday, reasonable logic!

At some point, the questioner has to rationalize any reasonably logical solution into a form that applies to his particular PLC.

New PLCs are being developed more often then not. They all have their own quirks and lackings.

We have no control, whatsoever, over what PLC someone might choose to use!

As such, the bottom-line is that common-logic rules ALL!

When a problem is posed, it is a question of logic... not brand!

Regarding AB-Timers and over-run...
Are you considering all of the AB models? Or maybe one, or two?

Are you, perhaps, looking at only the EN bit and not the current timer value?
 
Last edited:
Terry Woods said:
Alaric...

Problems do NOT exist in terms of any particular PLC!

Solutions do NOT exist in terms of any PLC!

It is only the IMPLEMENTATION of the solution that is PLC-specific!

To say that you can not solve the problem without knowing the specific PLC is ridiculous!

GRANTED! Knowing the particular PLC can make it easier for YOU to develop a unique solution to the particular problem for the particular PLC.

HOWEVER... problems are UNIVERSAL!
.
.
.
When a problem is posed, it is a question of logic... not brand!

Terry, I suggest you read my posts again.

Here, I'll help you out with emphasis:
Try converting the following to ladder - its generic enough


and

so I went with a more generic suggestion.
 
Do I need to emphaisize that as well? Its about the degree of help we can offer. There is no need for you to turn a simple request for help into a ****ing match.
 
All I am trying to do is solve logical-problems with logical solutions.

Logical solutions apply to ANY reasonable PLC.

You don't need to know the PLC brand or model to solve a general logic problem!

Certainly there are particular issues in how some PLCs handle logic... that is their problem. And that is a different issue.

But, in general, logical problems require no more, no less, than logical solutions!

Please, please... please don't be offended... this is an issue that has been driving me nuts for a hell of a lot longer than you have been on-site. This has been an issue from day-one on PLCS.net.

My point is, problems are solved by logic, not by brands.

Can you bite that bullet?
 
Last edited:
Terry Woods said:
All I am trying to do is solve logical-problems with logical solutions.

Logical solutions apply to ANY reasonable PLC.

You don't need to know the PLC brand or model to solve a general logic problem!

Certainly there are particular issues in how some PLCs handle logic... that is their problem. And that is a different issue.

But, in general, logical problems require no more, no less, than logical solutions!

Please, please... please don't be offended... this is an issue that has been driving me nuts for a hell of a lot longer than you have been on-site. This has been an issue from day-one on PLCS.net.

My point is, problems are solved by logic, not by brands.

Can you bite that bullet?

I get the point you're trying to drive home, but knowing what tool you have available is valuable as well. When all you've got is a hammer, everthing looks like nails. When you finally get a screw driver, why would you beat a screw into the board rather then simply turning it in?
 

Similar Topics

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
215
Question to anyone with ideas about my thoughts on upgrading a very vintage timer, which is being used to switch between 2 5hp domestic water...
Replies
14
Views
364
why my timer only executes once here? After first time i use it, ET stays at 0ms all the time. It is in FB
Replies
5
Views
288
Good morning guys, I'm searching for a Timer relay which accomplishes the "flasher" condition in the photo attached, however, I need the ability...
Replies
2
Views
532
Hello all, I am trying to improve my skills, so I decided instead of moving a value into every single .PRE of an array of timers, I thought I...
Replies
6
Views
314
Back
Top Bottom