FUNCTION_BLOCK Input
active := rawValue >= 9830.0; (* 9830.0 raw = 3.0 mA *)


scaledValue := LinearScale(
	scalingConfig.rawMin,
	scalingConfig.rawMax,
	scalingConfig.euMin,
	scalingConfig.euMax,
	rawValue
);

IF isPondLevel THEN
	scaledValue := scaledValue + pondOffset;
	GetPondCalibrationParameters_1(scaledValue, calibrationLevel, calibrationVolume);

	IF GetPondCalibrationParameters_1.success THEN
		pondVolume := LinearScale(
			GetPondCalibrationParameters_1.lowLevelScalingParam, 
			GetPondCalibrationParameters_1.highLevelScalingParam, 
			GetPondCalibrationParameters_1.lowVolumeScalingParam,
			GetPondCalibrationParameters_1.highVolumeScalingParam,
			scaledValue
		);
	END_IF;
	
	IF cmdInsertCalPoint THEN 
	insertInstruction(inpCalLevel, inpCalVolume, calibrationLevel, calibrationVolume);
		IF insertInstruction.success THEN
			cmdInsertCalPoint := FALSE;
		END_IF;
	END_IF;

	IF cmdDeleteCalPoint THEN
		deleteInstruction(inpDeleteIndex, calibrationLevel, calibrationVolume);
		IF deleteInstruction.success THEN
			cmdDeleteCalPoint := FALSE;
		END_IF;
	END_IF;

ELSE
	pondVolume := 0.0;
END_IF;


	

END_FUNCTION_BLOCK