PROGRAM Scaling
(* INPUT 0 *)
input0_inst(ANY_TO_REAL(_IO_P1_AI_00), input0_cfg, input0_cmd);
input0 := input0_inst.status;
IF input0_cmd.cmdDeleteCalPoint AND input0.deleteSuccess THEN
	input0_cmd.cmdDeleteCalPoint := FALSE;
END_IF;

IF input0_cmd.cmdInsertCalPoint AND input0.insertSuccess THEN
	input0_cmd.cmdInsertCalPoint := FALSE;
END_IF;

(* INPUT 1 *)
input1_inst(ANY_TO_REAL(_IO_P1_AI_01), input1_cfg, input1_cmd);
input1 := input1_inst.status;
IF input1_cmd.cmdDeleteCalPoint AND input1.deleteSuccess THEN
	input1_cmd.cmdDeleteCalPoint := FALSE;
END_IF;

IF input1_cmd.cmdInsertCalPoint AND input1.insertSuccess THEN
	input1_cmd.cmdInsertCalPoint := FALSE;
END_IF;

(* INPUT 2 *)
input2_inst(ANY_TO_REAL(_IO_P1_AI_02), input2_cfg, input2_cmd);
input2 := input2_inst.status;
IF input2_cmd.cmdDeleteCalPoint AND input2.deleteSuccess THEN
	input2_cmd.cmdDeleteCalPoint := FALSE;
END_IF;

IF input2_cmd.cmdInsertCalPoint AND input2.insertSuccess THEN
	input2_cmd.cmdInsertCalPoint := FALSE;
END_IF;

(* INPUT 3 *)
input3_inst(ANY_TO_REAL(_IO_P1_AI_03), input3_cfg, input3_cmd);
input3 := input3_inst.status;
IF input3_cmd.cmdDeleteCalPoint AND input3.deleteSuccess THEN
	input3_cmd.cmdDeleteCalPoint := FALSE;
END_IF;

IF input3_cmd.cmdInsertCalPoint AND input3.insertSuccess THEN
	input3_cmd.cmdInsertCalPoint := FALSE;
END_IF;

(* INPUT 4 *)
input4_inst(ANY_TO_REAL(_IO_P2_AI_00), input4_cfg, input4_cmd);
input4 := input4_inst.status;
IF input4_cmd.cmdDeleteCalPoint AND input4.deleteSuccess THEN
	input4_cmd.cmdDeleteCalPoint := FALSE;
END_IF;

IF input4_cmd.cmdInsertCalPoint AND input4.insertSuccess THEN
	input4_cmd.cmdInsertCalPoint := FALSE;
END_IF;

(* INPUT 5 *)
input5_inst(ANY_TO_REAL(_IO_P2_AI_01), input5_cfg, input5_cmd);
input5 := input5_inst.status;
IF input5_cmd.cmdDeleteCalPoint AND input5.deleteSuccess THEN
	input5_cmd.cmdDeleteCalPoint := FALSE;
END_IF;

IF input5_cmd.cmdInsertCalPoint AND input5.insertSuccess THEN
	input5_cmd.cmdInsertCalPoint := FALSE;
END_IF;

(* INPUT 6 *)
input6_inst(ANY_TO_REAL(_IO_P2_AI_02), input6_cfg, input6_cmd);
input6 := input6_inst.status;
IF input6_cmd.cmdDeleteCalPoint AND input6.deleteSuccess THEN
	input6_cmd.cmdDeleteCalPoint := FALSE;
END_IF;

IF input6_cmd.cmdInsertCalPoint AND input6.insertSuccess THEN
	input6_cmd.cmdInsertCalPoint := FALSE;
END_IF;

(* INPUT 7 *)
input7_inst(ANY_TO_REAL(_IO_P2_AI_03), input7_cfg, input7_cmd);
input7 := input7_inst.status;
IF input7_cmd.cmdDeleteCalPoint AND input7.deleteSuccess THEN
	input7_cmd.cmdDeleteCalPoint := FALSE;
END_IF;

IF input7_cmd.cmdInsertCalPoint AND input7.insertSuccess THEN
	input7_cmd.cmdInsertCalPoint := FALSE;
END_IF;


pondVolumeTotal := 0.0;
pondVolumeTotal := input0.pondVolume +
	input1.pondVolume +
	input2.pondVolume +
	input3.pondVolume + 
	input4.pondVolume + 
	input5.pondVolume + 
	input6.pondVolume + 
	input7.pondVolume;
END_PROGRAM