laneslabaugh
Member
All -
I am writing a control panel program in RSLogix500 f/u/w a MicroLogix 1100 PLC controller.
I have 8 exhaust port temps stored in integer files and need to calculate the average.
The only catch is, I need to throw out any values in the event the measurement device (thermocouple) fails. i.e. our temp scanner sends a value of 1759 C in the event of a failed thermocouple.
Anyone have any tricks/ideas on an efficient way to do this?
I know I could use the brute force method of testing each value then summing the good values and counting the number of good values and then dividing, but I'm trying to write efficient code. Seems like there's got to be a better way....
I am writing a control panel program in RSLogix500 f/u/w a MicroLogix 1100 PLC controller.
I have 8 exhaust port temps stored in integer files and need to calculate the average.
The only catch is, I need to throw out any values in the event the measurement device (thermocouple) fails. i.e. our temp scanner sends a value of 1759 C in the event of a failed thermocouple.
Anyone have any tricks/ideas on an efficient way to do this?
I know I could use the brute force method of testing each value then summing the good values and counting the number of good values and then dividing, but I'm trying to write efficient code. Seems like there's got to be a better way....