I did some searching on totalizing in a PLC versus getting a total from a device, and found a few links, but figured I'd start a new thread specifically on that topic to dig a bit deeper.
My main question is which is recommended and why? Which is more accurate and why?
From the searching I did, it seems like the recommendation is to use the value out of the instrument if possible. But I'm curious why that is?
One issue with doing it in the PLC that I can see would be rounding errors accumulating while doing the totalizing math, but I would figure with modern PLC's and floating point calcs, those should be minimal. Also, wouldn't a transmitter have the same issues? I figure most of those are digital internally these days as well, and I can't imagine they're doing 64 bit math in there or using special float representations internally, but maybe I'm wrong.
I did do some experimenting with Logix5000 on an emulator and got some strange results when using the TOT FBD instruction. It seems to consistently overshoot by a small amount (~0.1) and the amount doesn't seem to change much even if I change the incoming rate, scan times of the totalizer, length of totalizing time, etc. I'm curious if anyone can see what's going on in the code to produce that offset.
I've attached my simple Logix program if anyone wants to run it themselves and see what I'm seeing.
Thanks,
Greg
My main question is which is recommended and why? Which is more accurate and why?
From the searching I did, it seems like the recommendation is to use the value out of the instrument if possible. But I'm curious why that is?
One issue with doing it in the PLC that I can see would be rounding errors accumulating while doing the totalizing math, but I would figure with modern PLC's and floating point calcs, those should be minimal. Also, wouldn't a transmitter have the same issues? I figure most of those are digital internally these days as well, and I can't imagine they're doing 64 bit math in there or using special float representations internally, but maybe I'm wrong.
I did do some experimenting with Logix5000 on an emulator and got some strange results when using the TOT FBD instruction. It seems to consistently overshoot by a small amount (~0.1) and the amount doesn't seem to change much even if I change the incoming rate, scan times of the totalizer, length of totalizing time, etc. I'm curious if anyone can see what's going on in the code to produce that offset.
I've attached my simple Logix program if anyone wants to run it themselves and see what I'm seeing.
Thanks,
Greg