(*level controllerI01 = ENIA1 = analog Input 4-20mAQ1 = open ValveQA1 = Level in mm *)// PT1 FilterFT01 ( EN := true, I1 := IA01,//analog Input 4-20mA TG := 30, KP := 100, CY => , QV => );//scale Var to mm Level //If the sensor works from top to bottom, swap the level values LS01 ( EN := true, I1 := FT01QV, X1 := 819, //4mA Y1 := 0,//0mm level X2 := 4095, //20mA Y2 := 3000,//3000mm level QV => QA1); //Leveloutput in mm//Level controller with fixed setpoints IF (LS01QV >= 2600)OR NOT I01 THEN //close valve, if higher than 2600mm Q01:= false;ELSIF (LS01QV < 2200) and I01 THEN //open valve, if lower than 22000mm Q01:= true;ELSE ;END_IF;