How you configure a "timer (TON)" to count till 72 hours.

Join Date
Sep 2013
Location
Pune
Posts
24
How can you configure a "timer (TON)" to count till 72 hours (i.e. 259200 seconds) in RSLogix500 ?

In my system, a TON timer needs to track time till 72 hours and its ".ACC" value is being used in another logic continuously. Everything looks good until 32767 seconds but then it can't be used any further.

somebody help.

Thanks,
 
On my projects I use a 1 hour timer, and when that timer is done count up a counter (to 72).

For your logic using the ACC value, a simple math logic will give the correct result.
 
I am making an assumption that you are using RSlogix500,
The timers are 16bit signed integers, therefore when 32767 is reached the acc goes negative and starts counting to -1, this is due to the 16th bit being the sign bit. So to answer your question the timers cannot be configured to count to your required value. you will have to use a combination of timers. ie timer 1 to count seconds, timer 2 to count minutes etc. to achieve your value and use a combination of their accumulators to activate your required output code.

Steve
 
You could just have the timer count up to 3600 seconds (=1 hr = hour counter), and trigger an hour counter CTU to count up. If the timer's execution condition includes NOT .DN, it will reset every hour. The counter can then trigger the actions/outputs, and itself be reset when necessary.
 
Yes, I'm using RSLogix500.

I thought about 1 hour timer and then a counter to count up till 72 but my other logic where I set an output requires output to be changed every second till last second of 72th hour.

Q= Cos(T54.acc * 0.00145)

so using hour timer will not help since I need time at "every second" till 72 hours.
 
The way you can do this is to use a floating point register which is 32 bit, use a timer to pulse an ADD block. ( XIC T4:1/DN OSR B3:0/0 ADD 1.0 F8:0 F8:0 ) This will count up to required value (Q=Cos(f8:0 * 0.00145)

Steve
 
Use a separate comparator of the real time clock to mark the 72 hour point. If real time clock is not available, then separately count the hours as suggested, but you should still be able to use your cosine function by either recreating the number of elapsed seconds as a float, or by using a separate repeating timer with a preset.

F8:54=T4:54.acc + 3600 * C5:54.acc 'Where C5:54 is hours counter t4:54 is seconds
Q=Cos(F8:54 * 0.00145)
 
The way you can do this is to use a floating point register which is 32 bit, use a timer to pulse an ADD block. ( XIC T4:1/DN OSR B3:0/0 ADD 1.0 F8:0 F8:0 ) This will count up to required value (Q=Cos(f8:0 * 0.00145)

Steve

So you mean the T4 timer will get .DN every second and will give pulse to OSR which in turn add "1" to floating point register which I can use in my output logic (Q).

Great!!! Thank you so much.:whistle:
 
The timers are 16bit signed integers, therefore when 32767 is reached the acc goes negative and starts counting to -1, this is due to the 16th bit being the sign bit.

Steve

FYI, that is true for a "Counter" instructions but not true for a "Timer" instructions. A timer will stop counting went it reaches its preset value.
You cannot have a negative preset value or a value greater then 32767 in a timer instruction.
 
Last edited:
Another option here is to use 32 bit long variables for your counter (if your CPU supports longs): use a 1 second timer to add 1 to the long counter once a second. This will give you 1 second resolution up to 68 years.

With the floating point variables you start to lose the 1 second resolution at some point (I think), but I'm just not smart enough to figure out when that happens :-(. So using the long is guaranteed to give you 1 second resolution for a ridiculously long time.

Of course the long variable will start counting negative after 68 years (the 32nd bit will get set) but you will have presumably set it back to zero before then!
 
The way you can do this is to use a floating point register which is 32 bit, use a timer to pulse an ADD block. ( XIC T4:1/DN OSR B3:0/0 ADD 1.0 F8:0 F8:0 ) This will count up to required value (Q=Cos(f8:0 * 0.00145)

Steve

Another option here is to use 32 bit long variables for your counter (if your CPU supports longs): use a 1 second timer to add 1 to the long counter once a second. This will give you 1 second resolution up to 68 years.

With the floating point variables you start to lose the 1 second resolution at some point (I think), but I'm just not smart enough to figure out when that happens :-(. So using the long is guaranteed to give you 1 second resolution for a ridiculously long time.

Of course the long variable will start counting negative after 68 years (the 32nd bit will get set) but you will have presumably set it back to zero before then!

Haha! I guess 68 years will be enough.
But, seriously, how do you use a "long variable counter" of 32 bits in RSLogix500 ?
 
Sorry. Too many assumptions on my part.

With an add block, just reference a long variable such as L9:0. Something like ADD with arguments L9:0, 1, L9:0. That will add 1 to a 32 bit long: do this once a second so you can go up to the 68 years
 
Last edited:
A float will not lose precision for the number of seconds in 72 hours. The loss begins somewhere in 7 digits I believe.
It would depend on the processor's floating point implementation. An IEEE 754 single precision register has 23 bits for the fraction (+ 1 bit sign and 8 bit exponent) and should stop adding 1.0 to a register at 8388608, I think.

I was going to play with an AD 250 processor, but it appears the one that Host has on the web has a program larger than 100 words in it at the moment, and I'm not at work (no access to anything but the free software.)
The Do-More simulator maxes out at 16,777,216 when adding 1.0 to a float register. Examining the help reveals that the Do-More implementation of the float uses 24 bits (+ 1 bit sign and 7 bit exponent).

Brian
 

Similar Topics

hi all i am new here i have a mitsubishi smart touch hmi i.e ms-60t-pe but i cannot find a software to edit and download a program in it any help...
Replies
3
Views
157
Hello, I am trying to connect a Stride Analog Output module to a 1769 CompactLogix via Ethernet. I added a new Generic Ethernet Module for the...
Replies
4
Views
234
Dear all, I am beginer in ifix hmi programming. I have 2 ifix 6.0 pc with license FiX and client.. Can some one tell me how to configure sample...
Replies
0
Views
146
Hi all, the machine I am programming the Rockwell PLC for has about 100 parameters that need to be adjusted for every customer. I would like to...
Replies
20
Views
1,960
Within the last week or so, PME has crashed whenever I try to open a configure IO screen. I am running V8.0 Build 6215. Offline configuration of...
Replies
3
Views
389
Back
Top Bottom