SLC 500 totalizer

Marc

Member
Join Date
Jun 2004
Location
Nashua, NH
Posts
430
Hi guys,

I have an issue with a totalizer (flow GPM) that I created for a customer.

Analog input 4-20ma scaled to 0-200 n15:0

Timer 1 sec dn bit moves n15:0 to f8:0 and adds f8:0 to f8:1 result to f8:1.

F8:1 dislays on a wonderware screen as the last 6 digits of a 2 part combination display (a counter is the first part of the totalizer display to count millions of gallons).

The wonderware display stops at 262144 as well as in the SLC5/04 os 401 series c frn 8. Rslogix500 6.00 winxp. Wonderware 6.0b sp2 nt 4.0 sp4

If I change f8:1 to 262100 it will totalize to 262144 and freeze.

Any ideas?

Marc
 
Oooops

Sorry about the mistake, t.dn divides n15:0 by 60 and moves it to f8:0 then adds f8:0 to f8:1 result f8:1

The problem still remains the lockup at 262144

Marc
 
I don't think we are getting the whole story.

262144 is 4 times 65536 or 2^16. You have a round off error caused by trying to add small numbers to a big number.

I saw you just corrected the story. N15:0/60 probably makes F?:0 pretty smallSee! What did I tell you?

(1/60)*(2^24)=279620 which gets limited to 262144. I am busy now, I will let others be a hero and tell you how to fix it.
 
Last edited:
Peter is right - you have a round off problem. At the 262144 threshold, you will have problems if your scaled totalizer value is below 3.
 
Thanks Peter

Hate to waste your time, but what affect does adding small numbers to a large number have and should I update my timer to every 5 or 10 seconds to make the small numbers larger?

Marc

PS it did work well with bogus large numbers I used back in the shop to make the totalizer crash when the number got (very) large.
 
Marc,

You are running out of significant digits. The float point stores up to 24 bits in the mantissa - see this post. Changing the timer will help for a while, but you will find yourself in the same boat at some point.

You might want change where you cascade your accumulator to be 100,000 gallons instead of one million (then change your WW display accordingly).
 
Last edited:
Thanks

Marc and Peter,

Thanks,

I will try your suggestions out tomorrow AM and post back.

Your time is greatly appreciated.

Marc
 
Thanks Again

Problem solved,

When I increased the value that was being added to the totalizer on each sample, it rolled right past 262144 in the floating point address.

I probably would have found this to be the case when I started dabbling with the problem but you guys gave me the reason it was happening which is the true way to fix a problem.

Greatly appreciated.

Marc
 

Similar Topics

I have a SLC5/03 that is using a HSCE2 High Speed Counter module. I have 3 pulse flowmeters hooked to the module. I need to totalize each flow...
Replies
2
Views
4,868
I have a program that I've used 100 times. SQO settings: File N7:0, Mask 0FFFFh, Dest B3:1, Control R6:0, Length 8, Pos 2. Length & Position...
Replies
48
Views
943
Everyone, i am in the process of purchasing the Slc 500 version of software to support what we have and i have a question. Several of our...
Replies
9
Views
751
In a slc 500 plc I am trying to move data with out using a lot of moves. I want to move data from n7:1 to n7:2 and data that was in n7:2 to n7:3...
Replies
16
Views
1,348
Customer has a circa 2004 SLC-500 PLC. Fieldbus is a 1747-SDN DeviceNet scanner. Customer has SLC-500 file (.rss) with no comments. Has no *.dnt...
Replies
7
Views
548
Back
Top Bottom