- Added new module status
- Added error messages for EtherCAT connection lost
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.12">
|
||||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4026.8">
|
||||
<DUT Name="E_COMPONENT_STATUS" Id="{cff71c34-33b2-4724-933e-1a2c018acdb7}">
|
||||
<Declaration><![CDATA[{attribute 'qualified_only'}
|
||||
{attribute 'strict'}
|
||||
@@ -10,7 +10,9 @@ TYPE E_COMPONENT_STATUS :
|
||||
ON := 1,
|
||||
CHARGING := 2,
|
||||
DISCHARGING := 3,
|
||||
ERROR := 4
|
||||
ERROR := 4,
|
||||
SHUTDOWN := 5,
|
||||
STARTING := 6
|
||||
);
|
||||
END_TYPE
|
||||
]]></Declaration>
|
||||
|
||||
491
PLC/PLC.tmc
491
PLC/PLC.tmc
File diff suppressed because one or more lines are too long
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4026.7">
|
||||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4026.8">
|
||||
<POU Name="FB_Module" Id="{87be924f-018d-4c09-997b-f0c0054414cc}" SpecialFunc="None">
|
||||
<Declaration><![CDATA[FUNCTION_BLOCK FB_Module
|
||||
VAR_INPUT
|
||||
@@ -56,6 +56,8 @@ VAR_INPUT
|
||||
|
||||
// Leakage tank
|
||||
xLeakageTank AT %I* : BOOL;
|
||||
|
||||
xECState AT %I* : UINT;
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
// Module voltage
|
||||
@@ -103,6 +105,9 @@ VAR
|
||||
// Units out of balance alarm
|
||||
_fbUnitsOutOfBalanceAlarm : FB_TcAlarm;
|
||||
|
||||
// Connection lost alarm
|
||||
_fbConnLostAlarm : FB_TcAlarm;
|
||||
|
||||
// Enable balance check
|
||||
_xEnableBalanceCheck : BOOL;
|
||||
|
||||
@@ -115,6 +120,8 @@ VAR
|
||||
|
||||
_fbBalanceNotOkSignal : FB_ReleaseSignal;
|
||||
|
||||
_xECModuleInOP : BOOL;
|
||||
|
||||
xDebug1 : BOOL;
|
||||
xDebug2 : BOOL;
|
||||
xDebug3 : BOOL;
|
||||
@@ -132,6 +139,22 @@ xAllUnitsInAutomatic := TRUE;
|
||||
// Reset safety interlocks flag
|
||||
xSafetyIntlksOk := TRUE;
|
||||
|
||||
// ===============================
|
||||
// Handle module connection lost error
|
||||
// ===============================
|
||||
_xECModuleInOP := (xECState AND 16#000F) = 8;
|
||||
IF (NOT _xECModuleInOP) AND (NOT _fbConnLostAlarm.bRaised) AND xReleaseErrors THEN
|
||||
_fbConnLostAlarm.Raise(0);
|
||||
END_IF
|
||||
|
||||
IF (_xECModuleInOP) AND _fbConnLostAlarm.bRaised THEN
|
||||
_fbConnLostAlarm.Clear(0, FALSE);
|
||||
END_IF
|
||||
|
||||
IF _fbConnLostAlarm.eConfirmationState = TcEventConfirmationState.WaitForConfirmation AND xConfirmAlarms THEN
|
||||
_fbConnLostAlarm.Confirm(0);
|
||||
END_IF
|
||||
|
||||
|
||||
// ===============================
|
||||
// Unit 1
|
||||
@@ -407,17 +430,26 @@ rHighestSegmentVoltage := MAX(_fbUnit1.rCurrentVoltage, _fbUnit2.rCurrentVoltage
|
||||
// ===============================
|
||||
// Module status sum
|
||||
// ===============================
|
||||
IF xOff THEN
|
||||
stHMIInterface.eStatus := E_COMPONENT_STATUS.OFF;
|
||||
IF xReady AND (NOT xError) THEN
|
||||
stHMIInterface.eStatus := E_COMPONENT_STATUS.ON;
|
||||
END_IF
|
||||
|
||||
IF xReady THEN
|
||||
stHMIInterface.eStatus := E_COMPONENT_STATUS.ON;
|
||||
IF (_fbUnit1.eUnitState = E_COMPONENT_STATUS.STARTING OR _fbUnit1.eUnitState = E_COMPONENT_STATUS.STARTING OR _fbUnit1.eUnitState = E_COMPONENT_STATUS.STARTING OR _fbUnit1.eUnitState = E_COMPONENT_STATUS.STARTING) AND (NOT xError) THEN
|
||||
stHMIInterface.eStatus := E_COMPONENT_STATUS.STARTING;
|
||||
END_IF
|
||||
|
||||
IF (_fbUnit1.eUnitState = E_COMPONENT_STATUS.SHUTDOWN OR _fbUnit1.eUnitState = E_COMPONENT_STATUS.SHUTDOWN OR _fbUnit1.eUnitState = E_COMPONENT_STATUS.SHUTDOWN OR _fbUnit1.eUnitState = E_COMPONENT_STATUS.SHUTDOWN) AND (NOT xError) THEN
|
||||
stHMIInterface.eStatus := E_COMPONENT_STATUS.SHUTDOWN;
|
||||
END_IF
|
||||
|
||||
IF (_fbUnit1.eUnitState = E_COMPONENT_STATUS.OFF AND _fbUnit1.eUnitState = E_COMPONENT_STATUS.OFF AND _fbUnit1.eUnitState = E_COMPONENT_STATUS.OFF AND _fbUnit1.eUnitState = E_COMPONENT_STATUS.OFF) AND (NOT xError) THEN
|
||||
stHMIInterface.eStatus := E_COMPONENT_STATUS.OFF;
|
||||
END_IF
|
||||
|
||||
IF xError THEN
|
||||
stHMIInterface.eStatus := E_COMPONENT_STATUS.ERROR;
|
||||
END_IF]]></ST>
|
||||
END_IF
|
||||
]]></ST>
|
||||
</Implementation>
|
||||
<Method Name="FB_init" Id="{369c1d27-76e4-45f8-9dbe-03524d3389df}">
|
||||
<Declaration><![CDATA[METHOD FB_init : BOOL
|
||||
@@ -443,6 +475,11 @@ _fbUnitsOutOfBalanceAlarm.CreateEx(stEventEntry := TC_EVENTS.BMSEvents.ModuleImb
|
||||
// Create alarm message
|
||||
_fbUnitsOutOfBalanceAlarm.ipArguments.Clear().AddString(_sName);
|
||||
|
||||
// Create connection lost alarm
|
||||
_fbConnLostAlarm.CreateEx(stEventEntry := TC_EVENTS.General.CommError, bWithConfirmation := TRUE, 0);
|
||||
_fbConnLostAlarm.ipArguments.Clear().AddString(_sName);
|
||||
|
||||
|
||||
// Create leakage alarm messages
|
||||
]]></ST>
|
||||
</Implementation>
|
||||
@@ -471,9 +508,59 @@ _fbUnit3.Name := CONCAT(_sName, ' - Unit 3');
|
||||
_fbUnit4.Name := CONCAT(_sName, ' - Unit 4');
|
||||
|
||||
// Create alarm message
|
||||
_fbUnitsOutOfBalanceAlarm.ipArguments.Clear().AddString(_sName);]]></ST>
|
||||
_fbUnitsOutOfBalanceAlarm.ipArguments.Clear().AddString(_sName);
|
||||
|
||||
// Create connection lost alarm
|
||||
_fbConnLostAlarm.ipArguments.Clear().AddString(_sName);]]></ST>
|
||||
</Implementation>
|
||||
</Set>
|
||||
</Property>
|
||||
<LineIds Name="FB_Module">
|
||||
<LineId Id="3" Count="8" />
|
||||
<LineId Id="338" Count="0" />
|
||||
<LineId Id="340" Count="1" />
|
||||
<LineId Id="339" Count="0" />
|
||||
<LineId Id="352" Count="0" />
|
||||
<LineId Id="337" Count="0" />
|
||||
<LineId Id="342" Count="1" />
|
||||
<LineId Id="345" Count="2" />
|
||||
<LineId Id="344" Count="0" />
|
||||
<LineId Id="349" Count="0" />
|
||||
<LineId Id="348" Count="0" />
|
||||
<LineId Id="350" Count="1" />
|
||||
<LineId Id="12" Count="275" />
|
||||
<LineId Id="317" Count="2" />
|
||||
<LineId Id="326" Count="0" />
|
||||
<LineId Id="325" Count="0" />
|
||||
<LineId Id="327" Count="1" />
|
||||
<LineId Id="330" Count="0" />
|
||||
<LineId Id="329" Count="0" />
|
||||
<LineId Id="331" Count="1" />
|
||||
<LineId Id="334" Count="0" />
|
||||
<LineId Id="333" Count="0" />
|
||||
<LineId Id="335" Count="1" />
|
||||
<LineId Id="322" Count="0" />
|
||||
<LineId Id="321" Count="0" />
|
||||
<LineId Id="323" Count="1" />
|
||||
<LineId Id="2" Count="0" />
|
||||
</LineIds>
|
||||
<LineIds Name="FB_Module.FB_init">
|
||||
<LineId Id="3" Count="13" />
|
||||
<LineId Id="18" Count="0" />
|
||||
<LineId Id="21" Count="1" />
|
||||
<LineId Id="19" Count="1" />
|
||||
<LineId Id="17" Count="0" />
|
||||
<LineId Id="2" Count="0" />
|
||||
</LineIds>
|
||||
<LineIds Name="FB_Module.Name.Get">
|
||||
<LineId Id="2" Count="0" />
|
||||
</LineIds>
|
||||
<LineIds Name="FB_Module.Name.Set">
|
||||
<LineId Id="3" Count="8" />
|
||||
<LineId Id="2" Count="0" />
|
||||
<LineId Id="14" Count="0" />
|
||||
<LineId Id="13" Count="0" />
|
||||
<LineId Id="12" Count="0" />
|
||||
</LineIds>
|
||||
</POU>
|
||||
</TcPlcObject>
|
||||
@@ -54,6 +54,7 @@ VAR_INPUT
|
||||
// String inverter ip
|
||||
sInverterIP : STRING;
|
||||
|
||||
xECStateSCS AT %I* : UINT;
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
// Current string voltage
|
||||
@@ -130,6 +131,9 @@ VAR
|
||||
// DC Main switch not closed
|
||||
_fbDCMainSwitchNotClosed : FB_TcAlarm;
|
||||
|
||||
// Connection to SCS lost
|
||||
_fbSCSConnLost : FB_TcAlarm;
|
||||
|
||||
// Shutdown discharge stopped messages
|
||||
_fbSDDCLevel : FB_TcMessage;
|
||||
_fbSDUnitThreshold : FB_TcMessage;
|
||||
@@ -206,6 +210,21 @@ xAllModulesInAutoMode := TRUE;
|
||||
// Reset Safety
|
||||
xResetSafetyDCCB := xResetSafety;
|
||||
|
||||
// ===============================
|
||||
// EtherCAT connection lost error handling
|
||||
// ===============================
|
||||
IF (xECStateSCS <> 8) AND (NOT _fbSCSConnLost.bRaised) AND xReleaseErrors THEN
|
||||
_fbSCSConnLost.Raise(0);
|
||||
END_IF
|
||||
|
||||
IF (xECStateSCS = 8) AND _fbSCSConnLost.bRaised THEN
|
||||
_fbSCSConnLost.Clear(0, FALSE);
|
||||
END_IF
|
||||
|
||||
IF _fbSCSConnLost.eConfirmationState = TcEventConfirmationState.WaitForConfirmation AND xConfirmAlarms THEN
|
||||
_fbSCSConnLost.Confirm(0);
|
||||
END_IF
|
||||
|
||||
// ===============================
|
||||
// DC Main switch error handling
|
||||
// ===============================
|
||||
@@ -532,6 +551,7 @@ CASE _iState OF
|
||||
|
||||
20: // Check if DC relais closed and safety is ok
|
||||
IF NOT xDCCBOpen THEN
|
||||
_tonErrorDCCBNotClosed.IN := FALSE;
|
||||
_xEnableInverter := TRUE;
|
||||
_rPowerInverterInternal := rPowerInverter;
|
||||
//_rPowerInverterInternal := 0.0;
|
||||
@@ -565,13 +585,18 @@ CASE _iState OF
|
||||
_rPowerInverterInternal := 0.0;
|
||||
_xEnable := FALSE;
|
||||
_iState := 31;
|
||||
_tonInverterStartupTimeout(IN := FALSE);
|
||||
END_IF
|
||||
|
||||
|
||||
|
||||
// Inverter error or timeout for startup
|
||||
IF _fbInverter.xError OR (NOT xRepairSwitchOk) THEN // _tonInverterStartupTimeout.Q
|
||||
IF _fbInverter.xError OR (NOT xRepairSwitchOk) OR _tonInverterStartupTimeout.Q THEN // _tonInverterStartupTimeout.Q
|
||||
// Shutdown beacause of inverter startup timeout
|
||||
IF _tonInverterStartupTimeout.Q AND (NOT _fbInverterStartupTimeoutAlarm.bRaised) THEN
|
||||
_fbInverterStartupTimeoutAlarm.Raise(0);
|
||||
END_IF
|
||||
|
||||
_iState := 1000;
|
||||
_xEnableInverter := FALSE;
|
||||
xError := TRUE;
|
||||
@@ -650,8 +675,8 @@ CASE _iState OF
|
||||
// Restart on Enable or StartBalancing
|
||||
IF xEnable OR xStartBalancing THEN
|
||||
_rPowerInverterInternal := 0.0;
|
||||
_xEnableInverter := FALSE;
|
||||
_iState := 40;
|
||||
//_xEnableInverter := FALSE;
|
||||
_iState := 0;
|
||||
END_IF
|
||||
|
||||
40: // Wait for inverter to shut down
|
||||
@@ -750,6 +775,9 @@ VAR_INPUT
|
||||
|
||||
sName : STRING;
|
||||
END_VAR
|
||||
VAR
|
||||
_sTemp : STRING;
|
||||
END_VAR
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[_sName := sName;
|
||||
@@ -775,6 +803,11 @@ _fbInverterStartupTimeoutAlarm.ipArguments.Clear().AddString(_sName);
|
||||
_fbDCMainSwitchNotClosed.CreateEx(stEventEntry := TC_EVENTS.General.DCMainSwitchNotClosed, bWithConfirmation := FALSE, 0);
|
||||
_fbDCMainSwitchNotClosed.ipArguments.Clear().AddString(_sName);
|
||||
|
||||
// EtherCAT communication lost alarm
|
||||
_fbSCSConnLost.CreateEx(stEventEntry := TC_EVENTS.General.CommError, bWithConfirmation := TRUE, 0);
|
||||
_sTemp := CONCAT(_sName, ' SCS');
|
||||
_fbSCSConnLost.ipArguments.Clear().AddString(_sTemp);
|
||||
|
||||
// Shutdown discharge messages
|
||||
_fbSDDCLevel.CreateEx(TC_EVENTS.BMSEvents.SDDCVoltage, 0);
|
||||
_fbSDDCLevel.ipArguments.Clear().AddString(_sName);
|
||||
@@ -805,6 +838,9 @@ _fbModule1.Name := CONCAT(_sName, ' - Module 1');
|
||||
_fbModule2.Name := CONCAT(_sName, ' - Module 2');
|
||||
_fbModule3.Name := CONCAT(_sName, ' - Module 3');
|
||||
|
||||
// Set inverter Name
|
||||
_fbInverter.Name := _sName;
|
||||
|
||||
// Create alarm messages
|
||||
_fbModulesOutOfBalanceAlarm.ipArguments.Clear().AddString(_sName);
|
||||
_fbSafetyInterlocksNotOkAlarm.ipArguments.Clear().AddString(_sName);]]></ST>
|
||||
@@ -812,18 +848,47 @@ _fbSafetyInterlocksNotOkAlarm.ipArguments.Clear().AddString(_sName);]]></ST>
|
||||
</Set>
|
||||
</Property>
|
||||
<LineIds Name="FB_String">
|
||||
<LineId Id="3" Count="542" />
|
||||
<LineId Id="3" Count="7" />
|
||||
<LineId Id="600" Count="2" />
|
||||
<LineId Id="599" Count="0" />
|
||||
<LineId Id="603" Count="2" />
|
||||
<LineId Id="607" Count="0" />
|
||||
<LineId Id="606" Count="0" />
|
||||
<LineId Id="608" Count="1" />
|
||||
<LineId Id="611" Count="0" />
|
||||
<LineId Id="610" Count="0" />
|
||||
<LineId Id="612" Count="1" />
|
||||
<LineId Id="11" Count="326" />
|
||||
<LineId Id="597" Count="0" />
|
||||
<LineId Id="338" Count="32" />
|
||||
<LineId Id="578" Count="0" />
|
||||
<LineId Id="371" Count="0" />
|
||||
<LineId Id="582" Count="0" />
|
||||
<LineId Id="584" Count="0" />
|
||||
<LineId Id="372" Count="2" />
|
||||
<LineId Id="587" Count="2" />
|
||||
<LineId Id="377" Count="0" />
|
||||
<LineId Id="596" Count="0" />
|
||||
<LineId Id="378" Count="167" />
|
||||
<LineId Id="2" Count="0" />
|
||||
</LineIds>
|
||||
<LineIds Name="FB_String.FB_init">
|
||||
<LineId Id="3" Count="27" />
|
||||
<LineId Id="3" Count="21" />
|
||||
<LineId Id="31" Count="2" />
|
||||
<LineId Id="35" Count="0" />
|
||||
<LineId Id="34" Count="0" />
|
||||
<LineId Id="25" Count="5" />
|
||||
<LineId Id="2" Count="0" />
|
||||
</LineIds>
|
||||
<LineIds Name="FB_String.Name.Get">
|
||||
<LineId Id="1" Count="0" />
|
||||
</LineIds>
|
||||
<LineIds Name="FB_String.Name.Set">
|
||||
<LineId Id="1" Count="9" />
|
||||
<LineId Id="1" Count="5" />
|
||||
<LineId Id="12" Count="0" />
|
||||
<LineId Id="11" Count="0" />
|
||||
<LineId Id="13" Count="0" />
|
||||
<LineId Id="7" Count="3" />
|
||||
</LineIds>
|
||||
</POU>
|
||||
</TcPlcObject>
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4026.7">
|
||||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4026.8">
|
||||
<POU Name="FB_Unit" Id="{e9bb815b-eb46-4920-800d-910484e58b22}" SpecialFunc="None">
|
||||
<Declaration><![CDATA[FUNCTION_BLOCK FB_Unit
|
||||
VAR_INPUT
|
||||
@@ -45,12 +45,13 @@ VAR_INPUT
|
||||
// Switch all components to manual mode
|
||||
xAllToManualMode : BOOL;
|
||||
|
||||
// Switch all components to auto mode
|
||||
|
||||
// Inverter enabled status
|
||||
xInverterEnabled : BOOL;
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
// Unit state
|
||||
eUnitState : E_COMPONENT_STATUS := E_COMPONENT_STATUS.OFF;
|
||||
|
||||
// Unit ready
|
||||
xReady : BOOL;
|
||||
|
||||
@@ -778,6 +779,7 @@ CASE _iState OF
|
||||
_xReleaseManualMode := FALSE;
|
||||
_timUnitStartupWaitTime := GVL_CONFIG.timUnitStartupTime;
|
||||
_iState := 10;
|
||||
eUnitState := E_COMPONENT_STATUS.STARTING;
|
||||
END_IF
|
||||
|
||||
IF (NOT xEnable) AND xStartBalancing AND _xAllComponentsInAutomatic AND (NOT _xErrorActive) THEN
|
||||
@@ -867,6 +869,7 @@ CASE _iState OF
|
||||
|
||||
// Continue on normal startup path
|
||||
IF xEnable THEN
|
||||
eUnitState := E_COMPONENT_STATUS.ON;
|
||||
_iState := 35;
|
||||
END_IF
|
||||
|
||||
@@ -888,6 +891,7 @@ CASE _iState OF
|
||||
_rSetpointPosolytPumpInlet := GVL_CONFIG.rPumpPosolytOnPower;
|
||||
|
||||
IF (NOT xEnable) THEN
|
||||
eUnitState := E_COMPONENT_STATUS.SHUTDOWN;
|
||||
_iState := 40;
|
||||
END_IF
|
||||
|
||||
@@ -971,12 +975,14 @@ CASE _iState OF
|
||||
xOff := TRUE;
|
||||
_xReleaseManualMode := TRUE;
|
||||
IF NOT _xErrorActive THEN
|
||||
eUnitState := E_COMPONENT_STATUS.OFF;
|
||||
_iState := 0;
|
||||
END_IF
|
||||
END_IF
|
||||
|
||||
// Check for restart condition
|
||||
IF xEnable AND (NOT _xErrorActive) THEN
|
||||
eUnitState := E_COMPONENT_STATUS.OFF;
|
||||
_iState := 0;
|
||||
END_IF
|
||||
|
||||
@@ -1065,6 +1071,7 @@ CASE _iState OF
|
||||
|
||||
|
||||
1000: // Error shutdown
|
||||
eUnitState := E_COMPONENT_STATUS.ERROR;
|
||||
_fbNegolytValveTankOutlet.ReqAutomaticClose();
|
||||
_fbPosolytValveTankOutlet.ReqAutomaticClose();
|
||||
_fbPosolytPumpInlet.ReqAutomaticStop();
|
||||
@@ -1082,10 +1089,41 @@ CASE _iState OF
|
||||
// automatic restart of the unit
|
||||
IF (NOT _xErrorActive) AND (NOT xEnable) AND (NOT xStartBalancing) AND xConfirmAlarms THEN
|
||||
xError := FALSE;
|
||||
_iState := 0;
|
||||
_iState := 51;
|
||||
END_IF
|
||||
END_CASE]]></ST>
|
||||
</Implementation>
|
||||
</Action>
|
||||
<LineIds Name="FB_Unit">
|
||||
<LineId Id="3" Count="498" />
|
||||
<LineId Id="2" Count="0" />
|
||||
</LineIds>
|
||||
<LineIds Name="FB_Unit.FB_init">
|
||||
<LineId Id="3" Count="7" />
|
||||
<LineId Id="2" Count="0" />
|
||||
</LineIds>
|
||||
<LineIds Name="FB_Unit.Name.Get">
|
||||
<LineId Id="2" Count="0" />
|
||||
</LineIds>
|
||||
<LineIds Name="FB_Unit.Name.Set">
|
||||
<LineId Id="3" Count="2" />
|
||||
<LineId Id="2" Count="0" />
|
||||
</LineIds>
|
||||
<LineIds Name="FB_Unit.StateMachine">
|
||||
<LineId Id="2" Count="8" />
|
||||
<LineId Id="317" Count="0" />
|
||||
<LineId Id="11" Count="88" />
|
||||
<LineId Id="318" Count="0" />
|
||||
<LineId Id="100" Count="20" />
|
||||
<LineId Id="319" Count="0" />
|
||||
<LineId Id="121" Count="82" />
|
||||
<LineId Id="321" Count="0" />
|
||||
<LineId Id="204" Count="5" />
|
||||
<LineId Id="322" Count="0" />
|
||||
<LineId Id="210" Count="87" />
|
||||
<LineId Id="323" Count="0" />
|
||||
<LineId Id="298" Count="18" />
|
||||
<LineId Id="1" Count="0" />
|
||||
</LineIds>
|
||||
</POU>
|
||||
</TcPlcObject>
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.12">
|
||||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4026.8">
|
||||
<POU Name="FB_PowerSupplySunspec" Id="{a826dd09-442c-45c5-8ae3-9b71f293003c}" SpecialFunc="None">
|
||||
<Declaration><![CDATA[FUNCTION_BLOCK FB_PowerSupplySunspec
|
||||
VAR_INPUT
|
||||
@@ -216,6 +216,11 @@ END_IF
|
||||
CASE _iState OF
|
||||
|
||||
0: // Off
|
||||
IF _tonPollingTimer.Q THEN
|
||||
_tonPollingTimer(IN := FALSE, PT := _timPollingDelay);
|
||||
_iState := 1;
|
||||
END_IF
|
||||
|
||||
// If enable and INTLK Ok
|
||||
IF xEnable THEN
|
||||
_iState := 10;
|
||||
@@ -224,10 +229,7 @@ CASE _iState OF
|
||||
_tonPollingTimer(IN := TRUE, PT := _timPollingDelay);
|
||||
END_IF
|
||||
|
||||
IF _tonPollingTimer.Q THEN
|
||||
_tonPollingTimer(IN := FALSE, PT := _timPollingDelay);
|
||||
_iState := 1;
|
||||
END_IF
|
||||
|
||||
|
||||
|
||||
1: // Read inverter status
|
||||
@@ -485,6 +487,7 @@ CASE _iState OF
|
||||
_iState := 25;
|
||||
// Check for valid value
|
||||
IF (_iWMaxSF < -10) OR (_iWMaxSF > 10) OR (_iWMaxSF = 16#8000) THEN
|
||||
ADSLOGSTR(msgCtrlMask := ADSLOG_MSGTYPE_HINT, msgFmtStr := 'FBInverter into error state from: %s', strArg := TO_STRING(_iState));
|
||||
// Goto error state
|
||||
_iState := 1000;
|
||||
END_IF
|
||||
@@ -1190,17 +1193,41 @@ _fbErrorInverterAlarm.CreateEx(stEventEntry := TC_EVENTS.Inverter.InverterError,
|
||||
_fbErrorInverterAlarm.ipArguments.Clear().AddString(_sName);]]></ST>
|
||||
</Implementation>
|
||||
</Method>
|
||||
<Property Name="Name" Id="{ef8c6e8f-7c1b-4781-b201-87f759acb289}">
|
||||
<Declaration><![CDATA[PROPERTY Name : string]]></Declaration>
|
||||
<Get Name="Get" Id="{bc17161e-727d-4abd-a845-a7eacc08f995}">
|
||||
<Declaration><![CDATA[VAR
|
||||
END_VAR
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[Name := _sName;]]></ST>
|
||||
</Implementation>
|
||||
</Get>
|
||||
<Set Name="Set" Id="{7fdecf53-efe5-43de-bc46-5f24fb6a7ffb}">
|
||||
<Declaration><![CDATA[VAR
|
||||
END_VAR
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[_sName := Name;
|
||||
|
||||
_fbErrorInverterAlarm.ipArguments.Clear().AddString(_sName);]]></ST>
|
||||
</Implementation>
|
||||
</Set>
|
||||
</Property>
|
||||
<LineIds Name="FB_PowerSupplySunspec">
|
||||
<LineId Id="774" Count="10" />
|
||||
<LineId Id="1550" Count="0" />
|
||||
<LineId Id="785" Count="3" />
|
||||
<LineId Id="785" Count="0" />
|
||||
<LineId Id="4104" Count="2" />
|
||||
<LineId Id="4103" Count="0" />
|
||||
<LineId Id="4107" Count="0" />
|
||||
<LineId Id="786" Count="2" />
|
||||
<LineId Id="2615" Count="0" />
|
||||
<LineId Id="790" Count="0" />
|
||||
<LineId Id="2614" Count="0" />
|
||||
<LineId Id="2613" Count="0" />
|
||||
<LineId Id="2616" Count="1" />
|
||||
<LineId Id="2906" Count="0" />
|
||||
<LineId Id="2618" Count="2" />
|
||||
<LineId Id="2616" Count="0" />
|
||||
<LineId Id="2619" Count="1" />
|
||||
<LineId Id="3661" Count="0" />
|
||||
<LineId Id="2621" Count="0" />
|
||||
<LineId Id="2623" Count="15" />
|
||||
@@ -1262,7 +1289,9 @@ _fbErrorInverterAlarm.ipArguments.Clear().AddString(_sName);]]></ST>
|
||||
<LineId Id="1725" Count="0" />
|
||||
<LineId Id="1721" Count="0" />
|
||||
<LineId Id="1433" Count="0" />
|
||||
<LineId Id="816" Count="28" />
|
||||
<LineId Id="816" Count="24" />
|
||||
<LineId Id="4096" Count="0" />
|
||||
<LineId Id="841" Count="3" />
|
||||
<LineId Id="1171" Count="0" />
|
||||
<LineId Id="845" Count="5" />
|
||||
<LineId Id="3656" Count="0" />
|
||||
@@ -1429,5 +1458,11 @@ _fbErrorInverterAlarm.ipArguments.Clear().AddString(_sName);]]></ST>
|
||||
<LineId Id="11" Count="0" />
|
||||
<LineId Id="7" Count="1" />
|
||||
</LineIds>
|
||||
<LineIds Name="FB_PowerSupplySunspec.Name.Get">
|
||||
<LineId Id="1" Count="0" />
|
||||
</LineIds>
|
||||
<LineIds Name="FB_PowerSupplySunspec.Name.Set">
|
||||
<LineId Id="1" Count="2" />
|
||||
</LineIds>
|
||||
</POU>
|
||||
</TcPlcObject>
|
||||
Reference in New Issue
Block a user