FUNCTION FindNumberOfCalPoints
tempMax := 0;

IF linpPondNumber = 1 THEN
	FOR calIndex := 1 TO 10 DO
		IF pond1CalibrationHeight[calIndex] <> 0.0 THEN
			tempMax := calIndex;
		END_IF;
	END_FOR;
	FindNumberOfCalPoints := tempMax;

ELSIF linpPondNumber = 2 THEN
	FOR calIndex := 1 TO 10 DO
		IF pond2CalibrationHeight[calIndex] <> 0.0 THEN
			tempMax := calIndex;
		END_IF;
	END_FOR;
	FindNumberOfCalPoints := tempMax;

ELSIF linpPondNumber = 3 THEN
	FOR calIndex := 1 TO 10 DO
		IF pond3CalibrationHeight[calIndex] <> 0.0 THEN
			tempMax := calIndex;
		END_IF;
	END_FOR;
	FindNumberOfCalPoints := tempMax;

ELSIF linpPondNumber = 4 THEN
	FOR calIndex := 1 TO 10 DO
		IF pond4CalibrationHeight[calIndex] <> 0.0 THEN
			tempMax := calIndex;
		END_IF;
	END_FOR;
	FindNumberOfCalPoints := tempMax;
	
END_IF;
END_FUNCTION