Peter,
"
Why not get data every scan instead of every other? " It does...assuming the data is updated from the analog card, otherwise the same value as rcv'd on last scan is added.. Let's not go there and confuse DaveMac with plc scan rate vs analog update times
"
What about overflow and the limit that place on the number of data points to be averaged? What if the analog inputs are 16 bit inputs? " Creating the tags as 'floaters' handles 16 bit pretty well, 'double ints' do too, and limit is covered by the # entered into the counter preset. I have never ran into an overflow so I can't answer that one
"
Why not make the AveragedValue valid every scan instead of 1 out of 10 scans? " I use that also for a rolling average and this could be used by minor mods to prevent clearing of counter, doing the average every scan once initial count has been reached, etc..
"
How can a FIFO be used to average data every scan? " It can be done but not worth effort in MHO. I try to stay with the K.I.S.S. method whenever possible!
"
Why not mulitply by .1 instead of divide by 10? Is it the same? Are you sure? " Since I can vary the value of the counter preset... I don't want to hard code the divide or make it a multiply
"
Just stirring the muddy waters. " Me too so please, carry on. If it gets muddy enough, you can actually appear to walk on it...... (at least to the customers
)
"
BTW David, I like the prefixes in front of the variable that indicate the data type " It's a standard that one of my customers used and it REALLY makes life easy. BTW, place a "g" in front of globals to make them stand out in a program. PM me and I will email you a copy of the naming convention...