timer/counter

Prayder

Lifetime Supporting Member
Join Date
Jun 2014
Location
Arkansas
Posts
254
How would I use a timer/counter combination to count # of times I am waiting on a board per hour and what that average wait time would be?
 
Not sure what you mean by "waiting on a board" but I would firstly set up two timers as a 'flip flop' to go on/off every second (set each timer to 0.5s and have one turn the other off etc).

Then use that 1Hz pulse into a counter which will then be counting seconds.

I would then set up the "waiting on board" signal to go to another counter.

Use a comparator to check if the first counter is at 60 (i.e. 1 minute).

If it is then take the "waiting on board" count and do whatever maths you need to do (you mention 'average wait time' but not sure of the context of that) and load that into wherever you want to store it.

Then reset the two counters and off you go again....

Obviously you can change it from a minute to ten minutes etc as per your requirements.
 
In addition to uptown47's suggestions use an RTO to accumulate time while the wait condition exists. At the end of the hour, assuming at least one wait condition occurred, divide the RTO accumulator by the count to get the average wait in milliseconds. The reset the time as well as the other items.
 
Have a counter that counts up every time it waits for a board.
Have a Retentive timer that times whenever it is waiting.
Have a TON that resets itself every hour.
When the timer is done, move the counter.ACC value into a dint tag called WaitsLastHour.
Also move RetentiveTimer.ACC into a dint called WaitingTimeLastHour.
after moving the .ACC to WaitsLastHour, reset the counter.ACC to zero.
Now you have two options, simple and intermediate.
Simple:
Code:
Waits/hr = WaitsLastHour
If WaitsLastHour != 0 
  Average wait time in seconds = WaitingTimeLastHour / WaitsLastHour
Else
  Average wait time in seconds = 0
EndIf
Intermediate, will give you a more up to date reading:
Code:
Waits/hr = (WaitsLastHour + Counter.ACC) * 3600 / (3600 + Timer.Acc)
If WaitsLastHour + Counter.ACC != 0 
  Average wait time in seconds = (WaitingTimeLastHour + RetentiveTimer.ACC) / (WaitsLastHour + Counter.ACC)
Else
  Average wait time in seconds = 0
EndIf
 

Similar Topics

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,262
Hello everyone‚ Fairly new to PLC prog I seek your advise concerning what is said in my thread title; I program using workbench components; I...
Replies
1
Views
1,275
Hello all Logiix designer 5K Been looking around ( not in the right places ) haven't been able to locate an AOI or other instruction for a...
Replies
24
Views
5,456
can you help me with this one guys using fluid sim. This is for my bring home exam. providing a problem description, schematic...
Replies
5
Views
2,463
hi all, i have compact logic plz RS studio & factory talkview and a Universal frequency counter/Timer from Agilient (keysight). how can i...
Replies
0
Views
1,798
Back
Top Bottom