PROGRAM E300Data

(* Reading Energy Data from the E300 *)
E300_ReadEnergy(TRUE, E300_IP_ADDRESS, E300_SCAN_RATE);
E300 := E300_ReadEnergy.EEObjAttributes;
Energy_INT_Array := E300_ReadEnergy.EnergyINTArray;
Metering_REAL_Array := E300_ReadEnergy.MeteringREALArray;

(* Metering Mapping *)
IF E300_ReadEnergy.MSGObjRead.Q THEN
	E300_LineFrequency 				:= E300.LineFrequency;
	E300_L1Current 					:= E300.L1Current;
	E300_L2Current 					:= E300.L2Current;
	E300_L3Current 					:= E300.L3Current;
	E300_AverageCurrent 			:= E300.AverageCurrent;
	E300_PercentCurrentUnbalance 	:= E300.PercentCurrentUnbalance;
	E300_L1NVoltage 				:= E300.L1NVoltage;
	E300_L2NVoltage 				:= E300.L2NVoltage;
	E300_L3NVoltage 				:= E300.L3NVoltage;
	E300_AverageLNVoltage 			:= E300.AverageLNVoltage;
	E300_L1L2Voltage 				:= E300.L1L2Voltage;
	E300_L2L3Voltage 				:= E300.L2L3Voltage;
	E300_L3L1Voltage 				:= E300.L3L1Voltage;
	E300_AverageLLVoltage 			:= E300.AverageLLVoltage;
	E300_PercentVoltageUnbalance 	:= E300.PercentVoltageUnbalance;
	E300_L1RealPower 				:= E300.L1RealPower;
	E300_L2RealPower 				:= E300.L2RealPower;
	E300_L3RealPower 				:= E300.L3RealPower;
	E300_TotalRealPower 			:= E300.TotalRealPower;
	E300_L1ReactivePower 			:= E300.L1ReactivePower;
	E300_L2ReactivePower 			:= E300.L2ReactivePower;
	E300_L3ReactivePower 			:= E300.L3ReactivePower;
	E300_TotalReactivePower 		:= E300.TotalReactivePower;
	E300_L1ApparentPower 			:= E300.L1ApparentPower;
	E300_L2ApparentPower 			:= E300.L2ApparentPower;
	E300_L3ApparentPower 			:= E300.L3ApparentPower;
	E300_TotalApparentPower 		:= E300.TotalApparentPower;
	E300_L1TruePowerFactor 			:= E300.L1TruePowerFactor;
	E300_L2TruePowerFactor 			:= E300.L2TruePowerFactor;
	E300_L3TruePowerFactor 			:= E300.L3TruePowerFactor;
	E300_ThreePhaseTruePowerFactor 	:= E300.ThreePhaseTruePowerFactor;
END_IF;



(* Setting Output Value in the E300 *)
E300_OUTPUT(E300_Output_Enable, E300_IP_ADDRESS, E300_OUTPUT_NUMBER, E300_OUTPUT_CMD_VALUE);
E300_SELECTED_OUTPUT := E300_OUTPUT.OutputName;
E300_OUTPUT_SET_CORRECTLY := E300_OUTPUT.SettingApplied;

(* Read Digital Input 0 *)
E300_Read_DigitalInput0(TRUE, E300_IP_ADDRESS, E300_SCAN_RATE, 0, Enable_IO_Read);
DigitalInput_Status_0 := E300_Read_DigitalInput0.IOStatus;

(* Read Digital Input 1 *)
E300_Read_DigitalInput1(TRUE, E300_IP_ADDRESS, E300_SCAN_RATE, 1, Enable_IO_Read);
DigitalInput_Status_1 := E300_Read_DigitalInput1.IOStatus;

(* Read Digital Input 2 *)
E300_Read_DigitalInput2(TRUE, E300_IP_ADDRESS, E300_SCAN_RATE, 2, Enable_IO_Read);
DigitalInput_Status_2 := E300_Read_DigitalInput2.IOStatus;

(* Read Digital Input 3 *)
E300_Read_DigitalInput3(TRUE, E300_IP_ADDRESS, E300_SCAN_RATE, 3, Enable_IO_Read);
DigitalInput_Status_3 := E300_Read_DigitalInput3.IOStatus;

(* Read Digital Input 4 *)
E300_Read_DigitalInput4(TRUE, E300_IP_ADDRESS, E300_SCAN_RATE, 4, Enable_IO_Read);
DigitalInput_Status_4 := E300_Read_DigitalInput4.IOStatus;

(* Read Digital Input 5 *)
E300_Read_DigitalInput5(TRUE, E300_IP_ADDRESS, E300_SCAN_RATE, 5, Enable_IO_Read);
DigitalInput_Status_5 := E300_Read_DigitalInput5.IOStatus;

IF E300_ReadEnergy.MSGObjRead.Q THEN
	VoltageOK := E300.L1L2Voltage > cfg_V_UndervoltageTripLevel AND 
		E300.L1L2Voltage < cfg_V_OvervoltageTripLevel AND
		E300.L2L3Voltage > cfg_V_UndervoltageTripLevel AND 
		E300.L2L3Voltage < cfg_V_OvervoltageTripLevel AND
		E300.L3l1Voltage > cfg_V_UndervoltageTripLevel AND 
		E300.L3L1Voltage < cfg_V_OvervoltageTripLevel;
END_IF;
	

(* Trip Status *)
(* 	Bit0= OverloadTrip 
	Bit1= PhaseLossTrip 
	Bit2= GroundFaultTrip 
	Bit3= StallTrip
	Bit4= JamTrip
	Bit5= UnderloadTrip 
	Bit6= CurrentImbalTrip 
	Bit7= L1UnderCurrTrip 
	Bit8= L2UnderCurrTrip 
	Bit9= L3UnderCurrTrip 
	Bit10= L1OverCurrenTrip 
	Bit11= L2OverCurrenTrip 
	Bit12= L3OverCurrenTrip 
	Bit13= L1LineLossTrip 
	Bit14= L2LineLossTrip 
	Bit15= L3LineLossTrip *)
IF NOT Test_Mode THEN
	E300_TripStatusCurrent(TRUE, E300_IP_ADDRESS, E300_SCAN_RATE, TRUE, 4);
	S2I_TripStatusCurrent(E300_TripStatusCurrent.Output[1], E300_TripStatusCurrent.Output[2]);
	TripStatusCurrent_INT := S2I_TripStatusCurrent.INT_OUT;
END_IF;
IF TripStatusCurrent_INT.0 THEN
	TripStatusCurrent := 'Overload';
	OverloadTrip := TRUE;
ELSIF TripStatusCurrent_INT.1 THEN
	TripStatusCurrent := 'Phase Loss';
ELSIF TripStatusCurrent_INT.2 THEN	
	TripStatusCurrent := 'Ground Fault';
ELSIF TripStatusCurrent_INT.3 THEN
	TripStatusCurrent := 'Stall';
ELSIF TripStatusCurrent_INT.4 THEN
	TripStatusCurrent := 'Jam';
ELSIF TripStatusCurrent_INT.5 THEN
	TripStatusCurrent := 'Underload';
ELSIF TripStatusCurrent_INT.6 THEN
	TripStatusCurrent := 'Current Imbalance';
ELSIF TripStatusCurrent_INT.7 THEN
	TripStatusCurrent := 'L1 Undercurrent';
ELSIF TripStatusCurrent_INT.8 THEN
	TripStatusCurrent := 'L2 Undercurrent';
ELSIF TripStatusCurrent_INT.9 THEN
	TripStatusCurrent := 'L3 Undercurrent';
ELSIF TripStatusCurrent_INT.10 THEN
	TripStatusCurrent := 'L1 Overcurrent';
ELSIF TripStatusCurrent_INT.11 THEN
	TripStatusCurrent := 'L2 Overcurrent';
ELSIF TripStatusCurrent_INT.12 THEN
	TripStatusCurrent := 'L3 Overcurrent';
ELSIF TripStatusCurrent_INT.13 THEN
	TripStatusCurrent := 'L1 Line Loss';
ELSIF TripStatusCurrent_INT.14 THEN
	TripStatusCurrent := 'L2 Line Loss';
ELSIF TripStatusCurrent_INT.15 THEN
	TripStatusCurrent := 'L3 Line Loss';
ELSE
	TripStatusCurrent := 'None';
END_IF;

IF NOT TripStatusCurrent_INT.0 THEN
	OverloadTrip := FALSE;
END_IF;

E300_TripStatusVoltage(TRUE, E300_IP_ADDRESS, E300_SCAN_RATE, TRUE, 5);
S2I_TripStatusVoltage(E300_TripStatusVoltage.Output[1],E300_TripStatusVoltage.Output[2]);
TripStatusVoltage_INT := S2I_TripStatusVoltage.INT_OUT;
(* 	Bit0= UnderVoltageTrip 
	Bit1= OvervoltageTrip 
	Bit2= VoltageUnbalTrip 
	Bit3= PhaseRotationTrp 
	Bit4= UnderFreqTrip 
	Bit5= OverFreqTrip
*)
IF TripStatusVoltage_INT.0 THEN
	TripStatusVoltage := 'Undervoltage';
ELSIF TripStatusVoltage_INT.1 THEN
	TripStatusVoltage := 'Overvoltage';
ELSIF TripStatusVoltage_INT.2 THEN	
	TripStatusVoltage := 'Voltage Unbalance';
ELSIF TripStatusVoltage_INT.3 THEN
	TripStatusVoltage := 'Phase Rotation';
ELSIF TripStatusVoltage_INT.4 THEN
	TripStatusVoltage := 'Underfrequency';
ELSIF TripStatusVoltage_INT.5 THEN
	TripStatusVoltage := 'Overfrequency';
ELSE
	TripStatusVoltage := 'None';
END_IF;

E300_TripStatusPower(TRUE, E300_IP_ADDRESS, E300_SCAN_RATE, TRUE, 6);
S2I_TripStatusPower(E300_TripStatusPower.Output[1], E300_TripStatusPower.Output[2]);
TripStatusPower_INT := S2I_TripStatusPower.INT_OUT;
(* 
	Bit0= UnderKWTrip 
	Bit1= OverKWTrip
	Bit2= UnderKVARConTrip 
	Bit3= OverKVARConTrip 
	Bit4= UnderKVARGenTrip 
	Bit5= OverKVARGenTrip 
	Bit6= UnderKVATrip 
	Bit7= OverKVATrip
	Bit8= UnderPFLagTrip 
	Bit9= OverPFLagTrip 
	Bit10= UnderPFLeadTrip 
	Bit11= OverPFLeadTrip
*)
IF TripStatusPower_INT.0 THEN
	TripStatusPower := 'Under kW';
ELSIF TripStatusPower_INT.1 THEN
	TripStatusPower := 'Over kW';
ELSIF TripStatusPower_INT.2 THEN	
	TripStatusPower := 'Under kVAR Consumed';
ELSIF TripStatusPower_INT.3 THEN
	TripStatusPower := 'Over kVAR Consumed';
ELSIF TripStatusPower_INT.4 THEN
	TripStatusPower := 'Under kVAR Generated';
ELSIF TripStatusPower_INT.5 THEN
	TripStatusPower := 'Over kVAR Generated';
ELSIF TripStatusPower_INT.6 THEN
	TripStatusPower := 'Under kVA';
ELSIF TripStatusPower_INT.7 THEN
	TripStatusPower := 'Over kVA';
ELSIF TripStatusPower_INT.8 THEN
	TripStatusPower := 'Under PF Lag';
ELSIF TripStatusPower_INT.9 THEN
	TripStatusPower := 'Over PF Lag';
ELSIF TripStatusPower_INT.10 THEN
	TripStatusPower := 'Under PF Lead';
ELSIF TripStatusPower_INT.11 THEN
	TripStatusPower := 'Over PF Lead';
ELSE
	TripStatusPower := 'None';
END_IF;

E300_TripStatusControl(TRUE, E300_IP_ADDRESS, E300_SCAN_RATE, TRUE, 7);
S2I_TripStatusControl(E300_TripStatusControl.Output[1], E300_TripStatusControl.Output[2]);
TripStatusControl_INT := S2I_TripStatusControl.INT_OUT;
(* 
	Bit0= TestTrip
	Bit1= PTCTrip
	Bit2= DLXTrip
	Bit3= OperStationTrip 
	Bit4= RemoteTrip
	Bit5= BlockedStartTrip 
	Bit6= HardwareFltTrip 
	Bit7= ConfigTrip
	Bit8= OptionMatchTrip 
	Bit9= DLXFBTimeoutTrip 
	Bit10= ExpansionBusTrip 
	Bit11= Reserved
	Bit12 =Reserved 
	Bit13= NVSTrip
	Bit 14=TestMode Trip
*)
IF TripStatusControl_INT.0 THEN
	TripStatusControl := 'Test';
ELSIF TripStatusControl_INT.1 THEN
	TripStatusControl := 'PCT';
ELSIF TripStatusControl_INT.2 THEN	
	TripStatusControl := 'DLX';
ELSIF TripStatusControl_INT.3 THEN
	TripStatusControl := 'Operator Station';
ELSIF TripStatusControl_INT.4 THEN
	TripStatusControl := 'Remote';
ELSIF TripStatusControl_INT.5 THEN
	TripStatusControl := 'Blocked Start';
ELSIF TripStatusControl_INT.6 THEN
	TripStatusControl := 'Hardware Fault';
ELSIF TripStatusControl_INT.7 THEN
	TripStatusControl := 'Config';
ELSIF TripStatusControl_INT.0 THEN
	TripStatusControl := 'Option Match';
ELSIF TripStatusControl_INT.1 THEN
	TripStatusControl := 'DLX FB Timeout';
ELSIF TripStatusControl_INT.2 THEN
	TripStatusControl := 'Expansion Bus';
ELSIF TripStatusControl_INT.3 THEN
	TripStatusControl := 'RESERVED';
ELSIF TripStatusControl_INT.4 THEN
	TripStatusControl := 'RESERVEDt';
ELSIF TripStatusControl_INT.5 THEN
	TripStatusControl := 'NVS';
ELSIF TripStatusControl_INT.6 THEN
	TripStatusControl := 'TestMode';
ELSE
	TripStatusControl := 'None';
END_IF;
IF (E300_TripStatusCurrent.MSGObjRead.Q AND
	E300_TripStatusVoltage.MSGObjRead.Q AND
	E300_TripStatusPower.MSGObjRead.Q AND
	E300_TripStatusControl.MSGObjRead.Q
) OR Test_Mode THEN
	IF (TripStatusCurrent_INT = 0 AND 
		TripStatusVoltage_INT = 0 AND 
		TripStatusPower_INT = 0 AND 
		TripStatusControl_INT = 0
	) THEN
		TripStatus := FALSE;
	ELSE
		TripStatus := TRUE;
	END_IF;
END_IF;

(* Warning Status *)
E300_WarnStatusCurrent(TRUE, E300_IP_ADDRESS, E300_SCAN_RATE, TRUE, 10);
S2I_WarningStatusCurrent(E300_WarnStatusCurrent.Output[1], E300_WarnStatusCurrent.Output[2]);
WarningStatusCurrent_INT := S2I_WarningStatusCurrent.INT_OUT;
(* 	Bit0= OverloadTrip 
	Bit1= PhaseLossTrip 
	Bit2= GroundFaultTrip 
	Bit3= StallTrip
	Bit4= JamTrip
	Bit5= UnderloadTrip 
	Bit6= CurrentImbalTrip 
	Bit7= L1UnderCurrTrip 
	Bit8= L2UnderCurrTrip 
	Bit9= L3UnderCurrTrip 
	Bit10= L1OverCurrenTrip 
	Bit11= L2OverCurrenTrip 
	Bit12= L3OverCurrenTrip 
	Bit13= L1LineLossTrip 
	Bit14= L2LineLossTrip 
	Bit15= L3LineLossTrip *)
IF WarningStatusCurrent_INT.0 THEN
	WarningStatusCurrent := 'Overload';
ELSIF WarningStatusCurrent_INT.1 THEN
	WarningStatusCurrent := 'Phase Loss';
ELSIF WarningStatusCurrent_INT.2 THEN	
	WarningStatusCurrent := 'Ground Fault';
ELSIF WarningStatusCurrent_INT.3 THEN
	WarningStatusCurrent := 'Stall';
ELSIF WarningStatusCurrent_INT.4 THEN
	WarningStatusCurrent := 'Jam';
ELSIF WarningStatusCurrent_INT.5 THEN
	WarningStatusCurrent := 'Underload';
ELSIF WarningStatusCurrent_INT.6 THEN
	WarningStatusCurrent := 'Current Imbalance';
ELSIF WarningStatusCurrent_INT.7 THEN
	WarningStatusCurrent := 'L1 Undercurrent';
ELSIF WarningStatusCurrent_INT.8 THEN
	WarningStatusCurrent := 'L2 Undercurrent';
ELSIF WarningStatusCurrent_INT.9 THEN
	WarningStatusCurrent := 'L3 Undercurrent';
ELSIF WarningStatusCurrent_INT.10 THEN
	WarningStatusCurrent := 'L1 Overcurrent';
ELSIF WarningStatusCurrent_INT.11 THEN
	WarningStatusCurrent := 'L2 Overcurrent';
ELSIF WarningStatusCurrent_INT.12 THEN
	WarningStatusCurrent := 'L3 Overcurrent';
ELSIF WarningStatusCurrent_INT.13 THEN
	WarningStatusCurrent := 'L1 Line Loss';
ELSIF WarningStatusCurrent_INT.14 THEN
	WarningStatusCurrent := 'L2 Line Loss';
ELSIF WarningStatusCurrent_INT.15 THEN
	WarningStatusCurrent := 'L3 Line Loss';
ELSE
	WarningStatusCurrent := 'None';
END_IF;

E300_WarnStatusVoltage(TRUE, E300_IP_ADDRESS, E300_SCAN_RATE, TRUE, 11);
S2I_WarningStatusVoltage(E300_WarnStatusVoltage.Output[1], E300_WarnStatusVoltage.Output[2]);
WarningStatusVoltage_INT := S2I_WarningStatusVoltage.INT_OUT;
(* 	Bit0= UnderVoltageTrip 
	Bit1= OvervoltageTrip 
	Bit2= VoltageUnbalTrip 
	Bit3= PhaseRotationTrp 
	Bit4= UnderFreqTrip 
	Bit5= OverFreqTrip
*)
IF WarningStatusVoltage_INT.0 THEN
	WarningStatusVoltage := 'Undervoltage';
ELSIF WarningStatusVoltage_INT.1 THEN
	WarningStatusVoltage := 'Overvoltage';
ELSIF WarningStatusVoltage_INT.2 THEN	
	WarningStatusVoltage := 'Voltage Unbalance';
ELSIF WarningStatusVoltage_INT.3 THEN
	WarningStatusVoltage := 'Phase Rotation';
ELSIF WarningStatusVoltage_INT.4 THEN
	WarningStatusVoltage := 'Underfrequency';
ELSIF WarningStatusVoltage_INT.5 THEN
	WarningStatusVoltage := 'Overfrequency';
ELSE
	WarningStatusVoltage := 'None';
END_IF;


E300_WarnStatusPower(TRUE, E300_IP_ADDRESS, E300_SCAN_RATE, TRUE, 12);
S2I_WarningStatusPower(E300_WarnStatusPower.Output[1], E300_WarnStatusPower.Output[2]);
WarningStatusPower_INT:= S2I_WarningStatusPower.INT_OUT;
(* 
	Bit0= UnderKWTrip 
	Bit1= OverKWTrip
	Bit2= UnderKVARConTrip 
	Bit3= OverKVARConTrip 
	Bit4= UnderKVARGenTrip 
	Bit5= OverKVARGenTrip 
	Bit6= UnderKVATrip 
	Bit7= OverKVATrip
	Bit8= UnderPFLagTrip 
	Bit9= OverPFLagTrip 
	Bit10= UnderPFLeadTrip 
	Bit11= OverPFLeadTrip
*)
IF WarningStatusPower_INT.0 THEN
	WarningStatusPower := 'Under kW';
ELSIF WarningStatusPower_INT.1 THEN
	WarningStatusPower := 'Over kW';
ELSIF WarningStatusPower_INT.2 THEN	
	WarningStatusPower := 'Under kVAR Consumed';
ELSIF WarningStatusPower_INT.3 THEN
	WarningStatusPower := 'Over kVAR Consumed';
ELSIF WarningStatusPower_INT.4 THEN
	WarningStatusPower := 'Under kVAR Generated';
ELSIF WarningStatusPower_INT.5 THEN
	WarningStatusPower := 'Over kVAR Generated';
ELSIF WarningStatusPower_INT.6 THEN
	WarningStatusPower := 'Under kVA';
ELSIF WarningStatusPower_INT.7 THEN
	WarningStatusPower := 'Over kVA';
ELSIF WarningStatusPower_INT.8 THEN
	WarningStatusPower := 'Under PF Lag';
ELSIF WarningStatusPower_INT.9 THEN
	WarningStatusPower := 'Over PF Lag';
ELSIF WarningStatusPower_INT.10 THEN
	WarningStatusPower := 'Under PF Lead';
ELSIF WarningStatusPower_INT.11 THEN
	WarningStatusPower := 'Over PF Lead';
ELSE
	WarningStatusPower := 'None';
END_IF;

E300_WarnStatusControl(TRUE, E300_IP_ADDRESS, E300_SCAN_RATE, TRUE, 13);
S2I_WarningStatusControl(E300_WarnStatusControl.Output[1], E300_WarnStatusControl.Output[2]);
WarningStatusControl_INT := S2I_WarningStatusControl.INT_OUT;
(* 
	Bit0= TestTrip
	Bit1= PTCTrip
	Bit2= DLXTrip
	Bit3= OperStationTrip 
	Bit4= RemoteTrip
	Bit5= BlockedStartTrip 
	Bit6= HardwareFltTrip 
	Bit7= ConfigTrip
	Bit8= OptionMatchTrip 
	Bit9= DLXFBTimeoutTrip 
	Bit10= ExpansionBusTrip 
	Bit11= Reserved
	Bit12 =Reserved 
	Bit13= NVSTrip
	Bit 14=TestMode Trip
*)
IF WarningStatusControl_INT.0 THEN
	WarningStatusControl := 'Test';
ELSIF WarningStatusControl_INT.1 THEN
	WarningStatusControl := 'PCT';
ELSIF WarningStatusControl_INT.2 THEN	
	WarningStatusControl := 'DLX';
ELSIF WarningStatusControl_INT.3 THEN
	WarningStatusControl := 'Operator Station';
ELSIF WarningStatusControl_INT.4 THEN
	WarningStatusControl := 'Remote';
ELSIF WarningStatusControl_INT.5 THEN
	WarningStatusControl := 'Blocked Start';
ELSIF WarningStatusControl_INT.6 THEN
	WarningStatusControl := 'Hardware Fault';
ELSIF WarningStatusControl_INT.7 THEN
	WarningStatusControl := 'Config';
ELSIF WarningStatusControl_INT.8 THEN
	WarningStatusControl := 'Option Match';
ELSIF WarningStatusControl_INT.9 THEN
	WarningStatusControl := 'DLX FB Timeout';
ELSIF WarningStatusControl_INT.10 THEN
	WarningStatusControl := 'Expansion Bus';
ELSIF WarningStatusControl_INT.11 THEN
	WarningStatusControl := 'RESERVED';
ELSIF WarningStatusControl_INT.12 THEN
	WarningStatusControl := 'RESERVEDt';
ELSIF WarningStatusControl_INT.13 THEN
	WarningStatusControl := 'NVS';
ELSIF WarningStatusControl_INT.14 THEN
	WarningStatusControl := 'TestMode';
ELSE
	WarningStatusControl := 'None';
END_IF;

IF (WarningStatusCurrent_INT = 0 AND
	WarningStatusVoltage_INT = 0 AND 
	WarningStatusPower_INT = 0 AND 
	WarningStatusControl_INT = 0) THEN
	
	WarningStatus := FALSE;
ELSE
	WarningStatus := TRUE;
END_IF;

IF TripResetCmd THEN
	TripResetOn[1] := 1;
	E300_Write_TripReset(TRUE, E300_IP_ADDRESS, E300_SCAN_RATE, TRUE, TripResetOn);
	TripResetWriteStatus := NOT E300_Write_TripReset.CIPErrorStatus.Error;
	If TripResetWriteStatus THEN
		TripResetCmd := FALSE;
	END_IF;
END_IF;

IF cfg_READ THEN
	(* read the config data from the E300 *)
	ReadE300ConfigData(TRUE, E300_IP_ADDRESS, E300_SCAN_RATE, TRUE);
	E300_Config_Buffer := ReadE300ConfigData.Output;


	(* FLASetting P171 *)
	SINT_TO_DINT_FLASetting(E300_Config_Buffer[5], E300_Config_Buffer[6], E300_Config_Buffer[7], E300_Config_Buffer[8]);
	cfg_C_FLASetting := ANY_TO_REAL(SINT_TO_DINT_FLASetting.DINT_OUT) /100.0;

	(* TripClass P172 *)
	cfg_TCU_TripClass := E300_Config_Buffer[13];

	(* OLResetLevel P174 *)
	cfg_TCU_OLResetLevel := E300_Config_Buffer[15];

	(* OLWarningLevel P175 *)
	cfg_TCU_OLWarningLevel := E300_Config_Buffer[16];

	(* TripEnableCurrent P183 *)
	SINT_TO_INT_TripEnableCurrent(E300_Config_Buffer[17], E300_Config_Buffer[18]);
	cfg_I_TripEnableCurrent := SINT_TO_INT_TripEnableCurrent.INT_OUT;
	(* 
	Bit0= OverloadTrip 
	Bit1= PhaseLossTrip 
	Bit2= GroundFaultTrip 
	Bit3= StallTrip
	Bit4= JamTrip
	Bit5= UnderloadTrip 
	Bit6= CurrentImbalTrip 
	Bit7= L1UnderCurrTrip 
	Bit8= L2UnderCurrTrip 
	Bit9= L3UnderCurrTrip 
	Bit10= L1OverCurrenTrip 
	Bit11= L2OverCurrenTrip 
	Bit12= L3OverCurrenTrip 
	Bit13= L1LineLossTrip 
	Bit14= L2LineLossTrip 
	Bit15= L3LineLossTrip 
	*)
	TripEnabled_I_Overload := cfg_I_TripEnableCurrent.0;
	TripEnabled_I_PhaseLoss := cfg_I_TripEnableCurrent.1;
	TripEnabled_I_GroundFault := cfg_I_TripEnableCurrent.2;
	TripEnabled_I_Stall := cfg_I_TripEnableCurrent.3;
	TripEnabled_I_Jam := cfg_I_TripEnableCurrent.4;
	TripEnabled_I_Underload := cfg_I_TripEnableCurrent.5;
	TripEnabled_I_CurrentImbalance := cfg_I_TripEnableCurrent.6;
	TripEnabled_I_Undercurrent := cfg_I_TripEnableCurrent.7;
	TripEnabled_I_Overcurrent := cfg_I_TripEnableCurrent.10;
	TripEnabled_I_LineLoss := cfg_I_TripEnableCurrent.13;
	
	
	(* TripEnableVoltage P184 *)
	SINT_TO_INT_TripEnableVoltage(E300_Config_Buffer[21], E300_Config_Buffer[22]);
	cfg_V_TripEnableVoltage := SINT_TO_INT_TripEnableVoltage.INT_OUT;
	(*
	Bit0= UnderVoltageTrip 
	Bit1= OvervoltageTrip 
	Bit2= VoltageUnbalTrip 
	Bit3= PhaseRotationTrp 
	Bit4= UnderFreqTrip 
	Bit5= OverFreqTrip
	*)
	TripEnable_V_Undervoltage := cfg_V_TripEnableVoltage.0;
	TripEnable_V_Overvoltage := cfg_V_TripEnableVoltage.1;
	TripEnable_V_VoltageUnbalance := cfg_V_TripEnableVoltage.2;
	TripEnable_V_PhaseRotation := cfg_V_TripEnableVoltage.3;
	TripEnable_V_Underfrequency := cfg_V_TripEnableVoltage.4;
	TripEnable_V_Overfrequency := cfg_V_TripEnableVoltage.5;

	(* TripEnablePower P185 *)
	SINT_TO_INT_TripEnablePower(E300_Config_Buffer[25], E300_Config_Buffer[26]);
	cfg_P_TripEnablePower := SINT_TO_INT_TripEnablePower.INT_OUT;
	(*
	Bit0= UnderKWTrip 
	Bit1= OverKWTrip
	Bit2= UnderKVARConTrip 
	Bit3= OverKVARConTrip 
	Bit4= UnderKVARGenTrip 
	Bit5= OverKVARGenTrip 
	Bit6= UnderKVATrip 
	Bit7= OverKVATrip
	Bit8= UnderPFLagTrip 
	Bit9= OverPFLagTrip 
	Bit10= UnderPFLeadTrip 
	Bit11= OverPFLeadTrip
	*)

	(* TripEnableControl P186 *)
	SINT_TO_INT_TripEnableControl(E300_Config_Buffer[29], E300_Config_Buffer[30]);
	cfg_C_TripEnableControl := SINT_TO_INT_TripEnableControl.INT_OUT;
	(*
	Bit0= TestTrip
	Bit1= PTCTrip
	Bit2= DLXTrip
	Bit3= OperStationTrip 
	Bit4= RemoteTrip 
	Bit5= BlockedStartTrip 
	Bit6= HardwareFltTrip 
	Bit7= ConfigTrip
	Bit8= OptionMatchTrip 
	Bit9= DLXFBTimeoutTrip 
	Bit10= ExpansionBusTrip 
	Bit11= Reserved
	Bit12= Reserved 
	Bit13= NVSTrip 
	Bit14=TestModeTrip
	*)

	(* WarningEnableCurrent P189 *)
	SINT_TO_INT_WarningEnableCurrent(E300_Config_Buffer[19], E300_Config_Buffer[20]);
	cfg_I_WarningEnableCurrent := SINT_TO_INT_WarningEnableCurrent.INT_OUT;
	(* 
	Bit0= OverloadTrip 
	Bit1= PhaseLossTrip 
	Bit2= GroundFaultTrip 
	Bit3= StallTrip
	Bit4= JamTrip
	Bit5= UnderloadTrip 
	Bit6= CurrentImbalTrip 
	Bit7= L1UnderCurrTrip 
	Bit8= L2UnderCurrTrip 
	Bit9= L3UnderCurrTrip 
	Bit10= L1OverCurrenTrip 
	Bit11= L2OverCurrenTrip 
	Bit12= L3OverCurrenTrip 
	Bit13= L1LineLossTrip 
	Bit14= L2LineLossTrip 
	Bit15= L3LineLossTrip 
	*)
	WarningEnabled_I_Overload := cfg_I_WarningEnableCurrent.0;
	WarningEnabled_I_PhaseLoss := cfg_I_WarningEnableCurrent.1;
	WarningEnabled_I_GroundFault := cfg_I_WarningEnableCurrent.2;
	WarningEnabled_I_Stall := cfg_I_WarningEnableCurrent.3;
	WarningEnabled_I_Jam := cfg_I_WarningEnableCurrent.4;
	WarningEnabled_I_Underload := cfg_I_WarningEnableCurrent.5;
	WarningEnabled_I_CurrentImbalance := cfg_I_WarningEnableCurrent.6;
	WarningEnabled_I_Undercurrent := cfg_I_WarningEnableCurrent.7;
	WarningEnabled_I_Overcurrent := cfg_I_WarningEnableCurrent.10;
	WarningEnabled_I_LineLoss := cfg_I_WarningEnableCurrent.13;

	(* WarningEnableVoltage P190 *)
	SINT_TO_INT_WarningEnableVoltage(E300_Config_Buffer[23], E300_Config_Buffer[24]);
	cfg_V_WarningEnableVoltage := SINT_TO_INT_WarningEnableVoltage.INT_OUT;
	(*
	Bit0= UnderVoltageTrip 
	Bit1= OvervoltageTrip 
	Bit2= VoltageUnbalTrip 
	Bit3= PhaseRotationTrp 
	Bit4= UnderFreqTrip 
	Bit5= OverFreqTrip
	*)
	WarningEnable_V_Undervoltage := cfg_V_WarningEnableVoltage.0;
	WarningEnable_V_Overvoltage := cfg_V_WarningEnableVoltage.1;
	WarningEnable_V_VoltageUnbalance := cfg_V_WarningEnableVoltage.2;
	WarningEnable_V_PhaseRotation := cfg_V_WarningEnableVoltage.3;
	WarningEnable_V_Underfrequency := cfg_V_WarningEnableVoltage.4;
	WarningEnable_V_Overfrequency := cfg_V_WarningEnableVoltage.5;

	(* WarningEnablePower P191 *)
	SINT_TO_INT_WarningEnablePower(E300_Config_Buffer[27], E300_Config_Buffer[28]);
	cfg_P_WarningEnablePower := SINT_TO_INT_WarningEnablePower.INT_OUT;
	(*
	Bit0= UnderKWTrip 
	Bit1= OverKWTrip
	Bit2= UnderKVARConTrip 
	Bit3= OverKVARConTrip 
	Bit4= UnderKVARGenTrip 
	Bit5= OverKVARGenTrip 
	Bit6= UnderKVATrip 
	Bit7= OverKVATrip
	Bit8= UnderPFLagTrip 
	Bit9= OverPFLagTrip 
	Bit10= UnderPFLeadTrip 
	Bit11= OverPFLeadTrip
	*)

	(* WarningEnableControl P192 *)
	SINT_TO_INT_WarningEnableControl(E300_Config_Buffer[31], E300_Config_Buffer[32]);
	cfg_C_WarningEnableControl := SINT_TO_INT_WarningEnableControl.INT_OUT;
	(*
	Bit0= TestTrip
	Bit1= PTCTrip
	Bit2= DLXTrip
	Bit3= OperStationTrip 
	Bit4= RemoteTrip 
	Bit5= BlockedStartTrip 
	Bit6= HardwareFltTrip 
	Bit7= ConfigTrip
	Bit8= OptionMatchTrip 
	Bit9= DLXFBTimeoutTrip 
	Bit10= ExpansionBusTrip 
	Bit11= Reserved
	Bit12= Reserved 
	Bit13= NVSTrip 
	Bit14=TestModeTrip
	*)

	(* PhaseLossInhibitTime P239 *)
	cfg_PL_PhaseLossInhibitTime := E300_Config_Buffer[93];

	(* PhaseLossTripDelay P240 *)
	cfg_PL_PhaseLossTripDelay := ANY_TO_REAL(E300_Config_Buffer[94]) /10.0;

	(* GroundFaultInhibitTime P242 *)
	cfg_GF_GroundFaultInhibitTime := E300_Config_Buffer[86];

	(* GroundFaultTripDelay P243 *)
	cfg_GF_GroundFaultTripDelay := ANY_TO_REAL(E300_Config_Buffer[87])/10.0;

	(* GroundFaultTripLevel P244 *)
	SINT_TO_INT_GroundFaultTripLevel(E300_Config_Buffer[89], E300_Config_Buffer[90]);
	cfg_GF_GroundFaultTripLevel := ANY_TO_REAL(SINT_TO_INT_GroundFaultTripLevel.INT_OUT) /100.0;

	(* GroundFaultWarningDelay P245 *)
	cfg_GF_GroundFaultWarningDelay := ANY_TO_REAL(E300_Config_Buffer[88])/10.0;

	(* GroundFaultWarningLevel P246 *)
	SINT_TO_INT_GroundFaultWarningLevel(E300_Config_Buffer[91], E300_Config_Buffer[92]);
	cfg_GF_GroundFaultWarningLevel := ANY_TO_REAL(SINT_TO_INT_GroundFaultWarningLevel.INT_OUT) /100.0;

	(* StallEnabledTime P249 *)
	cfg_I_StallEnabledTime := E300_Config_Buffer[95];

	(* StallTripLevel P250 *)
	SINT_TO_INT_StallTripLevel(E300_Config_Buffer[97], E300_Config_Buffer[98]);
	cfg_I_StallTripLevel := SINT_TO_INT_StallTripLevel.INT_OUT;

	(* JamInhibitTime P251 *)
	cfg_I_JamInhibitTime := E300_Config_Buffer[99];

	(* JamTripDelay P252 *)
	cfg_I_JamTripDelay := E300_Config_Buffer[100];

	(* JamTripLevel P253 *)
	SINT_TO_INT_JamTripLevel(E300_Config_Buffer[101], E300_Config_Buffer[102]);
	cfg_I_JamTripLevel := SINT_TO_INT_JamTripLevel.INT_OUT;

	(* JamWarningLevel P254 *)
	SINT_TO_INT_JamWarningLevel(E300_Config_Buffer[103], E300_Config_Buffer[104]);
	cfg_I_JamWarningLevel := SINT_TO_INT_JamWarningLevel.INT_OUT;

	(* UnderloadInhibitTime P255 *)
	cfg_I_UnderloadInhibitTime := E300_Config_Buffer[105];

	(* UnderloadTripDelay P256 *)
	cfg_I_UnderloadTripDelay := ANY_TO_REAL(E300_Config_Buffer[106])/10.0;

	(* UnderloadTripLevel P257 *)
	cfg_I_UnderloadTripLevel := E300_Config_Buffer[107];

	(* UnderloadWarningLevel P258 *)
	cfg_I_UnderloadWarningLevel := E300_Config_Buffer[108];

	(* CurrentImbalanceInhibitTime P259 *)
	cfg_I_CurrentImbalanceInhibitTime := E300_Config_Buffer[109];

	(* CurrentImbalanceTripDelay P260 *)
	cfg_I_CurrentImbalanceTripDelay := E300_Config_Buffer[110];

	(* CurrentImbalanceTripLevel P261 *)
	cfg_I_CurrentImbalanceTripLevel := E300_Config_Buffer[111];

	(* CurrentImbalanceWarningLevel P262 *)
	cfg_I_CurrentImbalanceWarningLevel := E300_Config_Buffer[112];

	(* CTPrimary P263 *)
	SINT_TO_INT_CTPrimary(E300_Config_Buffer[113], E300_Config_Buffer[114]);
	cfg_I_CTPrimary := SINT_TO_INT_CTPrimary.INT_OUT;

	(* CTSecondary P264 *)
	SINT_TO_INT_CTSecondary(E300_Config_Buffer[115], E300_Config_Buffer[116]);
	cfg_I_CTSecondary := SINT_TO_INT_CTSecondary.INT_OUT;

	(* UndercurrentInhibitTime P265 *)
	cfg_I_UndercurrentInhibitTime := E300_Config_Buffer[117];

	(* L1UndercurrentTripDelay P266 *)
	cfg_I_L1_UndercurrentTripDelay := ANY_TO_REAL(E300_Config_Buffer[118])/10.0;
	cfg_I_UndercurrentTripDelay := ANY_TO_REAL(E300_Config_Buffer[118])/10.0;
	
	(* L1UndercurrentTripLevel P267 *)
	cfg_I_L1_UndercurrentTripLevel := E300_Config_Buffer[119];
	cfg_I_UndercurrentTripLevel := E300_Config_Buffer[119];

	(* L1UndercurrentWarningLevel P268 *)
	cfg_I_L1_UndercurrentWarningLevel := E300_Config_Buffer[120];
	cfg_I_UndercurrentWarningLevel := E300_Config_Buffer[120];

	(* L2UndercurrentTripDelay P269 *)
	cfg_I_L2_UndercurrentTripDelay := ANY_TO_REAL(E300_Config_Buffer[121])/10.0;

	(* L2UndercurrentTripLevel P270 *)
	cfg_I_L2_UndercurrentTripLevel := E300_Config_Buffer[122];

	(* L2UndercurrentWarningLevel P271 *)
	cfg_I_L2_UndercurrentWarningLevel := E300_Config_Buffer[123];

	(* L3UndercurrentTripDelay P272 *)
	cfg_I_L3_UndercurrentTripDelay := ANY_TO_REAL(E300_Config_Buffer[124])/10.0;

	(* L3UndercurrentTripLevel P273 *)
	cfg_I_L3_UndercurrentTripLevel := E300_Config_Buffer[125];

	(* L3UndercurrentWarningLevel P274 *)
	cfg_I_L3_UndercurrentWarningLevel := E300_Config_Buffer[126];

	(* OvercurrentInhibitTime P275 *)
	cfg_I_OvercurrentInhibitTime := E300_Config_Buffer[127];

	(* L1OvercurrentTripDelay P276 *)
	cfg_I_L1_OvercurrentTripDelay :=ANY_TO_REAL(E300_Config_Buffer[128])/10.0;
	cfg_I_OvercurrentTripDelay :=ANY_TO_REAL(E300_Config_Buffer[128])/10.0;

	(* L1OvercurrentTripLevel P277 *)
	cfg_I_L1_OvercurrentTripLevel := E300_Config_Buffer[129];
	cfg_I_OvercurrentTripLevel := E300_Config_Buffer[129];

	(* L1OvercurrentWarningLevel P278 *)
	cfg_I_L1_OvercurrentWarningLevel := E300_Config_Buffer[130];
	cfg_I_OvercurrentWarningLevel := E300_Config_Buffer[130];

	(* L2OvercurrentTripDelay P279 *)
	cfg_I_L2_OvercurrentTripDelay := ANY_TO_REAL(E300_Config_Buffer[131])/10.0;

	(* L2OvercurrentTripLevel P280 *)
	cfg_I_L2_OvercurrentTripLevel := E300_Config_Buffer[132];

	(* L2OvercurrentWarningLevel P281 *)
	cfg_I_L2_OvercurrentWarningLevel := E300_Config_Buffer[133];

	(* L3OvercurrentTripDelay P282 *)
	cfg_I_L3_OvercurrentTripDelay := ANY_TO_REAL(E300_Config_Buffer[134])/10.0;

	(* L3OvercurrentTripLevel P283 *)
	cfg_I_L3_OvercurrentTripLevel := E300_Config_Buffer[135];

	(* L3OvercurrentWarningLevel P284 *)
	cfg_I_L3_OvercurrentWarningLevel := E300_Config_Buffer[136];

	(* LineLossInhibitTime P285 *)
	cfg_I_LineLossInhibitTime := E300_Config_Buffer[137];

	(* L1LossTripDelay P286 *)
	cfg_I_L1LossTripDelay := ANY_TO_REAL(E300_Config_Buffer[138])/10.0;
	cfg_I_LineLossTripDelay := ANY_TO_REAL(E300_Config_Buffer[138])/10.0;

	(* L2LossTripDelay P287 *)
	cfg_I_L2LossTripDelay := ANY_TO_REAL(E300_Config_Buffer[139])/10.0;

	(* L3LossTripDelay P288 *)
	cfg_I_L3LossTripDelay := ANY_TO_REAL(E300_Config_Buffer[140])/10.0;

	(* VoltageMode(Delta/Wye) P352 *)
	cfg_V_VoltageMode := E300_Config_Buffer[169];

	(* PTPrimary P353 *)
	SINT_TO_INT_PTPrimary(E300_Config_Buffer[165], E300_Config_Buffer[166]);
	cfg_V_PTPrimary := SINT_TO_INT_PTPrimary.INT_OUT;

	(* PTSecondary P354 *)
	SINT_TO_INT_PTSecondary(E300_Config_Buffer[167], E300_Config_Buffer[168]);
	cfg_V_PTSecondary := SINT_TO_INT_PTSecondary.INT_OUT;

	(* UndervoltageInhibitTime P355 *)
	cfg_V_UndervoltageInhibitTime := E300_Config_Buffer[171];

	(* UndervoltageTripDelay P356 *)
	cfg_V_UndervoltageTripDelay := ANY_TO_REAL(E300_Config_Buffer[172])/10.0;

	(* UndervoltageTripLevel P357 *)
	SINT_TO_INT_UndervoltageTripLevel(E300_Config_Buffer[173], E300_Config_Buffer[174]);
	cfg_V_UndervoltageTripLevel := ANY_TO_REAL(SINT_TO_INT_UndervoltageTripLevel.INT_OUT) /10.0;

	(* UndervoltageWarningLevel P358 *)
	SINT_TO_INT_UndervoltageWarningLevel(E300_Config_Buffer[175], E300_Config_Buffer[176]);
	cfg_V_UndervoltageWarningLevel := ANY_TO_REAL(SINT_TO_INT_UndervoltageWarningLevel.INT_OUT) /10.0;

	(* OvervoltageInhibitTime P359 *)
	cfg_V_OvervoltageInhibitTime := E300_Config_Buffer[177];

	(* OvervoltageTripDelay P360 *)
	cfg_V_OvervoltageTripDelay := ANY_TO_REAL(E300_Config_Buffer[178])/10.0;

	(* OvervoltageTripLevel P361 *)
	SINT_TO_INT_OvervoltageTripLevel(E300_Config_Buffer[179], E300_Config_Buffer[180]);
	cfg_V_OvervoltageTripLevel := ANY_TO_REAL(SINT_TO_INT_OvervoltageTripLevel.INT_OUT) /10.0;

	(* OvervoltageWarningLevel P362 *)
	SINT_TO_INT_OvervoltageWarningLevel(E300_Config_Buffer[181], E300_Config_Buffer[182]);
	cfg_V_OvervoltageWarningLevel := ANY_TO_REAL(SINT_TO_INT_OvervoltageWarningLevel.INT_OUT) /10.0;

	(* PhaseRotationInhibitTime P363 *)
	cfg_V_PhaseRotationInhibitTime := E300_Config_Buffer[170];

	(* PhaseRotationTripType P364 *)
	(* cfg_V_PhaseRotationTripType := E300_Config_Buffer[]; *)

	(* VoltageImbalanceInhibitTime P365 *)
	cfg_V_VoltageImbalanceInhibitTime := E300_Config_Buffer[183];

	(* VoltageImbalanceTripDelay P366 *)
	cfg_V_VoltageImbalanceTripDelay := ANY_TO_REAL(E300_Config_Buffer[184])/10.0;

	(* VoltageImbalanceTripLevel P367 *)
	cfg_V_VoltageImbalanceTripLevel := E300_Config_Buffer[185];

	(* VoltageImbalanceWarningLevel P368 *)
	cfg_V_VoltageImbalanceWarningLevel := E300_Config_Buffer[186];

	(* UnderfrequencyInhibitTime P369 *)
	cfg_V_UnderfrequencyInhibitTime := E300_Config_Buffer[187];

	(* UnderfrequencyTripDelay P370 *)
	cfg_V_UnderfrequencyTripDelay := ANY_TO_REAL(E300_Config_Buffer[188])/10.0;

	(* UnderfrequencyTripLevel P371 *)
	cfg_V_UnderfrequencyTripLevel := E300_Config_Buffer[189];

	(* UnderfrequencyWarningLevel P372 *)
	cfg_V_UnderfrequencyWarningLevel := E300_Config_Buffer[190];

	(* OverfrequencyInhibitTime P373 *)
	cfg_V_OverfrequencyInhibitTime := E300_Config_Buffer[191];

	(* OverfrequencyTripDelay P374 *)
	cfg_V_OverfrequencyTripDelay := ANY_TO_REAL(E300_Config_Buffer[192])/10.0;

	(* OverfrequencyTripLevel P375 *)
	cfg_V_OverfrequencyTripLevel := E300_Config_Buffer[193];

	(* OverfrequencyWarningLevel P376 *)
	cfg_V_OverfrequencyWarningLevel := E300_Config_Buffer[194];

	(* UnderRealPowerInhibitTime P378 *)
	cfg_P_UnderRealPowerInhibitTime := E300_Config_Buffer[197];

	(* UnderRealPowerTripDelay P379 *)
	cfg_P_UnderRealPowerTripDelay := ANY_TO_REAL(E300_Config_Buffer[198])/10.0;

	(* UnderRealPowerTripLevel P380 *)
	SINT_TO_DINT_UnderRealPowerTripLevel(E300_Config_Buffer[201], E300_Config_Buffer[202], E300_Config_Buffer[203], E300_Config_Buffer[204]);
	cfg_P_UnderRealPowerTripLevel := ANY_TO_REAL(SINT_TO_DINT_UnderRealPowerTripLevel.DINT_OUT) /1000.0;

	(* UnderRealPowerWarningLevel P381 *)
	SINT_TO_DINT_UnderRealPowerWarningLevel(E300_Config_Buffer[205], E300_Config_Buffer[206], E300_Config_Buffer[207], E300_Config_Buffer[208]);
	cfg_P_UnderRealPowerWarningLevel := ANY_TO_REAL(SINT_TO_DINT_UnderRealPowerWarningLevel.DINT_OUT) /1000.0;

	(* OverRealPowerInhibitTime P382 *)
	cfg_P_OverRealPowerInhibitTime := E300_Config_Buffer[199];

	(* OverRealPowerTripDelay P383 *)
	cfg_P_OverRealPowerTripDelay := ANY_TO_REAL(E300_Config_Buffer[200])/10.0;

	(* OverRealPowerTripLevel P384 *)
	SINT_TO_DINT_OverRealPowerTripLevel(E300_Config_Buffer[209], E300_Config_Buffer[210], E300_Config_Buffer[211], E300_Config_Buffer[212]);
	cfg_P_OverRealPowerTripLevel := ANY_TO_REAL(SINT_TO_DINT_OverRealPowerTripLevel.DINT_OUT) /1000.0;

	(* OverRealPowerWarningLevel P385 *)
	SINT_TO_DINT_OverRealPowerWarningLevel(E300_Config_Buffer[213], E300_Config_Buffer[214], E300_Config_Buffer[215], E300_Config_Buffer[216]);
	cfg_P_OverRealPowerWarningLevel := ANY_TO_REAL(SINT_TO_DINT_OverRealPowerWarningLevel.DINT_OUT) /1000.0;

	(* UnderReactiveConsumedPowerInhibitTime P386 *)
	cfg_P_UnderReactiveConsumedInhibitTime := E300_Config_Buffer[217];

	(* UnderReactiveConsumedPowerTripDelay P387 *)
	cfg_P_UnderReactiveConsumedTripDelay := ANY_TO_REAL(E300_Config_Buffer[218])/10.0;

	(* UnderReactiveConsumedPowerTripLevel P388 *)
	SINT_TO_DINT_UnderReactiveConsTripLevel(E300_Config_Buffer[221], E300_Config_Buffer[222], E300_Config_Buffer[223], E300_Config_Buffer[224]);
	cfg_P_UnderReactiveConsumedTripLevel := ANY_TO_REAL(SINT_TO_DINT_UnderReactiveConsTripLevel.DINT_OUT) /1000.0;

	(* UnderReactiveConsumedPowerWarningLevel P389 *)
	SINT_TO_DINT_UnderReactiveConsWLevel(E300_Config_Buffer[225], E300_Config_Buffer[226], E300_Config_Buffer[227], E300_Config_Buffer[228]);
	cfg_P_UnderReactiveConsumedWarningLevel := ANY_TO_REAL(SINT_TO_DINT_UnderReactiveConsWLevel.DINT_OUT) /1000.0;

	(* OverReactiveConsumedPowerInhibitTime P390 *)
	cfg_P_OverReactiveConsumedInhibitTime := E300_Config_Buffer[219];

	(* OverReactiveConsumedPowerTripDelay P391 *)
	cfg_P_OverReactiveConsumedTripDelay := ANY_TO_REAL(E300_Config_Buffer[220])/10.0;

	(* OverReactiveConsumedPowerTripLevel P392 *)
	SINT_TO_DINT_OReactiveConsTripLevel(E300_Config_Buffer[229], E300_Config_Buffer[230], E300_Config_Buffer[231], E300_Config_Buffer[232]);
	cfg_P_OverReactiveConsumedTripLevel := ANY_TO_REAL(SINT_TO_DINT_OReactiveConsTripLevel.DINT_OUT) /1000.0;

	(* OverReactiveConsumedPowerWarningLevel P393 *)
	SINT_TO_DINT_OReactiveConsWarningLevel(E300_Config_Buffer[233], E300_Config_Buffer[234], E300_Config_Buffer[235], E300_Config_Buffer[236]);
	cfg_P_OverReactiveConsumedWarningLevel := ANY_TO_REAL(SINT_TO_DINT_OReactiveConsWarningLevel.DINT_OUT) /1000.0;

	(* UnderReactiveGeneratedPowerInhibitTime P394 *)
	cfg_P_UnderReactiveGeneratedInhibitTime := E300_Config_Buffer[237];

	(* UnderReactiveGeneratedPowerTripDelay P395 *)
	cfg_P_UnderReactiveGeneratedTripDelay := ANY_TO_REAL(E300_Config_Buffer[238])/10.0;

	(* UnderReactiveGeneratedPowerTripLevel P396 *)
	SINT_TO_DINT_UnderReactiveGenTripLevel(E300_Config_Buffer[241], E300_Config_Buffer[242], E300_Config_Buffer[243], E300_Config_Buffer[244]);
	cfg_P_UnderReactiveGeneratedTripLevel := ANY_TO_REAL(SINT_TO_DINT_UnderReactiveGenTripLevel.DINT_OUT) /1000.0;

	(* UnderReactiveGeneratedPowerWarningLevel P397 *)
	SINT_TO_DINT_UnderReactGenWarningLevel(E300_Config_Buffer[245], E300_Config_Buffer[246], E300_Config_Buffer[247], E300_Config_Buffer[248]);
	cfg_P_UnderReactiveGeneratedWarningLevel := ANY_TO_REAL(SINT_TO_DINT_UnderReactGenWarningLevel.DINT_OUT) /1000.0;

	(* OverReactiveGeneratedPowerInhibitTime P398 *)
	cfg_P_OverReactiveGeneratedInhibitTime := E300_Config_Buffer[239];

	(* OverReactiveGeneratedPowerTripDelay P399 *)
	cfg_P_OverReactiveGeneratedTripDelay := ANY_TO_REAL(E300_Config_Buffer[240])/10.0;

	(* OverReactiveGeneratedPowerTripLevel P400 *)
	SINT_TO_DINT_OReactiveGenTripLevel(E300_Config_Buffer[249], E300_Config_Buffer[250], E300_Config_Buffer[251], E300_Config_Buffer[252]);
	cfg_P_OverReactiveGeneratedTripLevel := ANY_TO_REAL(SINT_TO_DINT_OReactiveGenTripLevel.DINT_OUT) /1000.0;

	(* OverReactiveGeneratedPowerWarningLevel P401 *)
	SINT_TO_DINT_OReactiveGenWarningLevel(E300_Config_Buffer[253], E300_Config_Buffer[254], E300_Config_Buffer[255], E300_Config_Buffer[256]);
	cfg_P_OverReactiveGeneratedWarningLevel := ANY_TO_REAL(SINT_TO_DINT_OReactiveGenWarningLevel.DINT_OUT) /1000.0;

	(* UnderApparentPowerInhibitTime P402 *)
	cfg_P_UnderApparentPowerInhibitTime := E300_Config_Buffer[257];

	(* UnderApparentPowerTripDelay P403 *)
	cfg_P_UnderApparentPowerTripDelay := ANY_TO_REAL(E300_Config_Buffer[258])/10.0;

	(* UnderApparentPowerTripLevel P404 *)
	SINT_TO_DINT_UnderApparentPowerTripLevel(E300_Config_Buffer[261], E300_Config_Buffer[262], E300_Config_Buffer[263], E300_Config_Buffer[264]);
	cfg_P_UnderApparentPowerTripLevel := ANY_TO_REAL(SINT_TO_DINT_UnderApparentPowerTripLevel.DINT_OUT) /1000.0;

	(* UnderApparentPowerWarningLevel P405 *)
	SINT_TO_DINT_UnderApparentWarningLevel(E300_Config_Buffer[265], E300_Config_Buffer[266], E300_Config_Buffer[267], E300_Config_Buffer[268]);
	cfg_P_UnderApparentPowerWarningLevel := ANY_TO_REAL(SINT_TO_DINT_UnderApparentWarningLevel.DINT_OUT) /1000.0;

	(* OverApparentPowerInhibitTime P406 *)
	cfg_P_OverApparentPowerInhibitTime := E300_Config_Buffer[259];

	(* OverApparentPowerTripDelay P407 *)
	cfg_P_OverApparentPowerTripDelay := ANY_TO_REAL(E300_Config_Buffer[260])/10.0;

	(* OverApparentPowerTripLevel P408 *)
	SINT_TO_DINT_OverApparentTripLevel(E300_Config_Buffer[269], E300_Config_Buffer[270], E300_Config_Buffer[271], E300_Config_Buffer[272]);
	cfg_P_OverApparentPowerTripLevel := ANY_TO_REAL(SINT_TO_DINT_OverApparentTripLevel.DINT_OUT) /1000.0;

	(* OverApparentPowerWarningLevel P409 *)
	SINT_TO_DINT_OverApparentWarningLevel(E300_Config_Buffer[273], E300_Config_Buffer[274], E300_Config_Buffer[275], E300_Config_Buffer[276]);
	cfg_P_OverApparentPowerWarningLevel := ANY_TO_REAL(SINT_TO_DINT_OverApparentWarningLevel.DINT_OUT) /1000.0;

	(* UnderPowerFactorLagInhibitTime P410 *)
	cfg_P_UnderPowerFactorLagInhibitTime := E300_Config_Buffer[277];

	(* UnderPowerFactorLagTripDelay P411 *)
	cfg_P_UnderPowerFactorLagTripDelay := ANY_TO_REAL(E300_Config_Buffer[278])/10.0;

	(* UnderPowerFactorLagTripLevel P412 *)
	U2S_UnderPFLagTripLevel(E300_Config_Buffer[279]);
	cfg_P_UnderPowerFactorLagTripLevel := U2S_UnderPFLagTripLevel.INT_OUT;

	(* UnderPowerFactorLagWarningLevel P413 *)
	U2S_UnderPFLagWarningLevel(E300_Config_Buffer[280]);
	cfg_P_UnderPowerFactorLagWarningLevel := U2S_UnderPFLagWarningLevel.INT_OUT;

	(* OverPowerFactorLagInhibitTime P414 *)
	cfg_P_OverPowerFactorLagInhibitTime := E300_Config_Buffer[281];

	(* OverPowerFactorLagTripDelay P415 *)
	cfg_P_OverPowerFactorLagTripDelay := E300_Config_Buffer[282];

	(* OverPowerFactorLagTripLevel P416 *)
	U2S_OverPFLagTripLevel(E300_Config_Buffer[283]);
	cfg_P_OverPowerFactorLagTripLevel := U2S_OverPFLagTripLevel.INT_OUT;

	(* OverPowerFactorLagWarningLevel P417 *)
	U2S_OverPFLagWarningLevel(E300_Config_Buffer[284]);
	cfg_P_OverPowerFactorLagWarningLevel := U2S_OverPFLagWarningLevel.INT_OUT;

	(* UnderPowerFactorLeadInhibitTime P418 *)
	cfg_P_UnderPowerFactorLeadInhibitTime := E300_Config_Buffer[285];

	(* UnderPowerFactorLeadTripDelay P419 *)
	cfg_P_UnderPowerFactorLeadTripDelay := ANY_TO_REAL(E300_Config_Buffer[286])/10.0;

	(* UnderPowerFactorLeadTripLevel P420 *)
	cfg_P_UnderPowerFactorLeadTripLevel := E300_Config_Buffer[287];

	(* UnderPowerFactorLeadWarningLevel P421 *)
	cfg_P_UnderPowerFactorLeadWarningLevel := E300_Config_Buffer[288];

	(* OverPowerFactorLeadInhibitTime P422 *)
	cfg_P_OverPowerFactorLeadInhibitTime := E300_Config_Buffer[289];

	(* OverPowerFactorLeadTripDelay P423 *)
	cfg_P_OverPowerFactorLeadTripDelay := ANY_TO_REAL(E300_Config_Buffer[290])/10.0;

	(* OverPowerFactorLeadTripLevel P424 *)
	cfg_P_OverPowerFactorLeadTripLevel := E300_Config_Buffer[291];

	(* OverPowerFactorLeadWarningLevel P425 *)
	cfg_P_OverPowerFactorLeadWarningLevel := E300_Config_Buffer[292];
	
	IF ReadE300ConfigData.MSGObjRead.Q THEN
		cfg_READ := FALSE;
	END_IF;
	
END_IF;

IF cfg_WRITE THEN
	(* FLASetting P171 *)
	D2S_FLASetting(ANY_TO_UDINT(cfg_C_FLASetting*100.0));
	E300_Config_Buffer[5] := D2S_FLASetting.OUT_SINT_1;
	E300_Config_Buffer[6] := D2S_FLASetting.OUT_SINT_2;
	E300_Config_Buffer[7] := D2S_FLASetting.OUT_SINT_3;
	E300_Config_Buffer[8] := D2S_FLASetting.OUT_SINT_4;

	(* TripClass P172 *)
	E300_Config_Buffer[13] := cfg_TCU_TripClass;

	(* OLResetLevel P174 *)
	E300_Config_Buffer[15] := cfg_TCU_OLResetLevel;

	(* OLWarningLevel P175 *)
	E300_Config_Buffer[16] := cfg_TCU_OLWarningLevel;

	(* TripEnableCurrent P183 *)
	cfg_I_TripEnableCurrent.0 := TripEnabled_I_Overload;
	cfg_I_TripEnableCurrent.1 := TripEnabled_I_PhaseLoss;
	cfg_I_TripEnableCurrent.2 := TripEnabled_I_GroundFault;
	cfg_I_TripEnableCurrent.3 := TripEnabled_I_Stall;
	cfg_I_TripEnableCurrent.4 := TripEnabled_I_Jam;
	cfg_I_TripEnableCurrent.5 := TripEnabled_I_Underload;
	cfg_I_TripEnableCurrent.6 := TripEnabled_I_CurrentImbalance;
	cfg_I_TripEnableCurrent.7 := TripEnabled_I_Undercurrent;
	cfg_I_TripEnableCurrent.8 := TripEnabled_I_Undercurrent;
	cfg_I_TripEnableCurrent.9 := TripEnabled_I_Undercurrent;
	cfg_I_TripEnableCurrent.10 := TripEnabled_I_Overcurrent;
	cfg_I_TripEnableCurrent.11 := TripEnabled_I_Overcurrent;
	cfg_I_TripEnableCurrent.12 := TripEnabled_I_Overcurrent;
	cfg_I_TripEnableCurrent.13 := TripEnabled_I_LineLoss;
	cfg_I_TripEnableCurrent.14 := TripEnabled_I_LineLoss;
	cfg_I_TripEnableCurrent.15 := TripEnabled_I_LineLoss;
	I2S_TripEnableCurrent(ANY_TO_UINT(cfg_I_TripEnableCurrent));
	E300_Config_Buffer[17] := I2S_TripEnableCurrent.OUT_SINT_1;
	E300_Config_Buffer[18] := I2S_TripEnableCurrent.OUT_SINT_2;

	(* TripEnableVoltage P184 *)
	cfg_V_TripEnableVoltage.0 := TripEnable_V_Undervoltage;
	cfg_V_TripEnableVoltage.1 := TripEnable_V_Overvoltage;
	cfg_V_TripEnableVoltage.2 := TripEnable_V_VoltageUnbalance;
	cfg_V_TripEnableVoltage.3 := TripEnable_V_PhaseRotation;
	cfg_V_TripEnableVoltage.4 := TripEnable_V_Underfrequency;
	cfg_V_TripEnableVoltage.5 := TripEnable_V_Overfrequency;
	I2S_TripEnableVoltage(ANY_TO_UINT(cfg_V_TripEnableVoltage));
	E300_Config_Buffer[21] := I2S_TripEnableVoltage.OUT_SINT_1;
	E300_Config_Buffer[22] := I2S_TripEnableVoltage.OUT_SINT_2;

	(* TripEnablePower P185 *)
	I2S_TripEnablePower(ANY_TO_UINT(cfg_P_TripEnablePower));
	E300_Config_Buffer[25] := I2S_TripEnablePower.OUT_SINT_1;
	E300_Config_Buffer[26] := I2S_TripEnablePower.OUT_SINT_2;

	(* TripEnableControl P186 *)
	I2S_TripEnableControl(ANY_TO_UINT(cfg_C_TripEnableControl));
	E300_Config_Buffer[29] := I2S_TripEnableControl.OUT_SINT_1;
	E300_Config_Buffer[30] := I2S_TripEnableControl.OUT_SINT_2;

	(* WarningEnableCurrent P189 *)
	cfg_I_WarningEnableCurrent.0 := WarningEnabled_I_Overload;
	cfg_I_WarningEnableCurrent.1 := WarningEnabled_I_PhaseLoss;
	cfg_I_WarningEnableCurrent.2 := WarningEnabled_I_GroundFault;
	cfg_I_WarningEnableCurrent.3 := WarningEnabled_I_Stall;
	cfg_I_WarningEnableCurrent.4 := WarningEnabled_I_Jam;
	cfg_I_WarningEnableCurrent.5 := WarningEnabled_I_Underload;
	cfg_I_WarningEnableCurrent.6 := WarningEnabled_I_CurrentImbalance;
	cfg_I_WarningEnableCurrent.7 := WarningEnabled_I_Undercurrent;
	cfg_I_WarningEnableCurrent.8 := WarningEnabled_I_Undercurrent;
	cfg_I_WarningEnableCurrent.9 := WarningEnabled_I_Undercurrent;
	cfg_I_WarningEnableCurrent.10 := WarningEnabled_I_Overcurrent;
	cfg_I_WarningEnableCurrent.11 := WarningEnabled_I_Overcurrent;
	cfg_I_WarningEnableCurrent.12 := WarningEnabled_I_Overcurrent;
	cfg_I_WarningEnableCurrent.13 := WarningEnabled_I_LineLoss;
	cfg_I_WarningEnableCurrent.14 := WarningEnabled_I_LineLoss;
	cfg_I_WarningEnableCurrent.15 := WarningEnabled_I_LineLoss;
	I2S_WarningEnableCurrent(ANY_TO_UINT(cfg_I_WarningEnableCurrent));
	E300_Config_Buffer[19] := I2S_WarningEnableCurrent.OUT_SINT_1;
	E300_Config_Buffer[20] := I2S_WarningEnableCurrent.OUT_SINT_2;

	(* WarningEnableVoltage P190 *)
	cfg_V_WarningEnableVoltage.0 := WarningEnable_V_Undervoltage;
	cfg_V_WarningEnableVoltage.1 := WarningEnable_V_Overvoltage;
	cfg_V_WarningEnableVoltage.2 := WarningEnable_V_VoltageUnbalance;
	cfg_V_WarningEnableVoltage.3 := WarningEnable_V_PhaseRotation;
	cfg_V_WarningEnableVoltage.4 := WarningEnable_V_Underfrequency;
	cfg_V_WarningEnableVoltage.5 := WarningEnable_V_Overfrequency;
	I2S_WarningEnableVoltage(ANY_TO_UINT(cfg_V_WarningEnableVoltage));
	E300_Config_Buffer[23] := I2S_WarningEnableVoltage.OUT_SINT_1;
	E300_Config_Buffer[24] := I2S_WarningEnableVoltage.OUT_SINT_2;

	(* WarningEnablePower P191 *)
	I2S_WarningEnablePower(ANY_TO_UINT(cfg_P_WarningEnablePower));
	E300_Config_Buffer[27] := I2S_WarningEnablePower.OUT_SINT_1;
	E300_Config_Buffer[28] := I2S_WarningEnablePower.OUT_SINT_2;

	(* WarningEnableControl P192 *)
	I2S_WarningEnableControl(ANY_TO_UINT(cfg_C_WarningEnableControl));
	E300_Config_Buffer[31] := I2S_WarningEnableControl.OUT_SINT_1;
	E300_Config_Buffer[32] := I2S_WarningEnableControl.OUT_SINT_2;

	(* PhaseLossInhibitTime P239 *)
	E300_Config_Buffer[93] := cfg_PL_PhaseLossInhibitTime;

	(* PhaseLossTripDelay P240 *)
	E300_Config_Buffer[94] := ANY_TO_USINT(cfg_PL_PhaseLossTripDelay *10.0);

	(* GroundFaultInhibitTime P242 *)
	E300_Config_Buffer[86] := cfg_GF_GroundFaultInhibitTime;

	(* GroundFaultTripDelay P243 *)
	E300_Config_Buffer[87] := ANY_TO_USINT(cfg_GF_GroundFaultTripDelay *10.0);

	(* GroundFaultTripLevel P244 *)
	I2S_GroundFaultTripLevel(ANY_TO_UINT(cfg_GF_GroundFaultTripLevel*100.0));
	E300_Config_Buffer[89] := I2S_GroundFaultTripLevel.OUT_SINT_1;
	E300_Config_Buffer[90] := I2S_GroundFaultTripLevel.OUT_SINT_2;

	(* GroundFaultWarningDelay P245 *)
	(* E300_Config_Buffer[88] := ANY_TO_USINT(cfg_GF_GroundFaultWarningDelay *10.0); *)
	E300_Config_Buffer[88] := ANY_TO_USINT(cfg_GF_GroundFaultTripDelay *10.0);

	(* GroundFaultWarningLevel P246 *)
	I2S_GroundFaultWarningLevel(ANY_TO_UINT(cfg_GF_GroundFaultWarningLevel*100.0));
	E300_Config_Buffer[91] := I2S_GroundFaultWarningLevel.OUT_SINT_1;
	E300_Config_Buffer[92] := I2S_GroundFaultWarningLevel.OUT_SINT_2;

	(* StallEnabledTime P249 *)
	E300_Config_Buffer[95] := cfg_I_StallEnabledTime;

	(* StallTripLevel P250 *)
	I2S_StallTripLevel(ANY_TO_UINT(cfg_I_StallTripLevel));
	E300_Config_Buffer[97] := I2S_StallTripLevel.OUT_SINT_1;
	E300_Config_Buffer[98] := I2S_StallTripLevel.OUT_SINT_2;

	(* JamInhibitTime P251 *)
	E300_Config_Buffer[99] := cfg_I_JamInhibitTime;

	(* JamTripDelay P252 *)
	E300_Config_Buffer[100] := cfg_I_JamTripDelay;

	(* JamTripLevel P253 *)
	I2S_JamTripLevel(ANY_TO_UINT(cfg_I_JamTripLevel));
	E300_Config_Buffer[101] := I2S_JamTripLevel.OUT_SINT_1;
	E300_Config_Buffer[102] := I2S_JamTripLevel.OUT_SINT_2;

	(* JamWarningLevel P254 *)
	I2S_JamWarningLevel(ANY_TO_UINT(cfg_I_JamWarningLevel));
	E300_Config_Buffer[103] := I2S_JamWarningLevel.OUT_SINT_1;
	E300_Config_Buffer[104] := I2S_JamWarningLevel.OUT_SINT_2;

	(* UnderloadInhibitTime P255 *)
	E300_Config_Buffer[105] := cfg_I_UnderloadInhibitTime;

	(* UnderloadTripDelay P256 *)
	E300_Config_Buffer[106] := ANY_TO_USINT(cfg_I_UnderloadTripDelay *10.0);

	(* UnderloadTripLevel P257 *)
	E300_Config_Buffer[107] := cfg_I_UnderloadTripLevel;

	(* UnderloadWarningLevel P258 *)
	E300_Config_Buffer[108] := cfg_I_UnderloadWarningLevel;

	(* CurrentImbalanceInhibitTime P259 *)
	E300_Config_Buffer[109] := cfg_I_CurrentImbalanceInhibitTime;

	(* CurrentImbalanceTripDelay P260 *)
	E300_Config_Buffer[110] := cfg_I_CurrentImbalanceTripDelay;

	(* CurrentImbalanceTripLevel P261 *)
	E300_Config_Buffer[111] := cfg_I_CurrentImbalanceTripLevel;

	(* CurrentImbalanceWarningLevel P262 *)
	E300_Config_Buffer[112] := cfg_I_CurrentImbalanceWarningLevel;

	(* CTPrimary P263 *)
	I2S_CTPrimary(ANY_TO_UINT(cfg_I_CTPrimary));
	E300_Config_Buffer[113] := I2S_CTPrimary.OUT_SINT_1;
	E300_Config_Buffer[114] := I2S_CTPrimary.OUT_SINT_2;

	(* CTSecondary P264 *)
	I2S_CTSecondary(ANY_TO_UINT(cfg_I_CTSecondary));
	E300_Config_Buffer[115] := I2S_CTSecondary.OUT_SINT_1;
	E300_Config_Buffer[116] := I2S_CTSecondary.OUT_SINT_2;

	(* UndercurrentInhibitTime P265 *)
	E300_Config_Buffer[117] := cfg_I_UndercurrentInhibitTime;

	(* L1UndercurrentTripDelay P266 *)
	(* E300_Config_Buffer[118] := ANY_TO_USINT(cfg_I_L1_UndercurrentTripDelay *10.0); *)
	E300_Config_Buffer[118] := ANY_TO_USINT(cfg_I_UndercurrentTripDelay *10.0);

	(* L1UndercurrentTripLevel P267 *)
	(* E300_Config_Buffer[119] := cfg_I_L1_UndercurrentTripLevel; *)
	E300_Config_Buffer[119] := cfg_I_UndercurrentTripLevel;

	(* L1UndercurrentWarningLevel P268 *)
	(* E300_Config_Buffer[120] := cfg_I_L1_UndercurrentWarningLevel; *)
	E300_Config_Buffer[120] := cfg_I_UndercurrentWarningLevel;

	(* L2UndercurrentTripDelay P269 *)
	(* E300_Config_Buffer[121] := ANY_TO_USINT(cfg_I_L2_UndercurrentTripDelay *10.0); *)
	E300_Config_Buffer[121] := ANY_TO_USINT(cfg_I_UndercurrentTripDelay *10.0);

	(* L2UndercurrentTripLevel P270 *)
	(* E300_Config_Buffer[122] := cfg_I_L2_UndercurrentTripLevel; *)
	E300_Config_Buffer[122] := cfg_I_UndercurrentTripLevel;

	(* L2UndercurrentWarningLevel P271 *)
	(* E300_Config_Buffer[123] := cfg_I_L2_UndercurrentWarningLevel; *)
	E300_Config_Buffer[123] := cfg_I_UndercurrentWarningLevel;

	(* L3UndercurrentTripDelay P272 *)
	(* E300_Config_Buffer[124] := ANY_TO_USINT(cfg_I_L3_UndercurrentTripDelay *10.0); *)
	E300_Config_Buffer[124] := ANY_TO_USINT(cfg_I_UndercurrentTripDelay *10.0);

	(* L3UndercurrentTripLevel P273 *)
	(* E300_Config_Buffer[125] := cfg_I_L3_UndercurrentTripLevel; *)
	E300_Config_Buffer[125] := cfg_I_UndercurrentTripLevel;

	(* L3UndercurrentWarningLevel P274 *)
	(* E300_Config_Buffer[126] := cfg_I_L3_UndercurrentWarningLevel; *)
	E300_Config_Buffer[126] := cfg_I_UndercurrentWarningLevel;

	(* OvercurrentInhibitTime P275 *)
	E300_Config_Buffer[127] := cfg_I_OvercurrentInhibitTime;

	(* L1OvercurrentTripDelay P276 *)
	(* E300_Config_Buffer[128] := ANY_TO_USINT(cfg_I_L1_OvercurrentTripDelay *10.0); *)
	E300_Config_Buffer[128] := ANY_TO_USINT(cfg_I_OvercurrentTripDelay *10.0);

	(* L1OvercurrentTripLevel P277 *)
	(* E300_Config_Buffer[129] := cfg_I_L1_OvercurrentTripLevel; *)
	E300_Config_Buffer[129] := cfg_I_OvercurrentTripLevel;

	(* L1OvercurrentWarningLevel P278 *)
	(* E300_Config_Buffer[130] := cfg_I_L1_OvercurrentWarningLevel; *)
	E300_Config_Buffer[130] := cfg_I_OvercurrentWarningLevel;

	(* L2OvercurrentTripDelay P279 *)
	(* E300_Config_Buffer[131] := ANY_TO_USINT(cfg_I_L2_OvercurrentTripDelay *10.0); *)
	E300_Config_Buffer[131] := ANY_TO_USINT(cfg_I_OvercurrentTripDelay *10.0);

	(* L2OvercurrentTripLevel P280 *)
	(* E300_Config_Buffer[132] := cfg_I_L2_OvercurrentTripLevel; *)
	E300_Config_Buffer[132] := cfg_I_OvercurrentTripLevel;

	(* L2OvercurrentWarningLevel P281 *)
	(* E300_Config_Buffer[133] := cfg_I_L2_OvercurrentWarningLevel; *)
	E300_Config_Buffer[133] := cfg_I_OvercurrentWarningLevel;

	(* L3OvercurrentTripDelay P282 *)
	(* E300_Config_Buffer[134] := ANY_TO_USINT(cfg_I_L3_OvercurrentTripDelay *10.0); *)
	E300_Config_Buffer[134] := ANY_TO_USINT(cfg_I_OvercurrentTripDelay *10.0);

	(* L3OvercurrentTripLevel P283 *)
	(* E300_Config_Buffer[135] := cfg_I_L3_OvercurrentTripLevel; *)
	E300_Config_Buffer[135] := cfg_I_OvercurrentTripLevel;

	(* L3OvercurrentWarningLevel P284 *)
	(* E300_Config_Buffer[136] := cfg_I_L3_OvercurrentWarningLevel; *)
	E300_Config_Buffer[136] := cfg_I_OvercurrentWarningLevel;

	(* LineLossInhibitTime P285 *)
	E300_Config_Buffer[137] := cfg_I_LineLossInhibitTime;

	(* L1LossTripDelay P286 *)
	(* E300_Config_Buffer[138] := ANY_TO_USINT(cfg_I_L1LossTripDelay *10.0); *)
	E300_Config_Buffer[138] := ANY_TO_USINT(cfg_I_LineLossTripDelay *10.0);

	(* L2LossTripDelay P287 *)
	(* E300_Config_Buffer[139] := ANY_TO_USINT(cfg_I_L2LossTripDelay *10.0); *)
	E300_Config_Buffer[139] := ANY_TO_USINT(cfg_I_LineLossTripDelay *10.0);

	(* L3LossTripDelay P288 *)
	(* E300_Config_Buffer[140] := ANY_TO_USINT(cfg_I_L3LossTripDelay *10.0); *)
	E300_Config_Buffer[140] := ANY_TO_USINT(cfg_I_LineLossTripDelay *10.0);

	(* VoltageMode(Delta/Wye) P352 *)
	E300_Config_Buffer[169] := cfg_V_VoltageMode;

	(* PTPrimary P353 *)
	I2S_PTPrimary(ANY_TO_UINT(cfg_V_PTPrimary));
	E300_Config_Buffer[165] := I2S_PTPrimary.OUT_SINT_1;
	E300_Config_Buffer[166] := I2S_PTPrimary.OUT_SINT_2;

	(* PTSecondary P354 *)
	I2S_PTSecondary(ANY_TO_UINT(cfg_V_PTSecondary));
	E300_Config_Buffer[167] := I2S_PTSecondary.OUT_SINT_1;
	E300_Config_Buffer[168] := I2S_PTSecondary.OUT_SINT_2;

	(* UndervoltageInhibitTime P355 *)
	E300_Config_Buffer[171] := cfg_V_UndervoltageInhibitTime;

	(* UndervoltageTripDelay P356 *)
	E300_Config_Buffer[172] := ANY_TO_USINT(cfg_V_UndervoltageTripDelay *10.0);

	(* UndervoltageTripLevel P357 *)
	I2S_UndervoltageTripLevel(ANY_TO_UINT(cfg_V_UndervoltageTripLevel*10.0));
	E300_Config_Buffer[173] := I2S_UndervoltageTripLevel.OUT_SINT_1;
	E300_Config_Buffer[174] := I2S_UndervoltageTripLevel.OUT_SINT_2;

	(* UndervoltageWarningLevel P358 *)
	I2S_UndervoltageWarningLevel(ANY_TO_UINT(cfg_V_UndervoltageWarningLevel*10.0));
	E300_Config_Buffer[175] := I2S_UndervoltageWarningLevel.OUT_SINT_1;
	E300_Config_Buffer[176] := I2S_UndervoltageWarningLevel.OUT_SINT_2;

	(* OvervoltageInhibitTime P359 *)
	E300_Config_Buffer[177] := cfg_V_OvervoltageInhibitTime;

	(* OvervoltageTripDelay P360 *)
	E300_Config_Buffer[178] := ANY_TO_USINT(cfg_V_OvervoltageTripDelay *10.0);

	(* OvervoltageTripLevel P361 *)
	I2S_OvervoltageTripLevel(ANY_TO_UINT(cfg_V_OvervoltageTripLevel*10.0));
	E300_Config_Buffer[179] := I2S_OvervoltageTripLevel.OUT_SINT_1;
	E300_Config_Buffer[180] := I2S_OvervoltageTripLevel.OUT_SINT_2;

	(* OvervoltageWarningLevel P362 *)
	I2S_OvervoltageWarningLevel(ANY_TO_UINT(cfg_V_OvervoltageWarningLevel*10.0));
	E300_Config_Buffer[181] := I2S_OvervoltageWarningLevel.OUT_SINT_1;
	E300_Config_Buffer[182] := I2S_OvervoltageWarningLevel.OUT_SINT_2;

	(* PhaseRotationInhibitTime P363 *)
	E300_Config_Buffer[170] := cfg_V_PhaseRotationInhibitTime;

	(* PhaseRotationTripType P364 *)
	(* E300_Config_Buffer[] := cfg_V_PhaseRotationTripType; *)

	(* VoltageImbalanceInhibitTime P365 *)
	E300_Config_Buffer[183] := cfg_V_VoltageImbalanceInhibitTime;

	(* VoltageImbalanceTripDelay P366 *)
	E300_Config_Buffer[184] := ANY_TO_USINT(cfg_V_VoltageImbalanceTripDelay *10.0);

	(* VoltageImbalanceTripLevel P367 *)
	E300_Config_Buffer[185] := cfg_V_VoltageImbalanceTripLevel;

	(* VoltageImbalanceWarningLevel P368 *)
	E300_Config_Buffer[186] := cfg_V_VoltageImbalanceWarningLevel;

	(* UnderfrequencyInhibitTime P369 *)
	E300_Config_Buffer[187] := cfg_V_UnderfrequencyInhibitTime;

	(* UnderfrequencyTripDelay P370 *)
	E300_Config_Buffer[188] := ANY_TO_USINT(cfg_V_UnderfrequencyTripDelay *10.0);

	(* UnderfrequencyTripLevel P371 *)
	E300_Config_Buffer[189] := cfg_V_UnderfrequencyTripLevel;

	(* UnderfrequencyWarningLevel P372 *)
	E300_Config_Buffer[190] := cfg_V_UnderfrequencyWarningLevel;

	(* OverfrequencyInhibitTime P373 *)
	E300_Config_Buffer[191] := cfg_V_OverfrequencyInhibitTime;

	(* OverfrequencyTripDelay P374 *)
	E300_Config_Buffer[192] := ANY_TO_USINT(cfg_V_OverfrequencyTripDelay *10.0);

	(* OverfrequencyTripLevel P375 *)
	E300_Config_Buffer[193] := cfg_V_OverfrequencyTripLevel;

	(* OverfrequencyWarningLevel P376 *)
	E300_Config_Buffer[194] := cfg_V_OverfrequencyWarningLevel;

	(* UnderRealPowerInhibitTime P378 *)
	E300_Config_Buffer[197] := cfg_P_UnderRealPowerInhibitTime;

	(* UnderRealPowerTripDelay P379 *)
	E300_Config_Buffer[198] := ANY_TO_USINT(cfg_P_UnderRealPowerTripDelay *10.0);

	(* UnderRealPowerTripLevel P380 *)
	D2S_UnderRealPowerTripLevel(ANY_TO_DINT(cfg_P_UnderRealPowerTripLevel*1000.0));
	E300_Config_Buffer[201] := D2S_UnderRealPowerTripLevel.OUT_SINT_1;
	E300_Config_Buffer[202] := D2S_UnderRealPowerTripLevel.OUT_SINT_2;
	E300_Config_Buffer[203] := D2S_UnderRealPowerTripLevel.OUT_SINT_3;
	E300_Config_Buffer[204] := D2S_UnderRealPowerTripLevel.OUT_SINT_4;

	(* UnderRealPowerWarningLevel P381 *)
	D2S_UnderRealPowerWarningLevel(ANY_TO_DINT(cfg_P_UnderRealPowerWarningLevel*1000.0));
	E300_Config_Buffer[205] := D2S_UnderRealPowerWarningLevel.OUT_SINT_1;
	E300_Config_Buffer[206] := D2S_UnderRealPowerWarningLevel.OUT_SINT_2;
	E300_Config_Buffer[207] := D2S_UnderRealPowerWarningLevel.OUT_SINT_3;
	E300_Config_Buffer[208] := D2S_UnderRealPowerWarningLevel.OUT_SINT_4;

	(* OverRealPowerInhibitTime P382 *)
	E300_Config_Buffer[199] := cfg_P_OverRealPowerInhibitTime;

	(* OverRealPowerTripDelay P383 *)
	E300_Config_Buffer[200] := ANY_TO_USINT(cfg_P_OverRealPowerTripDelay *10.0);

	(* OverRealPowerTripLevel P384 *)
	D2S_OverRealPowerTripLevel(ANY_TO_DINT(cfg_P_OverRealPowerTripLevel*1000.0));
	E300_Config_Buffer[209] := D2S_OverRealPowerTripLevel.OUT_SINT_1;
	E300_Config_Buffer[210] := D2S_OverRealPowerTripLevel.OUT_SINT_2;
	E300_Config_Buffer[211] := D2S_OverRealPowerTripLevel.OUT_SINT_3;
	E300_Config_Buffer[212] := D2S_OverRealPowerTripLevel.OUT_SINT_4;

	(* OverRealPowerWarningLevel P385 *)
	D2S_OverRealPowerWarningLevel(ANY_TO_DINT(cfg_P_OverRealPowerWarningLevel*1000.0));
	E300_Config_Buffer[213] := D2S_OverRealPowerWarningLevel.OUT_SINT_1;
	E300_Config_Buffer[214] := D2S_OverRealPowerWarningLevel.OUT_SINT_2;
	E300_Config_Buffer[215] := D2S_OverRealPowerWarningLevel.OUT_SINT_3;
	E300_Config_Buffer[216] := D2S_OverRealPowerWarningLevel.OUT_SINT_4;

	(* UnderReactiveConsumedPowerInhibitTime P386 *)
	E300_Config_Buffer[217] := cfg_P_UnderReactiveConsumedInhibitTime;

	(* UnderReactiveConsumedPowerTripDelay P387 *)
	E300_Config_Buffer[218] := ANY_TO_USINT(cfg_P_UnderReactiveConsumedTripDelay *10.0);

	(* UnderReactiveConsumedPowerTripLevel P388 *)
	D2S_UnderReactiveConsumedPowerTripLevel(ANY_TO_DINT(cfg_P_UnderReactiveConsumedTripLevel*1000.0));
	E300_Config_Buffer[221] := D2S_UnderReactiveConsumedPowerTripLevel.OUT_SINT_1;
	E300_Config_Buffer[222] := D2S_UnderReactiveConsumedPowerTripLevel.OUT_SINT_2;
	E300_Config_Buffer[223] := D2S_UnderReactiveConsumedPowerTripLevel.OUT_SINT_3;
	E300_Config_Buffer[224] := D2S_UnderReactiveConsumedPowerTripLevel.OUT_SINT_4;

	(* UnderReactiveConsumedPowerWarningLevel P389 *)
	D2S_UnderReactiveConsWarningLevel(ANY_TO_DINT(cfg_P_UnderReactiveConsumedWarningLevel*1000.0));
	E300_Config_Buffer[225] := D2S_UnderReactiveConsWarningLevel.OUT_SINT_1;
	E300_Config_Buffer[226] := D2S_UnderReactiveConsWarningLevel.OUT_SINT_2;
	E300_Config_Buffer[227] := D2S_UnderReactiveConsWarningLevel.OUT_SINT_3;
	E300_Config_Buffer[228] := D2S_UnderReactiveConsWarningLevel.OUT_SINT_4;

	(* OverReactiveConsumedPowerInhibitTime P390 *)
	E300_Config_Buffer[219] := cfg_P_OverReactiveConsumedInhibitTime;

	(* OverReactiveConsumedPowerTripDelay P391 *)
	E300_Config_Buffer[220] := ANY_TO_USINT(cfg_P_OverReactiveConsumedTripDelay *10.0);

	(* OverReactiveConsumedPowerTripLevel P392 *)
	D2S_OverReactiveConsumedPowerTripLevel(ANY_TO_DINT(cfg_P_OverReactiveConsumedTripLevel*1000.0));
	E300_Config_Buffer[229] := D2S_OverReactiveConsumedPowerTripLevel.OUT_SINT_1;
	E300_Config_Buffer[230] := D2S_OverReactiveConsumedPowerTripLevel.OUT_SINT_2;
	E300_Config_Buffer[231] := D2S_OverReactiveConsumedPowerTripLevel.OUT_SINT_3;
	E300_Config_Buffer[232] := D2S_OverReactiveConsumedPowerTripLevel.OUT_SINT_4;

	(* OverReactiveConsumedPowerWarningLevel P393 *)
	D2S_OverReactiveConsWarningLevel(ANY_TO_DINT(cfg_P_OverReactiveConsumedWarningLevel*1000.0));
	E300_Config_Buffer[233] := D2S_OverReactiveConsWarningLevel.OUT_SINT_1;
	E300_Config_Buffer[234] := D2S_OverReactiveConsWarningLevel.OUT_SINT_2;
	E300_Config_Buffer[235] := D2S_OverReactiveConsWarningLevel.OUT_SINT_3;
	E300_Config_Buffer[236] := D2S_OverReactiveConsWarningLevel.OUT_SINT_4;

	(* UnderReactiveGeneratedPowerInhibitTime P394 *)
	E300_Config_Buffer[237] := cfg_P_UnderReactiveGeneratedInhibitTime;

	(* UnderReactiveGeneratedPowerTripDelay P395 *)
	E300_Config_Buffer[238] := ANY_TO_USINT(cfg_P_UnderReactiveGeneratedTripDelay *10.0);

	(* UnderReactiveGeneratedPowerTripLevel P396 *)
	D2S_UnderReactiveGeneratedPowerTripLevel(ANY_TO_DINT(cfg_P_UnderReactiveGeneratedTripLevel*1000.0));
	E300_Config_Buffer[241] := D2S_UnderReactiveGeneratedPowerTripLevel.OUT_SINT_1;
	E300_Config_Buffer[242] := D2S_UnderReactiveGeneratedPowerTripLevel.OUT_SINT_2;
	E300_Config_Buffer[243] := D2S_UnderReactiveGeneratedPowerTripLevel.OUT_SINT_3;
	E300_Config_Buffer[244] := D2S_UnderReactiveGeneratedPowerTripLevel.OUT_SINT_4;

	(* UnderReactiveGeneratedPowerWarningLevel P397 *)
	D2S_UnderReactiveGenWarningLevel(ANY_TO_DINT(cfg_P_UnderReactiveGeneratedWarningLevel*1000.0));
	E300_Config_Buffer[245] := D2S_UnderReactiveGenWarningLevel.OUT_SINT_1;
	E300_Config_Buffer[246] := D2S_UnderReactiveGenWarningLevel.OUT_SINT_2;
	E300_Config_Buffer[247] := D2S_UnderReactiveGenWarningLevel.OUT_SINT_3;
	E300_Config_Buffer[248] := D2S_UnderReactiveGenWarningLevel.OUT_SINT_4;

	(* OverReactiveGeneratedPowerInhibitTime P398 *)
	E300_Config_Buffer[239] := cfg_P_OverReactiveGeneratedInhibitTime;

	(* OverReactiveGeneratedPowerTripDelay P399 *)
	E300_Config_Buffer[240] := ANY_TO_USINT(cfg_P_OverReactiveGeneratedTripDelay *10.0);

	(* OverReactiveGeneratedPowerTripLevel P400 *)
	D2S_OverReactiveGeneratedPowerTripLevel(ANY_TO_DINT(cfg_P_OverReactiveGeneratedTripLevel*1000.0));
	E300_Config_Buffer[249] := D2S_OverReactiveGeneratedPowerTripLevel.OUT_SINT_1;
	E300_Config_Buffer[250] := D2S_OverReactiveGeneratedPowerTripLevel.OUT_SINT_2;
	E300_Config_Buffer[251] := D2S_OverReactiveGeneratedPowerTripLevel.OUT_SINT_3;
	E300_Config_Buffer[252] := D2S_OverReactiveGeneratedPowerTripLevel.OUT_SINT_4;

	(* OverReactiveGeneratedPowerWarningLevel P401 *)
	D2S_OverReactiveGenWarningLevel(ANY_TO_DINT(cfg_P_OverReactiveGeneratedWarningLevel*1000.0));
	E300_Config_Buffer[253] := D2S_OverReactiveGenWarningLevel.OUT_SINT_1;
	E300_Config_Buffer[254] := D2S_OverReactiveGenWarningLevel.OUT_SINT_2;
	E300_Config_Buffer[255] := D2S_OverReactiveGenWarningLevel.OUT_SINT_3;
	E300_Config_Buffer[256] := D2S_OverReactiveGenWarningLevel.OUT_SINT_4;

	(* UnderApparentPowerInhibitTime P402 *)
	E300_Config_Buffer[257] := cfg_P_UnderApparentPowerInhibitTime;

	(* UnderApparentPowerTripDelay P403 *)
	E300_Config_Buffer[258] := ANY_TO_USINT(cfg_P_UnderApparentPowerTripDelay *10.0);

	(* UnderApparentPowerTripLevel P404 *)
	D2S_UnderApparentPowerTripLevel(ANY_TO_DINT(cfg_P_UnderApparentPowerTripLevel*1000.0));
	E300_Config_Buffer[261] := D2S_UnderApparentPowerTripLevel.OUT_SINT_1;
	E300_Config_Buffer[262] := D2S_UnderApparentPowerTripLevel.OUT_SINT_2;
	E300_Config_Buffer[263] := D2S_UnderApparentPowerTripLevel.OUT_SINT_3;
	E300_Config_Buffer[264] := D2S_UnderApparentPowerTripLevel.OUT_SINT_4;

	(* UnderApparentPowerWarningLevel P405 *)
	D2S_UnderApparentPowerWarningLevel(ANY_TO_DINT(cfg_P_UnderApparentPowerWarningLevel*1000.0));
	E300_Config_Buffer[265] := D2S_UnderApparentPowerWarningLevel.OUT_SINT_1;
	E300_Config_Buffer[266] := D2S_UnderApparentPowerWarningLevel.OUT_SINT_2;
	E300_Config_Buffer[267] := D2S_UnderApparentPowerWarningLevel.OUT_SINT_3;
	E300_Config_Buffer[268] := D2S_UnderApparentPowerWarningLevel.OUT_SINT_4;

	(* OverApparentPowerInhibitTime P406 *)
	E300_Config_Buffer[259] := cfg_P_OverApparentPowerInhibitTime;

	(* OverApparentPowerTripDelay P407 *)
	E300_Config_Buffer[260] := ANY_TO_USINT(cfg_P_OverApparentPowerTripDelay *10.0);

	(* OverApparentPowerTripLevel P408 *)
	D2S_OverApparentPowerTripLevel(ANY_TO_DINT(cfg_P_OverApparentPowerTripLevel*1000.0));
	E300_Config_Buffer[269] := D2S_OverApparentPowerTripLevel.OUT_SINT_1;
	E300_Config_Buffer[270] := D2S_OverApparentPowerTripLevel.OUT_SINT_2;
	E300_Config_Buffer[271] := D2S_OverApparentPowerTripLevel.OUT_SINT_3;
	E300_Config_Buffer[272] := D2S_OverApparentPowerTripLevel.OUT_SINT_4;

	(* OverApparentPowerWarningLevel P409 *)
	D2S_OverApparentPowerWarningLevel(ANY_TO_DINT(cfg_P_OverApparentPowerWarningLevel*1000.0));
	E300_Config_Buffer[273] := D2S_OverApparentPowerWarningLevel.OUT_SINT_1;
	E300_Config_Buffer[274] := D2S_OverApparentPowerWarningLevel.OUT_SINT_2;
	E300_Config_Buffer[275] := D2S_OverApparentPowerWarningLevel.OUT_SINT_3;
	E300_Config_Buffer[276] := D2S_OverApparentPowerWarningLevel.OUT_SINT_4;

	(* UnderPowerFactorLagInhibitTime P410 *)
	E300_Config_Buffer[277] := cfg_P_UnderPowerFactorLagInhibitTime;

	(* UnderPowerFactorLagTripDelay P411 *)
	E300_Config_Buffer[278] := ANY_TO_USINT(cfg_P_UnderPowerFactorLagTripDelay *10.0);

	(* UnderPowerFactorLagTripLevel P412 *)
	S2U_UnderPFLagTripLevel(cfg_P_UnderPowerFactorLagTripLevel);
	E300_Config_Buffer[279] := S2U_UnderPFLagTripLevel.OUT_SINT_1;

	(* UnderPowerFactorLagWarningLevel P413 *)
	S2U_UnderPFLagWarningLevel(cfg_P_UnderPowerFactorLagWarningLevel);
	E300_Config_Buffer[280] := S2U_UnderPFLagWarningLevel.OUT_SINT_1;

	(* OverPowerFactorLagInhibitTime P414 *)
	E300_Config_Buffer[281] := cfg_P_OverPowerFactorLagInhibitTime;

	(* OverPowerFactorLagTripDelay P415 *)
	E300_Config_Buffer[282] := cfg_P_OverPowerFactorLagTripDelay;

	(* OverPowerFactorLagTripLevel P416 *)
	S2U_OverPFLagTripLevel(cfg_P_OverPowerFactorLagTripLevel);
	E300_Config_Buffer[283] := S2U_OverPFLagTripLevel.OUT_SINT_1;

	(* OverPowerFactorLagWarningLevel P417 *)
	S2U_OverPFLagWarningLevel(ANY_TO_SINT(cfg_P_OverPowerFactorLagWarningLevel));
	E300_Config_Buffer[284] := S2U_OverPFLagWarningLevel.OUT_SINT_1;

	(* UnderPowerFactorLeadInhibitTime P418 *)
	E300_Config_Buffer[285] := cfg_P_UnderPowerFactorLeadInhibitTime;

	(* UnderPowerFactorLeadTripDelay P419 *)
	E300_Config_Buffer[286] := ANY_TO_USINT(cfg_P_UnderPowerFactorLeadTripDelay *10.0);

	(* UnderPowerFactorLeadTripLevel P420 *)
	E300_Config_Buffer[287] := cfg_P_UnderPowerFactorLeadTripLevel;

	(* UnderPowerFactorLeadWarningLevel P421 *)
	E300_Config_Buffer[288] := cfg_P_UnderPowerFactorLeadWarningLevel;

	(* OverPowerFactorLeadInhibitTime P422 *)
	E300_Config_Buffer[289] := cfg_P_OverPowerFactorLeadInhibitTime;

	(* OverPowerFactorLeadTripDelay P423 *)
	E300_Config_Buffer[290] := ANY_TO_USINT(cfg_P_OverPowerFactorLeadTripDelay *10.0);

	(* OverPowerFactorLeadTripLevel P424 *)
	E300_Config_Buffer[291] := cfg_P_OverPowerFactorLeadTripLevel;

	(* OverPowerFactorLeadWarningLevel P425 *)
	E300_Config_Buffer[292] := cfg_P_OverPowerFactorLeadWarningLevel;
	
	WriteE300ConfigData(TRUE, E300_IP_ADDRESS, E300_SCAN_RATE, TRUE, E300_Config_Buffer);
	
	IF WriteE300ConfigData.MSGObjRead.Q THEN
		cfg_WRITE := FALSE;	
	END_IF;

END_IF;



END_PROGRAM