DLO6 - Timer Woes

DL06

Member
Join Date
Feb 2006
Location
Canada
Posts
87
I need some help on a problem I am having. We have set up a PLC to track some production metrics on a piece of machinery (total time, run time, uptime %, target counts, actual counts, plus/minus).

The target count increments every 10.29 seconds and the actual increments based on a photoelectric sensor. The intent is to maintain a proper takt time for our production.

I let it run for a day...

-Target counts was 3236 (meaning that the actual total time was (3236*10.29)/60 = approx 9.25 hours). This is dead on.
-Actual counts was 3832. Once again, this was accurate.
-Plus/minus was 596. Once again, all good.

However, I had the following timer values showing on the screen:

-Total Time was 42925 (this is off a TMRA so it equates to 4292.5 seconds which is only a little over an hour). This value should in fact match the target counts multiplied by 10.29 then multiplied by 10 = 332984.

-Run time was 11062 (or 1106.2 seconds). Once again, this is way too low since the machine could have never produced 3832 parts in this amount of time. It simply is not possible.

-Uptime percentage is shown as 25.77053% which is correct mathematically, but based on two incorrect timer values.

I understand that the TMRA function requires two register locations, so I have spaced out all of my timers by two (T0, T2, T4, etc.). However, it seems like my timer accumulators are getting truncated, misformatted, wrapping around to zero, or something else.

Can someone please look at my program (see attached) and tell me what is going on? I will be hooking up to it with the computer tomorrow to do some more detective work.

Thanks in advance.
 
A. Learn how to comment the Rung for what you are intending to do with it. Crtl + k will get you there with DirectSoft.
B. I'll look it over, but the comments would really help.
On the surface, I don't see anything glaringly wrong with it.
 
One of the most hateful things about DL is that they use BCD rather than decimal values.

I find that to be an incredible short-fall in any PLC.

WE ARE DL! SO SPEAK BCD OR DIE!

Sounds pretty short-sighted... do ya think?


Of course, that doesn't help you...

You'll just have to read the manual and learn how DL does math-type stuff.

Having done so, you will be glad you did!
 
Last edited:
Best guess as to why the Timer values and the counts are off, the PLC lost power at some point. The default retentive memory range of the PLC is V400 – V37777. You are storing your Target and Actual counts in V400 and V402 which is in the default retentive memory range. The current value of Total Timer and Run Timer are stored in V0 and V2, which are not in the retentive memory range.

The follow things are not causing your problem, but would make your program easier to read.

You don’t need rung 4, you can make the T4 timer reset itself by placing a T4 normally closed contact in rung 3. By making T4 reset itself you can omit rung 6 and use T4 instead of C0 in rung 7.

In rung 9, are you meaning to add (2) to the Sheet Count?

In rung 14 you are using T10 to perform your updates. Are you meaning to perform the update every 2 seconds or 0.2 seconds? You have it set for 0.2 seconds. Second you should place a Normally Closed T10 in rung 14 to have T10 reset itself, it makes it easier to read instead of trying to find if/how T10 is reset.
 
Thanks for the help guys.

To answer your questions...

Tom - Yes, I am aware of this limitation. However, I am not having a problem with my counting or math functions. The timers are for some reason resetting. The manual states that the TMRA can go up to 9999999.9 which is more than enough time for my application since it will be reset at least every 12 hours.

CroCop - Sorry, I thought I put labels into the program, but it must have been my last version (I started again from scratch to clean things up). I would not have posted it if I had realized the labels were missing.

Terry - I have read the manual (and yes, you are correct, I am glad that I did since it has been really helpful in learning the software). However, everything appears to be right. The timer just resets for some reason.

Tark - I think you are onto something. The timer reset seems random (as far as I can tell without sitting there watching it all day). Perhaps it did lose power. Is it a common/acceptable practice to have an extra line that transfers TA0 to V500 and TA1 to V501, then tag the LCD off of the retentive memory locations? Also, yes I am aware that the update is 0.2 sec and yes the sheet count is incremented by two intentionally.

To all - Thank you for your advice. I am sorry that the file did not have comments, I thought they were in there at the time I posted.
 
Last edited:
Can I solve this problem by simply using retentive ranges on the timers? (PLC--->Setup--->Retentive Ranges)
 
To test the power loss theory, I would just change the retentive memory range to V0 – V37777. This will add all the timer current values to the retentive memory range. If this proves to fix the problem, I would then determine what is the best way to remedy the problem. It’s also good practice to make a note in the program documentation if you change he default retentive memory range.

Changing the retentive memory range to include all the timer current values might not be the best finial solution, but it’s a quick way to determine if the power loss is the problem.

 
Another little tidbit for AD PLC's:Make it a firm habit to only use ODD ( or EVEN) numbered timers and counters, don't mix them up. AD uses two timers worth of space in some cases...it will realy screw you up....
David
 
That is a good tip. After realizing that certain timers needed two spaces I started doing exactly what you have suggested. :cool:
 
Just another bit of information, the Up/Down Counter (UDC) also requires two consecutive memory locations.

Andy
 
"Another little tidbit for AD PLC's:Make it a firm habit to only use ODD ( or EVEN) numbered timers and counters, don't mix them up. AD uses two timers worth of space in some cases...it will realy screw you up...."

Good God... idiotcy!
 
I'm not sure that I understand the purpose, meaning, or motivation behind that comment Terry.

Perhaps it is my 'idiotcy' (if that were a word...).
 
My last comment referred to the idiocy of any PLC design that might require a programmer to be careful of the possiblity of overlaying portions of one timer upon another... because, any given timer might, or might not, use two words.

This implies that timer-space is created when a particulat timer is compiled in the program. And, that the particular timer might consist of one or two words. Which further implies that perhaps timer-space is compacted...

Not
Compacted Compacted
T-1(a) T-1(a)
T-1(b) T-2(a)
T-2(a) T-2(b)
T-2(b) T-3(a)
T-3(a) T-4(a)
T-3(b) T-4(b)



(a) = Word-a, (b) = Word-b

The compacted version also implies that timers might not exist in memory in order.
T-1(a), T-3(a,b), T-5(a), T-10(a), T-2(a,b)...

I find that very hard to believe. But, if it is true, then it is idiocy!

However, whether the compacted version is true or not, if you are having timer problems...
...I find it very hard to believe that using only the Even, or only the Odd, Timer/Counters will save you from grief.

It simply doesn't make sense to use only even, or only odd, since you automatically cut the number of available timers in half! How could any PLC Manufacturer get away with that?

If it appears to you that using only the even ones, or only the odd ones, eliminates timer problems... that indicates to me that the care and feeding of timers is simply not properly understood.
 
Terry,

The problem is not that an AD programmer doesn't know which timers use two words. The manuals plainly state which ones do, and it is always the same instructions that do. Rather the problem is human: people forget.
 

Similar Topics

Hello everyone, I am new to your forum but I did buy the learning book afew years back. I need to do some programming and need advice on what is...
Replies
18
Views
3,904
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
291
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
429
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
300
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
551
Back
Top Bottom