Allen Nelson
Member
Rick Densing said:I am a little suprised no one here really knows the correct answer.(At least for AB) It is just something that I took for granted. Wondered about, the shook my head an went on to the next real problem.
I have wondered too, and it's certainly an advanced topic (the inner workings of a TON). And it is amusing that one of the most fundenmental principles of PLC programming (taught right after coils and contacts) can generate this much discussion, even by us "experts".
But it is a real problem (or at least has real application).
I brought it up because, last week, my boss and I were discussing indirect addressing of timers (via the technique I posted above), and not being please with the results. (I don't remember the specifics of why I wasn't pleased - just that I wasn't. He had a similar experience).
But if I know exactly how they work, perhaps I can devise code to make it do what I want.
Currently, the way I'm doing "indirect timers" is to use a 1 second pulse, and an ADD function:
IS TIMING TIMER IS
CONDITION TRUE ENABLED
N40:[N10:15]/0 T44:[N10:15]/EN
----------| |------------------( )-
TIMER IS
ENABLED
T44:[N10:15]/EN +---------- CLR ---+
---------|/|--------------| T44:[N10:15].ACC |
+------------------+
TIMER IS
ENABLED 1 SEC +---------- ADD ---+
T44:[N10:15]/EN PULSE | T44:[N10:15].ACC |
---------| |-----------| |-----| 1 |
| T44:[N10:15].ACC |
+------------------+
+----------- GEQ ---+ T44:[N10:15]/DN
----| T44:[N10:15].ACC |--------( )
| T44:[N10:15].PRE |
+-------------------+
T44:[N10:15]/EN T44:[N10:15].DN T44:[N10:15].TT
---------| |----------------|/|---------------( )
.
In this case, there really isn't any difference between timers and counters!
There's no TON, either, but that's OK - I "rolled my own".
Do I need to use Timer registers to do the above? No, but someone looking at the data tables labelled "Alarm Timers" and seeing the bits going on, the .ACCs increment, and so on, will certainly find it a lot easier to understand what's going on than if I just used integer registers.
Last edited: