timer as counter

Timing and counting are two different functions. If you need to time, you need a time base of some description. If you can create that in logic, and then count the events, well, then you have a timer using counters, but it is going way out of your way to accomplish something that is easier to do with a timer in the first place. There are some fixed rate toggling bits in the LogixPro S:2 file that might be used as some kind of timing base, so go for it and post your results.
 
BTWTo use a counter as a timer, you would need a time base. The S:4 bits might work. I made a counter and used S2:4/4 to increment the timer. But, in logixpro the status bits are not accurate as in a real AB processor. It would work for you if you're not needing a real accurate time. Hope this helps. BTW, where in Ma are you?
 
Thanks for the help guys. This was more of a challenge than an assignment by the prof. My gut instinct was that it is not feasible to make one accurate. This riddle was frustrating and taking time from my legitimate homework because I was obsessing. Adding to the misery was him saying specifically not to use the status bits. I'll find out in class this week, with any luck and give you the answer.
 
Actually, we do this all the time.

In some PLCs we need to use a counter because the timer retained value doesn't go high enough. An example is AutomationDirect.com, where 9999 = 999.9 second = 16 minutes. Another case is when we want to track run hours (Elapsed Time Meter).

In both cases the technique is fairly straightforward. We use a timer to time minutes or tenths of an hour or other appropriate base time. When the timer times out we use the done bit to trip the counter, and the done bit also resets the timer itself.

While it is true that this isn't absolutely positively accurate, since you may miss all or part of a scan, it usually doesn't matter. Scan time is usually a few mili-seconds. If I'm tracking a time period of many minutes or hours the effect of the error isn't significant to the process.
 
I agree with Tom.

I use some limit tests with the timers and counters to create a 7 day schedule or skip a day (or any way you want it) and in some cases sequence them for 3 operations in 3 weeks and repeat. That works good for hour meters for run time or counters for cycles for years. I have been told this is not accurate but I am not concered about split seconds like Tom is not either and I use a filter timer on the input with AB.

Leon
 
Your instructor probably had something like this in mind. You will need to adjust the Preset value of C5:0 to match the speed of your computer, so that it counts to the Preset value in exactly 1 second. Rung 4 is an Hour Counter, and Rung 5 resets all counters when I:1/0 is off.
Counter_As_Timer2.jpg
 
Last edited:
I see you are back, Jack. Did this LogixPro program work for you?
 
Last edited:
Thanks, Lancie. That seems to be just what the doctor ordered. Now if I can just tell him that I wrote it and keep a straight face, I'll get that attaboy...nah, that would be wrong. ;)
 
Why not try to come up with another method to detect the completion of one PLC scan? Then use the "scan completed" bit to trigger a counter.

After all, if you can't use timers or Status bits, that only leaves the scan cycle period as a possible counter trigger. The method is not in contention here. I know of only the one way in this situation. The only variables left are the details about how it is implemented. I am sure there are some other mehtods to detect one scan cycle.
 
Last edited:
I haven't used logix pro but if you have a periodic task (say set at 1 second) you can use your first counter with an unconditional rung (increments every second). Then cascade your counters as posted above.
 

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
5,982
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,221
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,355
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,444
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,783
Back
Top Bottom