QUOTE(Alan Wain @ Nov 24 2006, 08:09 PM) [snapback]44424[/snapback]
Does anyone have sample code showing how to add input filtering on Thermocouple inputs.
I have followed all the required hardware installation requirements and still get irratic readings.
I see fluctuations of 20-25F even with the inputs shorted which should show a stable ambient temperature.
The T/C module is in slot 1 of a 10 slot base with a 350 CPU.
I'm no guru for PLC Direct, but if shorted terminals fluctuate 20 F then you've got someting really flaky in your setup. Just mho.
As far as filtering the simplest filter on an analog input is to add a percentage of the new and 1 - percentage of the old to get the filtered reading. Math looks like follows:
Filtered Reading = (0.25 * New Reading) + (0.75 * Previous Filtered Reading)
You apply this logic after each new reading. The larger the percentage of new reading the less filtering.