First string implemented
This commit is contained in:
14
PLC/DUTs/ST_MODULE_VOLT_CONFIG.TcDUT
Normal file
14
PLC/DUTs/ST_MODULE_VOLT_CONFIG.TcDUT
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.12">
|
||||
<DUT Name="ST_MODULE_VOLT_CONFIG" Id="{5bd0445f-1079-4488-9137-b6d029b50b39}">
|
||||
<Declaration><![CDATA[TYPE ST_MODULE_VOLT_CONFIG :
|
||||
STRUCT
|
||||
xUnit1Is1500V : BOOL;
|
||||
xUnit2Is1500V : BOOL;
|
||||
xUnit3Is1500V : BOOL;
|
||||
xUnit4Is1500V : BOOL;
|
||||
END_STRUCT
|
||||
END_TYPE
|
||||
]]></Declaration>
|
||||
</DUT>
|
||||
</TcPlcObject>
|
||||
13
PLC/DUTs/ST_STRING_VOLT_CONFIG.TcDUT
Normal file
13
PLC/DUTs/ST_STRING_VOLT_CONFIG.TcDUT
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.12">
|
||||
<DUT Name="ST_STRING_VOLT_CONFIG" Id="{9f94c15d-9aa7-4320-915e-f68d4e087e39}">
|
||||
<Declaration><![CDATA[TYPE ST_STRING_VOLT_CONFIG :
|
||||
STRUCT
|
||||
stModule1VoltConfig : ST_MODULE_VOLT_CONFIG;
|
||||
stModule2VoltConfig : ST_MODULE_VOLT_CONFIG;
|
||||
stModule3VoltConfig : ST_MODULE_VOLT_CONFIG;
|
||||
END_STRUCT
|
||||
END_TYPE
|
||||
]]></Declaration>
|
||||
</DUT>
|
||||
</TcPlcObject>
|
||||
@@ -5,49 +5,49 @@
|
||||
STRUCT
|
||||
// Pump posolyt
|
||||
// ===================================
|
||||
stPosolytPump : ST_HMI_ANALOG_MOTOR_DATA;
|
||||
stNS11 : ST_HMI_ANALOG_MOTOR_DATA;
|
||||
|
||||
|
||||
// Pump negolyt
|
||||
// ===================================
|
||||
stNegolytPump : ST_HMI_ANALOG_MOTOR_DATA;
|
||||
stNS21 : ST_HMI_ANALOG_MOTOR_DATA;
|
||||
|
||||
|
||||
// Valve posolyt
|
||||
// ===================================
|
||||
stPosolytValve : ST_HMI_VALVE_DATA;
|
||||
stNS12 : ST_HMI_VALVE_DATA;
|
||||
|
||||
|
||||
// Valve negolyt
|
||||
// ===================================
|
||||
stNegolytValve : ST_HMI_VALVE_DATA;
|
||||
stNS22 : ST_HMI_VALVE_DATA;
|
||||
|
||||
|
||||
// Drucksensoren Posolyt
|
||||
//====================================
|
||||
stPosolytPressureSegmentInlet : ST_HMI_ANALOG_VALUE;
|
||||
stPosolytPressureTankInlet : ST_HMI_ANALOG_VALUE;
|
||||
stP11 : ST_HMI_ANALOG_VALUE;
|
||||
stP12 : ST_HMI_ANALOG_VALUE;
|
||||
|
||||
|
||||
// Drucksensoren Negolyt
|
||||
//====================================
|
||||
stNegolytPressureSegmentInlet : ST_HMI_ANALOG_VALUE;
|
||||
stNegolytPressureTankInlet : ST_HMI_ANALOG_VALUE;
|
||||
stP21 : ST_HMI_ANALOG_VALUE;
|
||||
stP22 : ST_HMI_ANALOG_VALUE;
|
||||
|
||||
|
||||
// Temperature sensor posolyt tank inlet
|
||||
//====================================
|
||||
stPosolytTempTankInlet : ST_HMI_ANALOG_VALUE;
|
||||
stT11 : ST_HMI_ANALOG_VALUE;
|
||||
|
||||
|
||||
// Temperature sensor negolyt tank inlet
|
||||
//====================================
|
||||
stNegolytTempTankInlet : ST_HMI_ANALOG_VALUE;
|
||||
stT21 : ST_HMI_ANALOG_VALUE;
|
||||
|
||||
|
||||
// Voltage sensors
|
||||
// ===================================
|
||||
stVoltageSegment : ST_HMI_ANALOG_VALUE;
|
||||
stE31 : ST_HMI_ANALOG_VALUE;
|
||||
|
||||
|
||||
// Current voltage for HMI
|
||||
|
||||
@@ -167,6 +167,38 @@ VAR_GLOBAL PERSISTENT
|
||||
rMaxDeltaPSegmentInlet := 100.0
|
||||
);
|
||||
|
||||
// ===========================
|
||||
// Part shortage workaround
|
||||
// ===========================
|
||||
stConfigVoltageSegment1500 : ST_ANALOG_IO_CONFIG := (iAIMax := 32767, iAIMin := 0, rPVMax := 1500, rPVMin := 0, sUnit := 'V');
|
||||
stString1VoltageConfig : ST_STRING_VOLT_CONFIG :=
|
||||
(
|
||||
stModule1VoltConfig :=
|
||||
(
|
||||
xUnit1Is1500V := FALSE,
|
||||
xUnit2Is1500V := TRUE,
|
||||
xUnit3Is1500V := TRUE,
|
||||
xUnit4Is1500V := TRUE
|
||||
),
|
||||
|
||||
stModule2VoltConfig :=
|
||||
(
|
||||
xUnit1Is1500V := FALSE,
|
||||
xUnit2Is1500V := FALSE,
|
||||
xUnit3Is1500V := FALSE,
|
||||
xUnit4Is1500V := FALSE
|
||||
),
|
||||
|
||||
stModule3VoltConfig :=
|
||||
(
|
||||
xUnit1Is1500V := FALSE,
|
||||
xUnit2Is1500V := TRUE,
|
||||
xUnit3Is1500V := TRUE,
|
||||
xUnit4Is1500V := TRUE
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
// ===========================
|
||||
// General settings
|
||||
// ===========================
|
||||
@@ -208,7 +240,7 @@ VAR_GLOBAL PERSISTENT
|
||||
diMaxStringDischargePower : DINT := 60_000;
|
||||
|
||||
// Inverter ip address
|
||||
sInverterIp : STRING := '192.168.42.11';
|
||||
sInverterIp : STRING := '192.168.42.10';
|
||||
|
||||
// Absolute shutdown discharge power (Watt)
|
||||
// 12.000 W -> 1.000 W per unit
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<GVL Name="GVL_SCADA" Id="{8186ff04-764f-4b24-8a6b-d0a44d528e6f}">
|
||||
<Declaration><![CDATA[{attribute 'qualified_only'}
|
||||
VAR_GLOBAL
|
||||
stHMIInterface : ST_STRING_HMI_INTERFACE;
|
||||
stHMIInterface : ARRAY [0..1] OF ST_STRING_HMI_INTERFACE;
|
||||
|
||||
stAckAlarmsButton : ST_HMI_CONTROL_BUTTON := (xRelease := TRUE);
|
||||
|
||||
@@ -14,6 +14,9 @@ VAR_GLOBAL
|
||||
|
||||
// Current control mode
|
||||
eCurrentControlMode : E_BMS_CONTROL_MODE;
|
||||
|
||||
// Can change current control mode
|
||||
xCanChangeControlMode : BOOL;
|
||||
END_VAR]]></Declaration>
|
||||
</GVL>
|
||||
</TcPlcObject>
|
||||
@@ -54,9 +54,15 @@
|
||||
<Compile Include="DUTs\ST_MODULE_HMI_INTERFACE.TcDUT">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="DUTs\ST_MODULE_VOLT_CONFIG.TcDUT">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="DUTs\ST_STRING_HMI_INTERFACE.TcDUT">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="DUTs\ST_STRING_VOLT_CONFIG.TcDUT">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="DUTs\ST_UNIT_HMI_INTERFACE.TcDUT">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
@@ -85,6 +91,9 @@
|
||||
<Compile Include="POUs\FB_Module.TcPOU">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="POUs\FB_Safety.TcPOU">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="POUs\FB_String.TcPOU">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
|
||||
460
PLC/PLC.tmc
460
PLC/PLC.tmc
File diff suppressed because one or more lines are too long
@@ -9,6 +9,9 @@ VAR_INPUT
|
||||
// Enable
|
||||
xEnable : BOOL;
|
||||
|
||||
// Component shortage workaround
|
||||
stModuleVoltageConfig : ST_MODULE_VOLT_CONFIG;
|
||||
|
||||
// Module in safety check mode
|
||||
xInSafetyCheckMode : BOOL;
|
||||
|
||||
@@ -56,10 +59,10 @@ VAR_OUTPUT
|
||||
xAllUnitsInAutomatic : BOOL;
|
||||
END_VAR
|
||||
VAR
|
||||
_fbUnit1 : FB_Unit('Unit 1');
|
||||
_fbUnit2 : FB_Unit('Unit 2');
|
||||
_fbUnit3 : FB_Unit('Unit 3');
|
||||
_fbUnit4 : FB_Unit('Unit 4');
|
||||
_fbUnit1 : FB_Unit(CONCAT(Name, ' - Unit 1'));
|
||||
_fbUnit2 : FB_Unit(CONCAT(Name, ' - Unit 2'));
|
||||
_fbUnit3 : FB_Unit(CONCAT(Name, ' - Unit 3'));
|
||||
_fbUnit4 : FB_Unit(CONCAT(Name, ' - Unit 4'));
|
||||
|
||||
// Flag for unit balance checking
|
||||
_xBalanceOk : BOOL;
|
||||
@@ -70,8 +73,13 @@ VAR
|
||||
// Units out of balance alarm
|
||||
_fbUnitsOutOfBalanceAlarm : FB_TcAlarm;
|
||||
|
||||
// Enable balance check
|
||||
_xEnableBalanceCheck : BOOL;
|
||||
|
||||
// Module name
|
||||
_sName : STRING;
|
||||
|
||||
_fbBalanceNotOkSignal : FB_ReleaseSignal;
|
||||
END_VAR
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
@@ -91,12 +99,11 @@ xSafetyIntlksOk := TRUE;
|
||||
// ===============================
|
||||
_fbUnit1(
|
||||
xEnable := xEnable,
|
||||
xVoltageSensorIs1500V := stModuleVoltageConfig.xUnit1Is1500V,
|
||||
xInSafetyCheckMode := xInSafetyCheckMode,
|
||||
stUnitConfig:= GVL_CONFIG.stUnitConfig,
|
||||
stHMIInterface:= stHMIInterface.stHMIInterfaceUnit1,
|
||||
xEmergencyStopOk:= xEmergencyStopOk,
|
||||
rSetpointPosolytPumpInlet:= GVL_CONFIG.rPumpPosolytOnPower,
|
||||
rSetpointNegolytPumpInlet:= GVL_CONFIG.rPumpNegolytOnPower,
|
||||
xReleaseErrors:= xReleaseErrors,
|
||||
xReleaseLimitErrors:= xReleaseLimitErrors,
|
||||
xConfirmAlarms:= xConfirmAlarms,
|
||||
@@ -125,12 +132,11 @@ END_IF
|
||||
// ===============================
|
||||
_fbUnit2(
|
||||
xEnable := xEnable,
|
||||
xVoltageSensorIs1500V := stModuleVoltageConfig.xUnit2Is1500V,
|
||||
xInSafetyCheckMode := xInSafetyCheckMode,
|
||||
stUnitConfig:= GVL_CONFIG.stUnitConfig,
|
||||
stHMIInterface:= stHMIInterface.stHMIInterfaceUnit2,
|
||||
xEmergencyStopOk:= xEmergencyStopOk,
|
||||
rSetpointPosolytPumpInlet:= GVL_CONFIG.rPumpPosolytOnPower,
|
||||
rSetpointNegolytPumpInlet:= GVL_CONFIG.rPumpNegolytOnPower,
|
||||
xReleaseErrors:= xReleaseErrors,
|
||||
xReleaseLimitErrors:= xReleaseLimitErrors,
|
||||
xConfirmAlarms:= xConfirmAlarms,
|
||||
@@ -159,12 +165,11 @@ END_IF
|
||||
// ===============================
|
||||
_fbUnit3(
|
||||
xEnable := xEnable,
|
||||
xVoltageSensorIs1500V := stModuleVoltageConfig.xUnit3Is1500V,
|
||||
xInSafetyCheckMode := xInSafetyCheckMode,
|
||||
stUnitConfig:= GVL_CONFIG.stUnitConfig,
|
||||
stHMIInterface:= stHMIInterface.stHMIInterfaceUnit3,
|
||||
xEmergencyStopOk:= xEmergencyStopOk,
|
||||
rSetpointPosolytPumpInlet:= GVL_CONFIG.rPumpPosolytOnPower,
|
||||
rSetpointNegolytPumpInlet:= GVL_CONFIG.rPumpNegolytOnPower,
|
||||
xReleaseErrors:= xReleaseErrors,
|
||||
xReleaseLimitErrors:= xReleaseLimitErrors,
|
||||
xConfirmAlarms:= xConfirmAlarms,
|
||||
@@ -193,12 +198,11 @@ END_IF
|
||||
// ===============================
|
||||
_fbUnit4(
|
||||
xEnable := xEnable,
|
||||
xVoltageSensorIs1500V := stModuleVoltageConfig.xUnit4Is1500V,
|
||||
xInSafetyCheckMode := xInSafetyCheckMode,
|
||||
stUnitConfig:= GVL_CONFIG.stUnitConfig,
|
||||
stHMIInterface:= stHMIInterface.stHMIInterfaceUnit4,
|
||||
xEmergencyStopOk:= xEmergencyStopOk,
|
||||
rSetpointPosolytPumpInlet:= GVL_CONFIG.rPumpPosolytOnPower,
|
||||
rSetpointNegolytPumpInlet:= GVL_CONFIG.rPumpNegolytOnPower,
|
||||
xReleaseErrors:= xReleaseErrors,
|
||||
xReleaseLimitErrors:= xReleaseLimitErrors,
|
||||
xConfirmAlarms:= xConfirmAlarms,
|
||||
@@ -288,8 +292,16 @@ IF ABS(_fbUnit3.rCurrentVoltage - _fbUnit4.rCurrentVoltage) > GVL_CONFIG.rMaxAbs
|
||||
_xBalanceOk := FALSE;
|
||||
END_IF
|
||||
|
||||
// Release signal for balance not ok
|
||||
_fbBalanceNotOkSignal(
|
||||
xSignal:= _xBalanceOk OR (NOT xEnable),
|
||||
xRelease:= TRUE,
|
||||
timOnDelay:= T#5S,
|
||||
timOffDelay:= T#60S,
|
||||
xReleaseSignal=> );
|
||||
|
||||
// Signal an error if all units are ready and module is out of balance
|
||||
IF _xAllUnitsReady AND (NOT _xBalanceOk) THEN
|
||||
IF _xAllUnitsReady AND (NOT _fbBalanceNotOkSignal.xReleaseSignal) THEN
|
||||
xError := TRUE;
|
||||
END_IF
|
||||
|
||||
@@ -387,14 +399,27 @@ _fbUnitsOutOfBalanceAlarm.ipArguments.Clear().AddString(_sName);]]></ST>
|
||||
</Property>
|
||||
<LineIds Name="FB_Module">
|
||||
<LineId Id="903" Count="15" />
|
||||
<LineId Id="1305" Count="0" />
|
||||
<LineId Id="1226" Count="0" />
|
||||
<LineId Id="919" Count="32" />
|
||||
<LineId Id="919" Count="2" />
|
||||
<LineId Id="924" Count="27" />
|
||||
<LineId Id="1306" Count="0" />
|
||||
<LineId Id="1227" Count="0" />
|
||||
<LineId Id="952" Count="32" />
|
||||
<LineId Id="952" Count="2" />
|
||||
<LineId Id="957" Count="27" />
|
||||
<LineId Id="1307" Count="0" />
|
||||
<LineId Id="1228" Count="0" />
|
||||
<LineId Id="985" Count="32" />
|
||||
<LineId Id="985" Count="2" />
|
||||
<LineId Id="990" Count="27" />
|
||||
<LineId Id="1308" Count="0" />
|
||||
<LineId Id="1229" Count="0" />
|
||||
<LineId Id="1018" Count="135" />
|
||||
<LineId Id="1018" Count="2" />
|
||||
<LineId Id="1023" Count="87" />
|
||||
<LineId Id="1387" Count="0" />
|
||||
<LineId Id="1386" Count="0" />
|
||||
<LineId Id="1389" Count="4" />
|
||||
<LineId Id="1388" Count="0" />
|
||||
<LineId Id="1111" Count="42" />
|
||||
<LineId Id="674" Count="0" />
|
||||
</LineIds>
|
||||
<LineIds Name="FB_Module.FB_init">
|
||||
|
||||
65
PLC/POUs/FB_Safety.TcPOU
Normal file
65
PLC/POUs/FB_Safety.TcPOU
Normal file
@@ -0,0 +1,65 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.12">
|
||||
<POU Name="FB_Safety" Id="{f74eb8e4-e878-485f-9706-8dd039061a6b}" SpecialFunc="None">
|
||||
<Declaration><![CDATA[FUNCTION_BLOCK FB_Safety
|
||||
VAR_INPUT
|
||||
xVoltagesInRange AT %I* : BOOL;
|
||||
xPressureInRange AT %I* : BOOL;
|
||||
xTemperaturesInRange AT %I* : BOOL;
|
||||
|
||||
xReset : BOOL;
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
END_VAR
|
||||
VAR
|
||||
_latchedVoltages : BOOL;
|
||||
_latchedPressures : BOOL;
|
||||
_latechedTemperatures : BOOL;
|
||||
|
||||
_xErrorLatched : BOOL;
|
||||
END_VAR
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[IF xReset THEN
|
||||
xReset := FALSE;
|
||||
_latchedVoltages := FALSE;
|
||||
_latchedPressures := FALSE;
|
||||
_latechedTemperatures := FALSE;
|
||||
_xErrorLatched := FALSE;
|
||||
END_IF
|
||||
|
||||
IF (NOT xVoltagesInRange) AND NOT _xErrorLatched THEN
|
||||
_latchedVoltages := TRUE;
|
||||
_xErrorLatched := TRUE;
|
||||
END_IF
|
||||
|
||||
IF (NOT xPressureInRange) AND NOT _xErrorLatched THEN
|
||||
_latchedPressures := TRUE;
|
||||
_xErrorLatched := TRUE;
|
||||
END_IF
|
||||
|
||||
IF (NOT xTemperaturesInRange) AND NOT _xErrorLatched THEN
|
||||
_latechedTemperatures := TRUE;
|
||||
_xErrorLatched := TRUE;
|
||||
END_IF]]></ST>
|
||||
</Implementation>
|
||||
<LineIds Name="FB_Safety">
|
||||
<LineId Id="28" Count="0" />
|
||||
<LineId Id="30" Count="0" />
|
||||
<LineId Id="32" Count="2" />
|
||||
<LineId Id="40" Count="0" />
|
||||
<LineId Id="31" Count="0" />
|
||||
<LineId Id="29" Count="0" />
|
||||
<LineId Id="9" Count="0" />
|
||||
<LineId Id="18" Count="0" />
|
||||
<LineId Id="37" Count="0" />
|
||||
<LineId Id="19" Count="0" />
|
||||
<LineId Id="21" Count="2" />
|
||||
<LineId Id="38" Count="0" />
|
||||
<LineId Id="20" Count="0" />
|
||||
<LineId Id="25" Count="2" />
|
||||
<LineId Id="39" Count="0" />
|
||||
<LineId Id="24" Count="0" />
|
||||
</LineIds>
|
||||
</POU>
|
||||
</TcPlcObject>
|
||||
@@ -8,6 +8,9 @@ VAR_INPUT
|
||||
|
||||
// String in safety check mode
|
||||
xInSafetyCheckMode : BOOL;
|
||||
|
||||
// Components shortage workaround
|
||||
stStringModuleVoltageConfig : ST_STRING_VOLT_CONFIG;
|
||||
|
||||
// Module 1 HMI interface
|
||||
stHMIInterface : REFERENCE TO ST_STRING_HMI_INTERFACE;
|
||||
@@ -67,9 +70,9 @@ VAR_OUTPUT
|
||||
eStatus : E_COMPONENT_STATUS;
|
||||
END_VAR
|
||||
VAR
|
||||
_fbModule1 : FB_Module('Module 1');
|
||||
_fbModule2 : FB_Module('Module 2');
|
||||
_fbModule3 : FB_Module('Module 3');
|
||||
_fbModule1 : FB_Module(CONCAT(Name,' - Module 1'));
|
||||
_fbModule2 : FB_Module(CONCAT(Name,' - Module 2'));
|
||||
_fbModule3 : FB_Module(CONCAT(Name,' - Module 3'));
|
||||
|
||||
// All modules are ready
|
||||
_xAllModulesReady : BOOL;
|
||||
@@ -95,6 +98,9 @@ VAR
|
||||
// Error timer for not closing dc relais
|
||||
_tonErrorDCCBNotClosed : TON := (PT := T#5S);
|
||||
|
||||
// Delayed balance check signal
|
||||
_fbBalanceNotOkSignal : FB_ReleaseSignal;
|
||||
|
||||
// String name
|
||||
_sName : STRING;
|
||||
END_VAR
|
||||
@@ -117,6 +123,7 @@ xResetSafetyDCCB := xResetSafety;
|
||||
// ===============================
|
||||
_fbModule1(
|
||||
xEnable := xEnable,
|
||||
stModuleVoltageConfig := stStringModuleVoltageConfig.stModule1VoltConfig,
|
||||
xInSafetyCheckMode := xInSafetyCheckMode,
|
||||
xEmergencyStopOk:= xEmergencyStopOk,
|
||||
stHMIInterface:= stHMIInterface.stHMIInterfaceModule1,
|
||||
@@ -148,6 +155,7 @@ END_IF
|
||||
|
||||
_fbModule2(
|
||||
xEnable := xEnable,
|
||||
stModuleVoltageConfig := stStringModuleVoltageConfig.stModule2VoltConfig,
|
||||
xInSafetyCheckMode := xInSafetyCheckMode,
|
||||
xEmergencyStopOk:= xEmergencyStopOk,
|
||||
stHMIInterface:= stHMIInterface.stHMIInterfaceModule2,
|
||||
@@ -178,6 +186,7 @@ END_IF
|
||||
// ===============================
|
||||
_fbModule3(
|
||||
xEnable := xEnable,
|
||||
stModuleVoltageConfig := stStringModuleVoltageConfig.stModule3VoltConfig,
|
||||
xInSafetyCheckMode := xInSafetyCheckMode,
|
||||
xEmergencyStopOk:= xEmergencyStopOk,
|
||||
stHMIInterface:= stHMIInterface.stHMIInterfaceModule3,
|
||||
@@ -218,7 +227,7 @@ END_IF
|
||||
// ===============================
|
||||
// Modules ready check
|
||||
// ===============================
|
||||
_xAllModulesReady := _fbModule1.xReady AND _fbModule3.xReady; // _fbModule2.xReady AND
|
||||
_xAllModulesReady := _fbModule1.xReady AND _fbModule2.xReady AND _fbModule3.xReady;
|
||||
|
||||
|
||||
// ===============================
|
||||
@@ -265,19 +274,26 @@ IF ABS(_fbModule2.rCurrentVoltage - _fbModule3.rCurrentVoltage) > GVL_CONFIG.rMa
|
||||
_xBalanceOk := FALSE;
|
||||
END_IF
|
||||
|
||||
// Release signal for balance not ok
|
||||
_fbBalanceNotOkSignal(
|
||||
xSignal:= _xBalanceOk OR (NOT xEnable),
|
||||
xRelease:= TRUE,
|
||||
timOnDelay:= T#5S,
|
||||
timOffDelay:= T#60S,
|
||||
xReleaseSignal=> );
|
||||
|
||||
// Signal an error if all units are ready and module is out of balance
|
||||
IF _xAllModulesReady AND (NOT _xBalanceOk) THEN
|
||||
IF _xAllModulesReady AND (NOT _fbBalanceNotOkSignal.xReleaseSignal) THEN
|
||||
xError := TRUE;
|
||||
END_IF
|
||||
|
||||
// Raise error
|
||||
IF (NOT _xBalanceOk) AND (NOT _fbModulesOutOfBalanceAlarm.bRaised) THEN
|
||||
IF (NOT _fbBalanceNotOkSignal.xReleaseSignal) AND (NOT _fbModulesOutOfBalanceAlarm.bRaised) THEN
|
||||
_fbModulesOutOfBalanceAlarm.Raise(0);
|
||||
END_IF
|
||||
|
||||
// Clear error
|
||||
IF _xBalanceOk AND _fbModulesOutOfBalanceAlarm.bRaised THEN
|
||||
IF _fbBalanceNotOkSignal.xReleaseSignal AND _fbModulesOutOfBalanceAlarm.bRaised THEN
|
||||
_fbModulesOutOfBalanceAlarm.Clear(0, FALSE);
|
||||
END_IF
|
||||
|
||||
@@ -294,7 +310,7 @@ _tonErrorDCCBNotClosed();
|
||||
|
||||
CASE _iState OF
|
||||
0: // Idle
|
||||
IF _xAllModulesReady AND _xBalanceOk AND xAllModulesInAutoMode THEN
|
||||
IF _xAllModulesReady AND _xBalanceOk AND xAllModulesInAutoMode AND xEnable THEN
|
||||
xCloseDCCB := TRUE;
|
||||
xResetSafetyDCCB := TRUE;
|
||||
_tonResetPulseLength.IN := TRUE;
|
||||
@@ -316,6 +332,7 @@ CASE _iState OF
|
||||
END_IF
|
||||
IF _tonErrorDCCBNotClosed.Q THEN
|
||||
_tonErrorDCCBNotClosed.IN := FALSE;
|
||||
xError := TRUE;
|
||||
xReady := FALSE;
|
||||
_iState := 1000;
|
||||
END_IF
|
||||
@@ -326,10 +343,12 @@ CASE _iState OF
|
||||
// OTHERWISE THE DC CIRCUIT BREAKERS WILL OPEN WHILE THE INVERTER IS STILL ACTIVE
|
||||
// THIS CAN DAMAGE THE INVERTER
|
||||
IF NOT xEnable THEN
|
||||
xCloseDCCB := FALSE;
|
||||
// xCloseDCCB := FALSE;
|
||||
_iState := 0;
|
||||
ELSIF NOT _xAllModulesReady OR NOT _xBalanceOk THEN
|
||||
xError := TRUE;
|
||||
// xCloseDCCB := FALSE;
|
||||
_iState := 1000;
|
||||
END_IF
|
||||
|
||||
1000: // Error state
|
||||
@@ -434,6 +453,7 @@ _fbSafetyInterlocksNotOkAlarm.ipArguments.Clear().AddString(_sName);]]></ST>
|
||||
<LineId Id="67" Count="1" />
|
||||
<LineId Id="47" Count="0" />
|
||||
<LineId Id="140" Count="0" />
|
||||
<LineId Id="978" Count="0" />
|
||||
<LineId Id="875" Count="0" />
|
||||
<LineId Id="48" Count="0" />
|
||||
<LineId Id="50" Count="2" />
|
||||
@@ -455,6 +475,7 @@ _fbSafetyInterlocksNotOkAlarm.ipArguments.Clear().AddString(_sName);]]></ST>
|
||||
<LineId Id="871" Count="0" />
|
||||
<LineId Id="76" Count="0" />
|
||||
<LineId Id="141" Count="0" />
|
||||
<LineId Id="979" Count="0" />
|
||||
<LineId Id="876" Count="0" />
|
||||
<LineId Id="77" Count="3" />
|
||||
<LineId Id="601" Count="0" />
|
||||
@@ -466,6 +487,7 @@ _fbSafetyInterlocksNotOkAlarm.ipArguments.Clear().AddString(_sName);]]></ST>
|
||||
<LineId Id="764" Count="0" />
|
||||
<LineId Id="90" Count="5" />
|
||||
<LineId Id="142" Count="0" />
|
||||
<LineId Id="980" Count="0" />
|
||||
<LineId Id="877" Count="0" />
|
||||
<LineId Id="96" Count="3" />
|
||||
<LineId Id="602" Count="0" />
|
||||
@@ -503,6 +525,7 @@ _fbSafetyInterlocksNotOkAlarm.ipArguments.Clear().AddString(_sName);]]></ST>
|
||||
<LineId Id="212" Count="0" />
|
||||
<LineId Id="237" Count="1" />
|
||||
<LineId Id="236" Count="0" />
|
||||
<LineId Id="1187" Count="6" />
|
||||
<LineId Id="215" Count="5" />
|
||||
<LineId Id="353" Count="13" />
|
||||
<LineId Id="352" Count="0" />
|
||||
@@ -529,6 +552,7 @@ _fbSafetyInterlocksNotOkAlarm.ipArguments.Clear().AddString(_sName);]]></ST>
|
||||
<LineId Id="739" Count="1" />
|
||||
<LineId Id="720" Count="0" />
|
||||
<LineId Id="744" Count="0" />
|
||||
<LineId Id="1194" Count="0" />
|
||||
<LineId Id="746" Count="0" />
|
||||
<LineId Id="727" Count="1" />
|
||||
<LineId Id="718" Count="0" />
|
||||
@@ -537,7 +561,10 @@ _fbSafetyInterlocksNotOkAlarm.ipArguments.Clear().AddString(_sName);]]></ST>
|
||||
<LineId Id="741" Count="0" />
|
||||
<LineId Id="749" Count="0" />
|
||||
<LineId Id="742" Count="1" />
|
||||
<LineId Id="716" Count="1" />
|
||||
<LineId Id="716" Count="0" />
|
||||
<LineId Id="1082" Count="0" />
|
||||
<LineId Id="1081" Count="0" />
|
||||
<LineId Id="717" Count="0" />
|
||||
<LineId Id="729" Count="1" />
|
||||
<LineId Id="738" Count="0" />
|
||||
<LineId Id="731" Count="0" />
|
||||
|
||||
@@ -9,6 +9,9 @@ VAR_INPUT
|
||||
// HMI interface
|
||||
stHMIInterface : REFERENCE TO ST_UNIT_HMI_INTERFACE;
|
||||
|
||||
// Components shortage workaround
|
||||
xVoltageSensorIs1500V : BOOL;
|
||||
|
||||
// Start unit
|
||||
xEnable : BOOL;
|
||||
|
||||
@@ -18,12 +21,6 @@ VAR_INPUT
|
||||
// Emergency stop ok
|
||||
xEmergencyStopOk : BOOL;
|
||||
|
||||
// Setpoint posolyt pump inlet
|
||||
rSetpointPosolytPumpInlet : REAL;
|
||||
|
||||
// Setpoint negolyt pump inlet
|
||||
rSetpointNegolytPumpInlet : REAL;
|
||||
|
||||
// Release alarms
|
||||
xReleaseErrors : BOOL;
|
||||
|
||||
@@ -72,30 +69,30 @@ VAR
|
||||
// _timUnitStartupWaitTime : TIME := T#10S;
|
||||
|
||||
// Valves posolyt
|
||||
_fbPosolytValveTankOutlet : FB_Valve('Posolyt tank outlet');
|
||||
_fbPosolytValveTankOutlet : FB_Valve(CONCAT(_sName, ' - Posolyt tank outlet'));
|
||||
|
||||
// Valves negolyt
|
||||
_fbNegolytValveTankOutlet : FB_Valve('Negolyt tank outlet');
|
||||
_fbNegolytValveTankOutlet : FB_Valve(CONCAT(_sName, ' - Negolyt tank outlet'));
|
||||
|
||||
// Pumps posolyt
|
||||
_fbPosolytPumpInlet : FB_MotorAnalog('Posolyt segment inlet');
|
||||
_fbPosolytPumpInlet : FB_MotorAnalog(CONCAT(_sName, ' - Posolyt segment inlet'));
|
||||
|
||||
// Pumps negolyt
|
||||
_fbNegolytPumpInlet : FB_MotorAnalog('Negolyt segment inlet');
|
||||
_fbNegolytPumpInlet : FB_MotorAnalog(CONCAT(_sName, ' - Negolyt segment inlet'));
|
||||
|
||||
// Pressure sensors posolyt
|
||||
_fbPressurePosolytSegmentInlet : FB_AnalogInput('P1_P');
|
||||
_fbPressurePosolytTankInlet : FB_AnalogInput('P3_P');
|
||||
_fbPressurePosolytSegmentInlet : FB_AnalogInput(CONCAT(_sName, ' - P1_P'));
|
||||
_fbPressurePosolytTankInlet : FB_AnalogInput(CONCAT(_sName, ' - P3_P'));
|
||||
|
||||
// Pressure sensors negolyt
|
||||
_fbPressureNegolytSegmentInlet : FB_AnalogInput('P1_N');
|
||||
_fbPressureNegolytTankInlet : FB_AnalogInput('P3_N');
|
||||
_fbPressureNegolytSegmentInlet : FB_AnalogInput(CONCAT(_sName, ' - P1_N'));
|
||||
_fbPressureNegolytTankInlet : FB_AnalogInput(CONCAT(_sName, ' - P3_N'));
|
||||
|
||||
// Temperature sensor posolyt
|
||||
_fbTempSensorPosolyt : FB_AnalogInput('T1_P');
|
||||
_fbTempSensorPosolyt : FB_AnalogInput(CONCAT(Name, ' - T1_P'));
|
||||
|
||||
// Temperature sensor negolyt
|
||||
_fbTempSensorNegolyt : FB_AnalogInput('T1_N');
|
||||
_fbTempSensorNegolyt : FB_AnalogInput(CONCAT(Name, ' - T1_N'));
|
||||
|
||||
// Unit voltage
|
||||
_fbVoltageSegment : FB_AnalogInput('Voltage');
|
||||
@@ -116,13 +113,13 @@ VAR
|
||||
|
||||
// Pump posolyt inlet interlocks
|
||||
_stPosolytPumpInletPIntlk : T_INTERLOCK;
|
||||
_stPosolytPumpInletPIntlkUsed : T_INTERLOCK := 2#0000_0000_0000_0000;
|
||||
_stPosolytPumpInletPIntlkUsed : T_INTERLOCK := 2#0000_0000_0000_0001;
|
||||
_stPosolytPumpInletSIntlk : T_INTERLOCK;
|
||||
_stPosolytPumpInletSIntlkUsed : T_INTERLOCK := 2#0000_0000_0000_0001;
|
||||
|
||||
// Pump negolyt inlet interlocks
|
||||
_stNegolytPumpInletPIntlk : T_INTERLOCK;
|
||||
_stNegolytPumpInletPIntlkUsed : T_INTERLOCK := 2#0000_0000_0000_0000;
|
||||
_stNegolytPumpInletPIntlkUsed : T_INTERLOCK := 2#0000_0000_0000_0001;
|
||||
_stNegolytPumpInletSIntlk : T_INTERLOCK;
|
||||
_stNegolytPumpInletSIntlkUsed : T_INTERLOCK := 2#0000_0000_0000_0001;
|
||||
|
||||
@@ -160,10 +157,26 @@ VAR
|
||||
_xDeltaPSegmentInletToHigh : BOOL;
|
||||
_xEnableCheckForDeltaPSegmentInlet : BOOL;
|
||||
_xErrorDeltaPSegmentInlet : BOOL;
|
||||
|
||||
// Setpoint posolyt pump inlet
|
||||
_rSetpointPosolytPumpInlet : REAL;
|
||||
|
||||
// Setpoint negolyt pump inlet
|
||||
_rSetpointNegolytPumpInlet : REAL;
|
||||
|
||||
// Indicate if it ise the first cycle
|
||||
xFirstCycle : BOOL := TRUE;
|
||||
END_VAR
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[// Reset error active
|
||||
<ST><![CDATA[IF xFirstCycle THEN
|
||||
_fbPosolytPumpInlet.Name := CONCAT(_sName, ' - Posolyt segment inlet');
|
||||
_fbNegolytPumpInlet.Name := CONCAT(_sName, ' - Negolyt segment inlet');
|
||||
xFirstCycle := FALSE;
|
||||
END_IF
|
||||
|
||||
|
||||
// Reset error active
|
||||
_xErrorActive := FALSE;
|
||||
|
||||
// Reset warning active
|
||||
@@ -180,7 +193,7 @@ _xReleaseManualMode := xReleaseManualMode;
|
||||
// ===============================
|
||||
|
||||
// Safety Interlocks
|
||||
stHMIInterface.stPosolytValve.stInterlock.asSafetyINTLKName[0] := 'Emergency stop ok';
|
||||
stHMIInterface.stNS12.stInterlock.asSafetyINTLKName[0] := 'Emergency stop ok';
|
||||
_stPosolytValveTankOutletSIntlk.0 := xEmergencyStopOk;
|
||||
|
||||
// Valve fb
|
||||
@@ -193,7 +206,7 @@ _fbPosolytValveTankOutlet(
|
||||
xConfirmAlarms:= xConfirmAlarms,
|
||||
xReleaseErrors:= xReleaseErrors,
|
||||
stValveConfig:= stUnitConfig.stConfigPosolytValve,
|
||||
stHMIInterface:= stHMIInterface.stPosolytValve);
|
||||
stHMIInterface:= stHMIInterface.stNS12);
|
||||
|
||||
// Set error active if fb has error
|
||||
IF _fbPosolytValveTankOutlet.xError THEN
|
||||
@@ -201,7 +214,7 @@ IF _fbPosolytValveTankOutlet.xError THEN
|
||||
END_IF
|
||||
|
||||
// Set safety interlock flag if fb has safety interlocks active
|
||||
IF NOT stHMIInterface.stPosolytValve.stInterlock.xSafetyINTLKOk THEN
|
||||
IF NOT stHMIInterface.stNS12.stInterlock.xSafetyINTLKOk THEN
|
||||
xSafetyIntlksOk := FALSE;
|
||||
END_IF
|
||||
|
||||
@@ -211,7 +224,7 @@ END_IF
|
||||
// ===============================
|
||||
|
||||
// Safety Interlocks
|
||||
stHMIInterface.stNegolytValve.stInterlock.asSafetyINTLKName[0] := 'Emergency stop ok';
|
||||
stHMIInterface.stNS22.stInterlock.asSafetyINTLKName[0] := 'Emergency stop ok';
|
||||
_stNegolytValveTankOutletSIntlk.0 := xEmergencyStopOk;
|
||||
|
||||
// Valve fb
|
||||
@@ -224,7 +237,7 @@ _fbNegolytValveTankOutlet(
|
||||
xConfirmAlarms:= xConfirmAlarms,
|
||||
xReleaseErrors:= xReleaseErrors,
|
||||
stValveConfig:= stUnitConfig.stConfigNegolytValve,
|
||||
stHMIInterface:= stHMIInterface.stNegolytValve);
|
||||
stHMIInterface:= stHMIInterface.stNS22);
|
||||
|
||||
// Set error active if fb has error
|
||||
IF _fbNegolytValveTankOutlet.xError THEN
|
||||
@@ -232,7 +245,7 @@ IF _fbNegolytValveTankOutlet.xError THEN
|
||||
END_IF
|
||||
|
||||
// Set safety interlock flag if fb has safety interlocks active
|
||||
IF NOT stHMIInterface.stNegolytValve.stInterlock.xSafetyINTLKOk THEN
|
||||
IF NOT stHMIInterface.stNS22.stInterlock.xSafetyINTLKOk THEN
|
||||
xSafetyIntlksOk := FALSE;
|
||||
END_IF
|
||||
|
||||
@@ -242,15 +255,15 @@ END_IF
|
||||
// ===============================
|
||||
|
||||
// Safety Interlocks
|
||||
stHMIInterface.stPosolytPump.stInterlock.asSafetyINTLKName[0] := 'Emergency stop ok';
|
||||
stHMIInterface.stNS11.stInterlock.asSafetyINTLKName[0] := 'Emergency stop ok';
|
||||
_stPosolytPumpInletSIntlk.0 := xEmergencyStopOk;
|
||||
|
||||
// Process interlocks
|
||||
// stHMIInterface.stPosolytPump.stInterlock.asProcessINTLKName[0] := 'At least one valve is open';
|
||||
//_stPosolytPumpInletPIntlk.0 := _fbPosolytValveTankOutlet.IsOpen;
|
||||
stHMIInterface.stNS21.stInterlock.asProcessINTLKName[0] := 'Negolyt Pump Error';
|
||||
_stPosolytPumpInletPIntlk.0 := NOT _fbNegolytPumpInlet.xError;
|
||||
|
||||
|
||||
// Valve fb
|
||||
|
||||
// Pump fb
|
||||
_fbPosolytPumpInlet(
|
||||
xReleaseManualMode:= _xReleaseManualMode,
|
||||
wProcessINTLK:= _stPosolytPumpInletPIntlk,
|
||||
@@ -259,10 +272,10 @@ _fbPosolytPumpInlet(
|
||||
wSafetyINTLKUsed:= _stPosolytPumpInletSIntlkUsed,
|
||||
xReleaseErrors:= xReleaseErrors,
|
||||
xConfirmAlarms:= xConfirmAlarms,
|
||||
rSPautomatic:= rSetpointPosolytPumpInlet,
|
||||
rSPautomatic:= _rSetpointPosolytPumpInlet,
|
||||
xReleaseAnalogInLimitErrors:= xReleaseLimitErrors,
|
||||
stMotorAnalogConfig:= stUnitConfig.stConfigPosolytPump,
|
||||
stHMIInterface:= stHMIInterface.stPosolytPump,
|
||||
stHMIInterface:= stHMIInterface.stNS11,
|
||||
xWarning=> );
|
||||
|
||||
// Set error active if fb has error
|
||||
@@ -276,7 +289,7 @@ IF _fbPosolytPumpInlet.xWarning THEN
|
||||
END_IF
|
||||
|
||||
// Set safety interlock flag if fb has safety interlocks active
|
||||
IF NOT stHMIInterface.stPosolytPump.stInterlock.xSafetyINTLKOk THEN
|
||||
IF NOT stHMIInterface.stNS11.stInterlock.xSafetyINTLKOk THEN
|
||||
xSafetyIntlksOk := FALSE;
|
||||
END_IF
|
||||
|
||||
@@ -286,15 +299,15 @@ END_IF
|
||||
// ===============================
|
||||
|
||||
// Safety Interlocks
|
||||
stHMIInterface.stNegolytPump.stInterlock.asSafetyINTLKName[0] := 'Emergency stop ok';
|
||||
stHMIInterface.stNS21.stInterlock.asSafetyINTLKName[0] := 'Emergency stop ok';
|
||||
_stNegolytPumpInletSIntlk.0 := xEmergencyStopOk;
|
||||
|
||||
// Process interlocks
|
||||
//stHMIInterface.stNegolytPump.stInterlock.asProcessINTLKName[0] := 'At least one valve is open';
|
||||
//_stNegolytPumpInletPIntlk.0 := _fbNegolytValveTankOutlet.IsOpen;
|
||||
stHMIInterface.stNS11.stInterlock.asProcessINTLKName[0] := 'Posolyt Pump Error';
|
||||
_stNegolytPumpInletPIntlk.0 := NOT _fbPosolytPumpInlet.xError;
|
||||
|
||||
|
||||
// Valve fb
|
||||
// Pump fb
|
||||
_fbNegolytPumpInlet(
|
||||
xReleaseManualMode:= _xReleaseManualMode,
|
||||
wProcessINTLK:= _stNegolytPumpInletPIntlk,
|
||||
@@ -303,10 +316,10 @@ _fbNegolytPumpInlet(
|
||||
wSafetyINTLKUsed:= _stNegolytPumpInletSIntlkUsed,
|
||||
xReleaseErrors:= xReleaseErrors,
|
||||
xConfirmAlarms:= xConfirmAlarms,
|
||||
rSPautomatic:= rSetpointNegolytPumpInlet,
|
||||
rSPautomatic:= _rSetpointNegolytPumpInlet,
|
||||
xReleaseAnalogInLimitErrors:= xReleaseLimitErrors,
|
||||
stMotorAnalogConfig:= stUnitConfig.stConfigNegolytPump,
|
||||
stHMIInterface:= stHMIInterface.stNegolytPump,
|
||||
stHMIInterface:= stHMIInterface.stNS21,
|
||||
xWarning=> );
|
||||
|
||||
// Set error active if fb has error
|
||||
@@ -320,7 +333,7 @@ IF _fbNegolytPumpInlet.xWarning THEN
|
||||
END_IF
|
||||
|
||||
// Set safety interlock flag if fb has safety interlocks active
|
||||
IF NOT stHMIInterface.stNegolytPump.stInterlock.xSafetyINTLKOk THEN
|
||||
IF NOT stHMIInterface.stNS21.stInterlock.xSafetyINTLKOk THEN
|
||||
xSafetyIntlksOk := FALSE;
|
||||
END_IF
|
||||
|
||||
@@ -336,7 +349,7 @@ _fbPressurePosolytSegmentInlet(
|
||||
xReleaseLimitErrors:= xReleaseLimitErrors AND _fbPosolytPumpInlet.IsRunning AND _fbPosolytPumpInlet.xInTarget,
|
||||
xReleaseHardwareErrors:= xReleaseErrors,
|
||||
xConfirmAlarms:= xConfirmAlarms,
|
||||
stHMIInterface => stHMIInterface.stPosolytPressureSegmentInlet);
|
||||
stHMIInterface => stHMIInterface.stP11);
|
||||
|
||||
// Set error active if fb has error
|
||||
IF _fbPressurePosolytSegmentInlet.xError THEN
|
||||
@@ -360,7 +373,7 @@ _fbPressureNegolytSegmentInlet(
|
||||
xReleaseLimitErrors:= xReleaseLimitErrors AND _fbNegolytPumpInlet.IsRunning AND _fbNegolytPumpInlet.xInTarget,
|
||||
xReleaseHardwareErrors:= xReleaseErrors,
|
||||
xConfirmAlarms:= xConfirmAlarms,
|
||||
stHMIInterface => stHMIInterface.stNegolytPressureSegmentInlet);
|
||||
stHMIInterface => stHMIInterface.stP21);
|
||||
|
||||
// Set error active if fb has error
|
||||
IF _fbPressureNegolytSegmentInlet.xError THEN
|
||||
@@ -384,7 +397,7 @@ _fbPressurePosolytTankInlet(
|
||||
xReleaseLimitErrors:= xReleaseLimitErrors,
|
||||
xReleaseHardwareErrors:= xReleaseErrors,
|
||||
xConfirmAlarms:= xConfirmAlarms,
|
||||
stHMIInterface => stHMIInterface.stPosolytPressureTankInlet);
|
||||
stHMIInterface => stHMIInterface.stP12);
|
||||
|
||||
// Set error active if fb has error
|
||||
IF _fbPressurePosolytTankInlet.xError THEN
|
||||
@@ -408,7 +421,7 @@ _fbPressureNegolytTankInlet(
|
||||
xReleaseLimitErrors:= xReleaseLimitErrors,
|
||||
xReleaseHardwareErrors:= xReleaseErrors,
|
||||
xConfirmAlarms:= xConfirmAlarms,
|
||||
stHMIInterface => stHMIInterface.stNegolytPressureTankInlet);
|
||||
stHMIInterface => stHMIInterface.stP22);
|
||||
|
||||
// Set error active if fb has error
|
||||
IF _fbPressureNegolytTankInlet.xError THEN
|
||||
@@ -431,7 +444,7 @@ _fbTempSensorPosolyt(
|
||||
xReleaseLimitErrors:= xReleaseLimitErrors,
|
||||
xReleaseHardwareErrors:= xReleaseErrors,
|
||||
xConfirmAlarms:= xConfirmAlarms,
|
||||
stHMIInterface=> stHMIInterface.stPosolytTempTankInlet);
|
||||
stHMIInterface=> stHMIInterface.stT11);
|
||||
|
||||
IF _fbTempSensorPosolyt.xError THEN
|
||||
_xErrorActive := TRUE;
|
||||
@@ -452,7 +465,7 @@ _fbTempSensorNegolyt(
|
||||
xReleaseLimitErrors:= xReleaseLimitErrors,
|
||||
xReleaseHardwareErrors:= xReleaseErrors,
|
||||
xConfirmAlarms:= xConfirmAlarms,
|
||||
stHMIInterface=> stHMIInterface.stNegolytTempTankInlet);
|
||||
stHMIInterface=> stHMIInterface.stT21);
|
||||
|
||||
IF _fbTempSensorNegolyt.xError THEN
|
||||
_xErrorActive := TRUE;
|
||||
@@ -465,16 +478,29 @@ END_IF
|
||||
// ===============================
|
||||
// Voltage segment
|
||||
// ===============================
|
||||
_fbVoltageSegment(
|
||||
stScalingConfig:= GVL_CONFIG.stUnitConfig.stConfigVoltageSegment,
|
||||
stEWConfig:= GVL_CONFIG.stUnitConfig.stEWLVoltageSegment,
|
||||
stEWDelayConfig:= GVL_CONFIG.stUnitConfig.stEWDVoltageSegment,
|
||||
xReleaseErrors:= xReleaseErrors,
|
||||
xReleaseLimitErrors:= xReleaseLimitErrors AND _xEnableVoltageLimitChecks,
|
||||
xReleaseHardwareErrors:= xReleaseErrors,
|
||||
xConfirmAlarms:= xConfirmAlarms,
|
||||
stHMIInterface=> stHMIInterface.stVoltageSegment,
|
||||
rScaledValue => rCurrentVoltage);
|
||||
IF xVoltageSensorIs1500V THEN
|
||||
_fbVoltageSegment(
|
||||
stScalingConfig:= GVL_CONFIG.stConfigVoltageSegment1500,
|
||||
stEWConfig:= GVL_CONFIG.stUnitConfig.stEWLVoltageSegment,
|
||||
stEWDelayConfig:= GVL_CONFIG.stUnitConfig.stEWDVoltageSegment,
|
||||
xReleaseErrors:= xReleaseErrors,
|
||||
xReleaseLimitErrors:= xReleaseLimitErrors AND _xEnableVoltageLimitChecks,
|
||||
xReleaseHardwareErrors:= xReleaseErrors,
|
||||
xConfirmAlarms:= xConfirmAlarms,
|
||||
stHMIInterface=> stHMIInterface.stE31,
|
||||
rScaledValue => rCurrentVoltage);
|
||||
ELSE
|
||||
_fbVoltageSegment(
|
||||
stScalingConfig:= GVL_CONFIG.stUnitConfig.stConfigVoltageSegment,
|
||||
stEWConfig:= GVL_CONFIG.stUnitConfig.stEWLVoltageSegment,
|
||||
stEWDelayConfig:= GVL_CONFIG.stUnitConfig.stEWDVoltageSegment,
|
||||
xReleaseErrors:= xReleaseErrors,
|
||||
xReleaseLimitErrors:= xReleaseLimitErrors AND _xEnableVoltageLimitChecks,
|
||||
xReleaseHardwareErrors:= xReleaseErrors,
|
||||
xConfirmAlarms:= xConfirmAlarms,
|
||||
stHMIInterface=> stHMIInterface.stE31,
|
||||
rScaledValue => rCurrentVoltage);
|
||||
END_IF
|
||||
|
||||
// Set error active if fb has error
|
||||
IF _fbVoltageSegment.xError THEN
|
||||
@@ -560,6 +586,9 @@ CASE _iState OF
|
||||
_fbPosolytPumpInlet.ReqAutomaticStart();
|
||||
_fbNegolytPumpInlet.ReqAutomaticStart();
|
||||
_xEnableCheckForDeltaPSegmentInlet := TRUE;
|
||||
_rSetpointNegolytPumpInlet := GVL_CONFIG.rPumpNegolytOnPower;
|
||||
_rSetpointPosolytPumpInlet := GVL_CONFIG.rPumpPosolytOnPower;
|
||||
|
||||
_iState := 25;
|
||||
|
||||
25: // Wait for all pumps to run
|
||||
@@ -579,8 +608,7 @@ CASE _iState OF
|
||||
IF _tonStartupCheck.Q THEN
|
||||
_tonStartupCheck(In := FALSE);
|
||||
// Check for minimum unit voltage
|
||||
// (_fbVoltageSegment.rScaledValue >= GVL_CONFIG.rMinimumUnitVoltage) AND
|
||||
IF NOT _xErrorActive AND NOT _xWarningActive THEN
|
||||
IF (_fbVoltageSegment.rScaledValue >= GVL_CONFIG.rMinimumUnitVoltage) AND (NOT _xErrorActive) AND (NOT _xWarningActive) THEN
|
||||
xReady := TRUE;
|
||||
|
||||
// Only enable Voltage Cheks if not in safety check mode
|
||||
@@ -613,6 +641,8 @@ CASE _iState OF
|
||||
_fbNegolytValveTankOutlet.ReqAutomaticClose();
|
||||
_fbPosolytValveTankOutlet.ReqAutomaticClose();
|
||||
_xEnableCheckForDeltaPSegmentInlet := FALSE;
|
||||
_rSetpointNegolytPumpInlet := GVL_CONFIG.rPumpNegolytDisChrgPower;
|
||||
_rSetpointPosolytPumpInlet := GVL_CONFIG.rPumpPosolytDisChrgPower;
|
||||
_iState := 45;
|
||||
|
||||
45: // Wait for valves to be closed
|
||||
@@ -639,8 +669,17 @@ CASE _iState OF
|
||||
ELSE
|
||||
xShutdownDischargeAllowed := FALSE;
|
||||
_xEnableVoltageLimitChecks := FALSE;
|
||||
_iState := 51;
|
||||
END_IF
|
||||
|
||||
// Check for restart condition
|
||||
IF xEnable AND (NOT _xErrorActive) THEN
|
||||
xShutdownDischargeAllowed := FALSE;
|
||||
xInShutdownDischargeMode := FALSE;
|
||||
_iState := 0;
|
||||
END_IF
|
||||
|
||||
51: // Discharge without inverter
|
||||
IF (_fbVoltageSegment.rScaledValue <= GVL_CONFIG.rPumpshutoffThreshold) THEN
|
||||
xShutdownDischargeAllowed := FALSE;
|
||||
xInShutdownDischargeMode := FALSE;
|
||||
@@ -750,6 +789,11 @@ _fbNotAllAutomaticAlarm.ipArguments.Clear().AddString(_sName);]]></ST>
|
||||
</Set>
|
||||
</Property>
|
||||
<LineIds Name="FB_Unit">
|
||||
<LineId Id="6787" Count="0" />
|
||||
<LineId Id="6790" Count="0" />
|
||||
<LineId Id="6792" Count="1" />
|
||||
<LineId Id="6791" Count="0" />
|
||||
<LineId Id="6788" Count="1" />
|
||||
<LineId Id="4232" Count="4" />
|
||||
<LineId Id="5406" Count="1" />
|
||||
<LineId Id="5405" Count="0" />
|
||||
@@ -797,8 +841,13 @@ _fbNotAllAutomaticAlarm.ipArguments.Clear().AddString(_sName);]]></ST>
|
||||
<LineId Id="5146" Count="0" />
|
||||
<LineId Id="5198" Count="15" />
|
||||
<LineId Id="5170" Count="0" />
|
||||
<LineId Id="4622" Count="12" />
|
||||
<LineId Id="4622" Count="3" />
|
||||
<LineId Id="6419" Count="0" />
|
||||
<LineId Id="4626" Count="8" />
|
||||
<LineId Id="4937" Count="0" />
|
||||
<LineId Id="6420" Count="0" />
|
||||
<LineId Id="6423" Count="8" />
|
||||
<LineId Id="6421" Count="1" />
|
||||
<LineId Id="4635" Count="8" />
|
||||
<LineId Id="4620" Count="0" />
|
||||
<LineId Id="6068" Count="1" />
|
||||
@@ -829,12 +878,12 @@ _fbNotAllAutomaticAlarm.ipArguments.Clear().AddString(_sName);]]></ST>
|
||||
<LineId Id="5076" Count="0" />
|
||||
<LineId Id="4464" Count="5" />
|
||||
<LineId Id="6091" Count="0" />
|
||||
<LineId Id="6603" Count="0" />
|
||||
<LineId Id="6601" Count="1" />
|
||||
<LineId Id="4470" Count="0" />
|
||||
<LineId Id="4476" Count="15" />
|
||||
<LineId Id="4790" Count="0" />
|
||||
<LineId Id="4492" Count="0" />
|
||||
<LineId Id="5903" Count="0" />
|
||||
<LineId Id="4493" Count="0" />
|
||||
<LineId Id="4492" Count="1" />
|
||||
<LineId Id="4496" Count="0" />
|
||||
<LineId Id="5908" Count="0" />
|
||||
<LineId Id="5912" Count="0" />
|
||||
@@ -852,6 +901,7 @@ _fbNotAllAutomaticAlarm.ipArguments.Clear().AddString(_sName);]]></ST>
|
||||
<LineId Id="5081" Count="0" />
|
||||
<LineId Id="4513" Count="3" />
|
||||
<LineId Id="6092" Count="0" />
|
||||
<LineId Id="6604" Count="1" />
|
||||
<LineId Id="4517" Count="3" />
|
||||
<LineId Id="5239" Count="0" />
|
||||
<LineId Id="4521" Count="5" />
|
||||
@@ -865,18 +915,20 @@ _fbNotAllAutomaticAlarm.ipArguments.Clear().AddString(_sName);]]></ST>
|
||||
<LineId Id="5223" Count="0" />
|
||||
<LineId Id="5225" Count="1" />
|
||||
<LineId Id="5440" Count="0" />
|
||||
<LineId Id="6776" Count="0" />
|
||||
<LineId Id="5224" Count="0" />
|
||||
<LineId Id="5221" Count="0" />
|
||||
<LineId Id="4531" Count="0" />
|
||||
<LineId Id="5228" Count="0" />
|
||||
<LineId Id="5242" Count="0" />
|
||||
<LineId Id="4532" Count="1" />
|
||||
<LineId Id="4658" Count="0" />
|
||||
<LineId Id="4660" Count="1" />
|
||||
<LineId Id="5229" Count="0" />
|
||||
<LineId Id="5243" Count="0" />
|
||||
<LineId Id="4662" Count="0" />
|
||||
<LineId Id="4659" Count="0" />
|
||||
<LineId Id="6769" Count="1" />
|
||||
<LineId Id="6772" Count="3" />
|
||||
<LineId Id="6771" Count="0" />
|
||||
<LineId Id="6777" Count="0" />
|
||||
<LineId Id="6779" Count="4" />
|
||||
<LineId Id="6778" Count="0" />
|
||||
<LineId Id="4569" Count="0" />
|
||||
<LineId Id="4535" Count="6" />
|
||||
<LineId Id="5251" Count="0" />
|
||||
|
||||
@@ -5,14 +5,17 @@
|
||||
VAR
|
||||
_xEmergencyStopOk AT %I* : BOOL;
|
||||
_xShowAckEmergencyStop AT %Q* : BOOL;
|
||||
_xString1DCSafetyOk AT %I* : BOOL;
|
||||
_xReleaseErrors : BOOL := TRUE;
|
||||
_xReleaseLimitsErrors : BOOL := TRUE;
|
||||
_xConfirmAlarms : BOOL;
|
||||
_xEnableString : BOOL;
|
||||
_xEnableInverter : BOOL;
|
||||
|
||||
_xCanChangeMode : BOOL := TRUE;
|
||||
|
||||
{attribute 'OPC.UA.DA' := '0'}
|
||||
_fbString : FB_String('String 1');
|
||||
_afbStrings : ARRAY[0..1] OF FB_String[('String 1'), ('String 2')];
|
||||
|
||||
_fbInverter : FB_PowerSupplySunspec;
|
||||
_stInverterData : ST_SUNSPEC_CURRENT_VALUES;
|
||||
@@ -66,7 +69,7 @@ VAR
|
||||
|
||||
// Current BMS control mode (Auto local, Auto remote, etc...)
|
||||
// On restart star in manual mode (so the ems can not directly start the bms)
|
||||
_eBMSControlMode : E_BMS_CONTROL_MODE := E_BMS_CONTROL_MODE.MANUAL;
|
||||
_eBMSControlMode : E_BMS_CONTROL_MODE := E_BMS_CONTROL_MODE.AUTO_LOCAL;
|
||||
|
||||
// UPS
|
||||
_fbUPS : FB_S_UPS_BAPI;
|
||||
@@ -87,6 +90,9 @@ VAR
|
||||
// Battery in safety check mode
|
||||
_xInSafetyCheckMode : BOOL;
|
||||
|
||||
// Safety
|
||||
_fbSafety : FB_Safety;
|
||||
|
||||
// DEBUG
|
||||
_xRestart : BOOL;
|
||||
END_VAR
|
||||
@@ -146,7 +152,8 @@ _fbUPS(
|
||||
|
||||
IF _xFirstCycle THEN
|
||||
_xFirstCycle := FALSE;
|
||||
_fbString.Name := 'String 1';
|
||||
_afbStrings[0].Name := 'String 1';
|
||||
_afbStrings[1].Name := 'String 2';
|
||||
END_IF
|
||||
|
||||
// Dely release of errors during PLC startup phase
|
||||
@@ -159,10 +166,11 @@ IF GVL_SCADA.stAckAlarmsButton.xRequest THEN
|
||||
END_IF
|
||||
|
||||
// Call string 1
|
||||
_fbString(
|
||||
_afbStrings[0](
|
||||
stStringModuleVoltageConfig := GVL_CONFIG.stString1VoltageConfig,
|
||||
xEnable := _xEnableString,
|
||||
xInSafetyCheckMode := _xInSafetyCheckMode,
|
||||
stHMIInterface:= GVL_SCADA.stHMIInterface,
|
||||
stHMIInterface:= GVL_SCADA.stHMIInterface[0],
|
||||
xEmergencyStopOk:= _xEmergencyStopOk,
|
||||
xReleaseErrors:= _xReleaseErrors AND _tonStartupDelay.Q,
|
||||
xReleaseLimitErrors:= _xReleaseLimitsErrors AND _tonStartupDelay.Q,
|
||||
@@ -170,7 +178,7 @@ _fbString(
|
||||
xConfirmAlarms:= _xConfirmAlarms,
|
||||
xResetSafety := xSafetyResterTaster);
|
||||
|
||||
IF _fbString.xError THEN
|
||||
IF _afbStrings[0].xError THEN
|
||||
_xErrorActive := TRUE;
|
||||
END_IF
|
||||
|
||||
@@ -180,28 +188,28 @@ END_IF
|
||||
_xShowErrorOnButton := _xErrorActive;
|
||||
|
||||
// HMI Feedback
|
||||
GVL_SCADA.stHMIInterface.rVoltage := _fbString.rCurrentVoltage;
|
||||
IF _fbString.eStatus = E_COMPONENT_STATUS.ON THEN
|
||||
GVL_SCADA.stHMIInterface[0].rVoltage := _afbStrings[0].rCurrentVoltage;
|
||||
IF _afbStrings[0].eStatus = E_COMPONENT_STATUS.ON THEN
|
||||
IF _iState = 30 AND _rPowerInverter > 0 THEN
|
||||
GVL_SCADA.stHMIInterface.eStatus := E_COMPONENT_STATUS.DISCHARGING;
|
||||
GVL_SCADA.stHMIInterface[0].eStatus := E_COMPONENT_STATUS.DISCHARGING;
|
||||
ELSIF _iState = 30 AND _rPowerInverter < 0 THEN
|
||||
GVL_SCADA.stHMIInterface.eStatus := E_COMPONENT_STATUS.CHARGING;
|
||||
GVL_SCADA.stHMIInterface[0].eStatus := E_COMPONENT_STATUS.CHARGING;
|
||||
ELSE
|
||||
GVL_SCADA.stHMIInterface.eStatus :=_fbString.eStatus;
|
||||
GVL_SCADA.stHMIInterface[0].eStatus :=_afbStrings[0].eStatus;
|
||||
END_IF
|
||||
ELSE
|
||||
GVL_SCADA.stHMIInterface.eStatus :=_fbString.eStatus;
|
||||
GVL_SCADA.stHMIInterface[0].eStatus :=_afbStrings[0].eStatus;
|
||||
END_IF
|
||||
|
||||
// DEACTIVATED FOR DEBUG REASONS !!!
|
||||
// Call inverter
|
||||
//_fbInverter(
|
||||
// sInverterIPAddr:= GVL_CONFIG.sInverterIp,
|
||||
// xEnable:= _xEnableInverter,
|
||||
// rPower:= _rPowerInverter,
|
||||
// xReset:= _xConfirmAlarms,
|
||||
// rMaxBattPower:= DINT_TO_REAL(GVL_CONFIG.diMaxStringDischargePower),
|
||||
// stCurrentValues => _stInverterData);
|
||||
_fbInverter(
|
||||
sInverterIPAddr:= GVL_CONFIG.sInverterIp,
|
||||
xEnable:= _xEnableInverter,
|
||||
rPower:= _rPowerInverter,
|
||||
xReset:= _xConfirmAlarms,
|
||||
rMaxBattPower:= DINT_TO_REAL(GVL_CONFIG.diMaxStringDischargePower),
|
||||
stCurrentValues => _stInverterData);
|
||||
|
||||
|
||||
// ===============================
|
||||
@@ -253,6 +261,9 @@ CASE _eBMSControlMode OF
|
||||
SM_CAPACITY_TEST();
|
||||
END_CASE
|
||||
|
||||
GVL_SCADA.xCanChangeControlMode := _xCanChangeMode;
|
||||
|
||||
_fbSafety();
|
||||
|
||||
// Reset alarm confirmation
|
||||
IF _xConfirmAlarms OR _rtHardwareResetButton.Q THEN
|
||||
@@ -264,8 +275,9 @@ END_IF]]></ST>
|
||||
<ST><![CDATA[CASE _iState OF
|
||||
0: // Idle
|
||||
// Wait for power command
|
||||
IF (ABS(_rAutoPowerRequest) > DINT_TO_REAL(GVL_CONFIG.diMinimumAbsPowerForEnable)) AND _fbString.xSafetyIntlksOk AND (NOT _fbString.xError) AND _fbString.xAllModulesInAutoMode THEN
|
||||
IF (ABS(_rAutoPowerRequest) > DINT_TO_REAL(GVL_CONFIG.diMinimumAbsPowerForEnable)) AND _afbStrings[0].xSafetyIntlksOk AND (NOT _afbStrings[0].xError) AND _afbStrings[0].xAllModulesInAutoMode THEN
|
||||
_iState := 5;
|
||||
_xCanChangeMode := FALSE;
|
||||
END_IF
|
||||
|
||||
5: // Check if power command is within limits
|
||||
@@ -282,11 +294,23 @@ END_IF]]></ST>
|
||||
END_IF
|
||||
|
||||
10: // Wait for string to be ready
|
||||
IF _fbString.xReady AND (NOT _fbString.xError) THEN
|
||||
IF _afbStrings[0].xReady AND (NOT _afbStrings[0].xError) THEN
|
||||
_rPowerInverter := 0.0;
|
||||
_xEnableInverter := TRUE;
|
||||
_iState := 20;
|
||||
END_IF
|
||||
|
||||
IF _afbStrings[0].xError THEN
|
||||
_xEnableInverter := FALSE;
|
||||
_xEnableString := FALSE;
|
||||
GVL_SCADA.stAutomaticModeHMI.diSetpointAutomatic := 0;
|
||||
_iState := 45;
|
||||
END_IF
|
||||
|
||||
IF (ABS(_rAutoPowerRequest) < DINT_TO_REAL(GVL_CONFIG.diMinimumAbsPowerForEnable)) THEN
|
||||
_xEnableString := FALSE;
|
||||
_iState := 45;
|
||||
END_IF
|
||||
|
||||
20: // Wait for inverter to be ready
|
||||
IF _fbInverter.xActive AND (NOT _fbInverter.xError) THEN
|
||||
@@ -297,7 +321,10 @@ END_IF]]></ST>
|
||||
END_IF
|
||||
|
||||
// Check for errors
|
||||
IF _fbString.xError OR _fbInverter.xError THEN
|
||||
IF _afbStrings[0].xError OR _fbInverter.xError THEN
|
||||
_xEnableInverter := FALSE;
|
||||
_xEnableString := FALSE;
|
||||
GVL_SCADA.stAutomaticModeHMI.diSetpointAutomatic := 0;
|
||||
_iState := 1000;
|
||||
END_IF
|
||||
|
||||
@@ -339,7 +366,7 @@ END_IF]]></ST>
|
||||
END_IF
|
||||
|
||||
// Shutdown triggered by battery fully charged
|
||||
IF GVL_MODBUS.stModbusEMSComm.stModbusReg11.eChargeStatus = E_CHARGE_STATUS.CHARGING AND (_fbString.rCurrentVoltage >= GVL_CONFIG.rStringFullyChargedVoltage) THEN
|
||||
IF GVL_MODBUS.stModbusEMSComm.stModbusReg11.eChargeStatus = E_CHARGE_STATUS.CHARGING AND (_afbStrings[0].rCurrentVoltage >= GVL_CONFIG.rStringFullyChargedVoltage) THEN
|
||||
_tonBeginShutdown(In := FALSE);
|
||||
|
||||
// Set inverter to zero power
|
||||
@@ -355,7 +382,7 @@ END_IF]]></ST>
|
||||
END_IF
|
||||
|
||||
// Shutdown triggered by battery empty
|
||||
IF GVL_MODBUS.stModbusEMSComm.stModbusReg11.eChargeStatus = E_CHARGE_STATUS.DISCHARGING AND (_fbString.rCurrentVoltage <= GVL_CONFIG.rStringEmptyVoltage) THEN
|
||||
IF GVL_MODBUS.stModbusEMSComm.stModbusReg11.eChargeStatus = E_CHARGE_STATUS.DISCHARGING AND (_afbStrings[0].rCurrentVoltage <= GVL_CONFIG.rStringEmptyVoltage) THEN
|
||||
_tonBeginShutdown(In := FALSE);
|
||||
|
||||
// Set inverter to zero power
|
||||
@@ -371,52 +398,68 @@ END_IF]]></ST>
|
||||
END_IF
|
||||
|
||||
// Check for errors
|
||||
IF _fbString.xError OR _fbInverter.xError THEN
|
||||
IF _afbStrings[0].xError OR (NOT _xString1DCSafetyOk) OR _fbInverter.xError THEN
|
||||
_xEnableInverter := FALSE;
|
||||
_xEnableString := FALSE;
|
||||
_tonBeginShutdown(In := FALSE);
|
||||
_iState := 1000;
|
||||
GVL_SCADA.stAutomaticModeHMI.diSetpointAutomatic := 0;
|
||||
_iState := 45;
|
||||
END_IF
|
||||
|
||||
35: // Wait for string to be in shutdown discharge mode
|
||||
IF _fbString.xInShutdownDischargeMode THEN
|
||||
IF _afbStrings[0].xInShutdownDischargeMode THEN
|
||||
// Check if we are allowed to discharge during shutdown with inverter
|
||||
IF GVL_CONFIG.xShutdownDischargeWithInverter THEN
|
||||
_iState := 40;
|
||||
ELSE
|
||||
_rPowerInverter := 0.0;
|
||||
_xEnableInverter := FALSE;
|
||||
_xEnableString := FALSE;
|
||||
GVL_SCADA.stAutomaticModeHMI.diSetpointAutomatic := 0;
|
||||
_iState := 45;
|
||||
END_IF
|
||||
END_IF
|
||||
|
||||
// Check for errors
|
||||
IF _fbString.xError OR _fbInverter.xError THEN
|
||||
IF _afbStrings[0].xError OR _fbInverter.xError THEN
|
||||
_xEnableInverter := FALSE;
|
||||
_iState := 1000;
|
||||
END_IF
|
||||
|
||||
40: // Wait for inverter discharge done
|
||||
IF _fbString.xShutdownDischargeAllowed THEN
|
||||
IF _afbStrings[0].xShutdownDischargeAllowed THEN
|
||||
_rPowerInverter := GVL_CONFIG.rAbsShutdownDischargePower;
|
||||
ELSE
|
||||
_rPowerInverter := 0.0;
|
||||
GVL_SCADA.stAutomaticModeHMI.diSetpointAutomatic := 0;
|
||||
_xEnableInverter := FALSE;
|
||||
_xEnableString := FALSE;
|
||||
_xCanChangeMode := TRUE;
|
||||
_iState := 45;
|
||||
END_IF
|
||||
|
||||
// Check for errors
|
||||
IF _fbString.xError OR _fbInverter.xError THEN
|
||||
IF _afbStrings[0].xError OR _fbInverter.xError THEN
|
||||
_xEnableInverter := FALSE;
|
||||
_iState := 1000;
|
||||
END_IF
|
||||
|
||||
45: // Wait for shutdown of string to be done
|
||||
IF (NOT _fbString.xInShutdownDischargeMode) AND _fbString.xOff THEN
|
||||
IF (NOT _afbStrings[0].xInShutdownDischargeMode) AND _afbStrings[0].xOff THEN
|
||||
GVL_MODBUS.stModbusEMSComm.stModbusReg11.eBatteryStatus := E_BATTERY_STATUS.OFF;
|
||||
_iState := 0;
|
||||
END_IF
|
||||
|
||||
// Restart if possible
|
||||
IF (ABS(_rAutoPowerRequest) > DINT_TO_REAL(GVL_CONFIG.diMinimumAbsPowerForEnable)) AND _afbStrings[0].xSafetyIntlksOk AND (NOT _afbStrings[0].xError) AND _afbStrings[0].xAllModulesInAutoMode THEN
|
||||
_iState := 5;
|
||||
END_IF
|
||||
|
||||
// Check for errors
|
||||
IF _fbString.xError OR _fbInverter.xError THEN
|
||||
_iState := 1000;
|
||||
END_IF
|
||||
// IF _afbStrings[0].xError OR _fbInverter.xError THEN
|
||||
// _xEnableInverter := FALSE;
|
||||
// _iState := 1000;
|
||||
//END_IF
|
||||
|
||||
1000: // Error state
|
||||
_xEnableString := FALSE;
|
||||
@@ -426,7 +469,7 @@ END_IF]]></ST>
|
||||
_iState := 1010;
|
||||
|
||||
1010: // Wait for reset from error state
|
||||
IF (_rAutoPowerRequest = 0.0) AND (NOT _fbString.xError) AND (NOT _fbInverter.xError) THEN
|
||||
IF (_rAutoPowerRequest = 0.0) AND (NOT _afbStrings[0].xError) AND (NOT _fbInverter.xError) THEN
|
||||
// Reset modbus error register
|
||||
GVL_MODBUS.stModbusEMSComm.stModbusReg11.lwErrorBitmap := 0;
|
||||
|
||||
@@ -435,6 +478,8 @@ END_IF]]></ST>
|
||||
|
||||
// Goto init state
|
||||
_iState := 0;
|
||||
|
||||
_xCanChangeMode := TRUE;
|
||||
END_IF
|
||||
END_CASE]]></ST>
|
||||
</Implementation>
|
||||
@@ -446,7 +491,7 @@ END_CASE]]></ST>
|
||||
</Action>
|
||||
<Action Name="SM_MANUAL" Id="{ddef276e-9f4f-4258-b863-d254dd94b701}">
|
||||
<Implementation>
|
||||
<ST><![CDATA[]]></ST>
|
||||
<ST><![CDATA[_xCanChangeMode := _afbStrings[0].xAllModulesInAutoMode;]]></ST>
|
||||
</Implementation>
|
||||
</Action>
|
||||
<Action Name="SM_SAFETY_CHECK" Id="{6d8e5993-cf32-4980-9ea3-c1fbfa4b8601}">
|
||||
@@ -461,14 +506,15 @@ END_CASE]]></ST>
|
||||
CASE _iStateSafetyCheck OF
|
||||
0: // Idle
|
||||
// Wait for power command
|
||||
IF _xStartSafetyCheck THEN
|
||||
IF _xStartSafetyCheck AND _afbStrings[0].xAllModulesInAutoMode THEN
|
||||
_xEnableString := TRUE;
|
||||
_xEnableInverter := FALSE;
|
||||
_iStateSafetyCheck := 10;
|
||||
_xCanChangeMode := FALSE;
|
||||
END_IF
|
||||
|
||||
10: // Wait for string to be ready
|
||||
IF _fbString.xReady AND (NOT _fbString.xError) THEN
|
||||
IF _afbStrings[0].xReady AND (NOT _afbStrings[0].xError) THEN
|
||||
_iStateSafetyCheck := 30;
|
||||
END_IF
|
||||
|
||||
@@ -477,6 +523,11 @@ CASE _iStateSafetyCheck OF
|
||||
_iStateSafetyCheck := 0;
|
||||
END_IF
|
||||
|
||||
// Check for errors
|
||||
IF _afbStrings[0].xError THEN
|
||||
_iStateSafetyCheck := 1000;
|
||||
END_IF
|
||||
|
||||
30: // String enabled and dc circuit breaker closed
|
||||
// Check if the battery should still be active
|
||||
IF (NOT _xStartSafetyCheck) THEN
|
||||
@@ -485,20 +536,21 @@ CASE _iStateSafetyCheck OF
|
||||
GVL_MODBUS.stModbusEMSComm.stModbusReg11.eChargeStatus := E_CHARGE_STATUS.UNDEFINED;
|
||||
GVL_MODBUS.stModbusEMSComm.stModbusReg10.uiActiveParallelMembers := 0;
|
||||
_iStateSafetyCheck := 45;
|
||||
_xCanChangeMode := TRUE;
|
||||
END_IF
|
||||
|
||||
// Check for errors
|
||||
IF _fbString.xError THEN
|
||||
IF _afbStrings[0].xError THEN
|
||||
_iStateSafetyCheck := 1000;
|
||||
END_IF
|
||||
|
||||
45: // Wait for shutdown of string to be done
|
||||
IF _fbString.xOff THEN
|
||||
IF _afbStrings[0].xOff THEN
|
||||
_iStateSafetyCheck := 0;
|
||||
END_IF
|
||||
|
||||
// Check for errors
|
||||
IF _fbString.xError THEN
|
||||
IF _afbStrings[0].xError THEN
|
||||
_iStateSafetyCheck := 1000;
|
||||
END_IF
|
||||
|
||||
@@ -509,57 +561,74 @@ CASE _iStateSafetyCheck OF
|
||||
_iStateSafetyCheck := 1010;
|
||||
|
||||
1010: // Wait for reset from error state
|
||||
IF (NOT _fbString.xError) AND NOT _xStartSafetyCheck THEN
|
||||
IF (NOT _afbStrings[0].xError) AND NOT _xStartSafetyCheck THEN
|
||||
// Goto init state
|
||||
_iStateSafetyCheck := 0;
|
||||
|
||||
_xCanChangeMode := TRUE;
|
||||
END_IF
|
||||
END_CASE]]></ST>
|
||||
</Implementation>
|
||||
</Action>
|
||||
<LineIds Name="MAIN">
|
||||
<LineId Id="1426" Count="10" />
|
||||
<LineId Id="1438" Count="1" />
|
||||
<LineId Id="1752" Count="0" />
|
||||
<LineId Id="1723" Count="0" />
|
||||
<LineId Id="1722" Count="0" />
|
||||
<LineId Id="1724" Count="1" />
|
||||
<LineId Id="1728" Count="0" />
|
||||
<LineId Id="1726" Count="0" />
|
||||
<LineId Id="1440" Count="0" />
|
||||
<LineId Id="1737" Count="0" />
|
||||
<LineId Id="1741" Count="1" />
|
||||
<LineId Id="1739" Count="0" />
|
||||
<LineId Id="1738" Count="0" />
|
||||
<LineId Id="1740" Count="0" />
|
||||
<LineId Id="1441" Count="41" />
|
||||
<LineId Id="1853" Count="0" />
|
||||
<LineId Id="1483" Count="5" />
|
||||
<LineId Id="1844" Count="0" />
|
||||
<LineId Id="1747" Count="3" />
|
||||
<LineId Id="1754" Count="3" />
|
||||
<LineId Id="1753" Count="0" />
|
||||
<LineId Id="1489" Count="48" />
|
||||
<LineId Id="1848" Count="0" />
|
||||
<LineId Id="1538" Count="3" />
|
||||
<LineId Id="1849" Count="0" />
|
||||
<LineId Id="1542" Count="0" />
|
||||
<LineId Id="1562" Count="0" />
|
||||
<LineId Id="1543" Count="2" />
|
||||
<LineId Id="1850" Count="0" />
|
||||
<LineId Id="1546" Count="3" />
|
||||
<LineId Id="1851" Count="0" />
|
||||
<LineId Id="1550" Count="3" />
|
||||
<LineId Id="1852" Count="0" />
|
||||
<LineId Id="1554" Count="7" />
|
||||
<LineId Id="2032" Count="54" />
|
||||
<LineId Id="2197" Count="0" />
|
||||
<LineId Id="2087" Count="12" />
|
||||
<LineId Id="2287" Count="0" />
|
||||
<LineId Id="2100" Count="91" />
|
||||
<LineId Id="2383" Count="0" />
|
||||
<LineId Id="2192" Count="0" />
|
||||
<LineId Id="2388" Count="0" />
|
||||
<LineId Id="2387" Count="0" />
|
||||
<LineId Id="2193" Count="3" />
|
||||
<LineId Id="25" Count="0" />
|
||||
</LineIds>
|
||||
<LineIds Name="MAIN.SM_AUTO">
|
||||
<LineId Id="2" Count="21" />
|
||||
<LineId Id="2" Count="4" />
|
||||
<LineId Id="195" Count="0" />
|
||||
<LineId Id="7" Count="16" />
|
||||
<LineId Id="183" Count="1" />
|
||||
<LineId Id="182" Count="0" />
|
||||
<LineId Id="25" Count="0" />
|
||||
<LineId Id="31" Count="29" />
|
||||
<LineId Id="62" Count="118" />
|
||||
<LineId Id="185" Count="1" />
|
||||
<LineId Id="189" Count="0" />
|
||||
<LineId Id="205" Count="0" />
|
||||
<LineId Id="214" Count="0" />
|
||||
<LineId Id="187" Count="1" />
|
||||
<LineId Id="200" Count="1" />
|
||||
<LineId Id="203" Count="1" />
|
||||
<LineId Id="202" Count="0" />
|
||||
<LineId Id="31" Count="10" />
|
||||
<LineId Id="190" Count="0" />
|
||||
<LineId Id="216" Count="0" />
|
||||
<LineId Id="215" Count="0" />
|
||||
<LineId Id="42" Count="18" />
|
||||
<LineId Id="62" Count="54" />
|
||||
<LineId Id="191" Count="0" />
|
||||
<LineId Id="206" Count="0" />
|
||||
<LineId Id="117" Count="0" />
|
||||
<LineId Id="217" Count="0" />
|
||||
<LineId Id="118" Count="10" />
|
||||
<LineId Id="207" Count="0" />
|
||||
<LineId Id="218" Count="0" />
|
||||
<LineId Id="129" Count="5" />
|
||||
<LineId Id="192" Count="0" />
|
||||
<LineId Id="135" Count="7" />
|
||||
<LineId Id="219" Count="0" />
|
||||
<LineId Id="143" Count="0" />
|
||||
<LineId Id="208" Count="0" />
|
||||
<LineId Id="196" Count="0" />
|
||||
<LineId Id="144" Count="4" />
|
||||
<LineId Id="193" Count="0" />
|
||||
<LineId Id="149" Count="7" />
|
||||
<LineId Id="209" Count="0" />
|
||||
<LineId Id="213" Count="0" />
|
||||
<LineId Id="210" Count="2" />
|
||||
<LineId Id="157" Count="2" />
|
||||
<LineId Id="194" Count="0" />
|
||||
<LineId Id="160" Count="19" />
|
||||
<LineId Id="198" Count="1" />
|
||||
<LineId Id="180" Count="0" />
|
||||
<LineId Id="1" Count="0" />
|
||||
</LineIds>
|
||||
<LineIds Name="MAIN.SM_CAPACITY_TEST">
|
||||
@@ -577,22 +646,30 @@ END_CASE]]></ST>
|
||||
<LineId Id="17" Count="0" />
|
||||
<LineId Id="20" Count="3" />
|
||||
<LineId Id="198" Count="1" />
|
||||
<LineId Id="24" Count="1" />
|
||||
<LineId Id="24" Count="0" />
|
||||
<LineId Id="216" Count="0" />
|
||||
<LineId Id="25" Count="0" />
|
||||
<LineId Id="39" Count="4" />
|
||||
<LineId Id="206" Count="2" />
|
||||
<LineId Id="210" Count="0" />
|
||||
<LineId Id="209" Count="0" />
|
||||
<LineId Id="211" Count="0" />
|
||||
<LineId Id="213" Count="2" />
|
||||
<LineId Id="212" Count="0" />
|
||||
<LineId Id="62" Count="1" />
|
||||
<LineId Id="67" Count="1" />
|
||||
<LineId Id="202" Count="3" />
|
||||
<LineId Id="201" Count="0" />
|
||||
<LineId Id="217" Count="0" />
|
||||
<LineId Id="72" Count="0" />
|
||||
<LineId Id="131" Count="2" />
|
||||
<LineId Id="135" Count="1" />
|
||||
<LineId Id="168" Count="2" />
|
||||
<LineId Id="172" Count="11" />
|
||||
<LineId Id="185" Count="3" />
|
||||
<LineId Id="195" Count="2" />
|
||||
<LineId Id="195" Count="1" />
|
||||
<LineId Id="218" Count="1" />
|
||||
<LineId Id="197" Count="0" />
|
||||
<LineId Id="19" Count="0" />
|
||||
</LineIds>
|
||||
</POU>
|
||||
|
||||
@@ -414,7 +414,7 @@ CASE _iState OF
|
||||
_rOldPower := rPower;
|
||||
_uiMaxLimEn := 1;
|
||||
// Calculate reactive power setting
|
||||
_iMaxPowerVar := LREAL_TO_INT((rReactivePower*100)/(_iMaxPowerVar * EXPT(10,_iVarPctSF)));
|
||||
//_iMaxPowerVar := LREAL_TO_INT((rReactivePower*100)/(_iMaxPowerVar * EXPT(10,_iVarPctSF)));
|
||||
ELSE
|
||||
xError := TRUE;
|
||||
// Goto error state
|
||||
@@ -802,6 +802,7 @@ CASE _iState OF
|
||||
|
||||
IF NOT _fbWriteRegister.bBusy THEN
|
||||
_iState := 0;
|
||||
xError := FALSE;
|
||||
_fbWriteRegister(bExecute := FALSE);
|
||||
END_IF
|
||||
|
||||
@@ -914,6 +915,7 @@ END_CASE]]></ST>
|
||||
<LineId Id="1273" Count="0" />
|
||||
<LineId Id="1289" Count="1" />
|
||||
<LineId Id="1293" Count="0" />
|
||||
<LineId Id="2235" Count="0" />
|
||||
<LineId Id="1291" Count="1" />
|
||||
<LineId Id="1056" Count="0" />
|
||||
<LineId Id="12" Count="0" />
|
||||
|
||||
Reference in New Issue
Block a user