Iso and leackage error messages added
This commit is contained in:
@@ -55,6 +55,9 @@ VAR_INPUT
|
||||
sInverterIP : STRING;
|
||||
|
||||
xECStateSCS AT %I* : UINT;
|
||||
|
||||
xIsoErrorL1 AT %I* : BOOL;
|
||||
xIsoErrorL2 AT %I* : BOOL;
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
// Current string voltage
|
||||
@@ -134,6 +137,9 @@ VAR
|
||||
// Connection to SCS lost
|
||||
_fbSCSConnLost : FB_TcAlarm;
|
||||
|
||||
// Isolatio alarm
|
||||
_fbIsolationAlarm : FB_TcAlarm;
|
||||
|
||||
// Shutdown discharge stopped messages
|
||||
_fbSDDCLevel : FB_TcMessage;
|
||||
_fbSDUnitThreshold : FB_TcMessage;
|
||||
@@ -190,6 +196,11 @@ VAR
|
||||
// Start balancing internal signal
|
||||
_xStartBalancing : BOOL;
|
||||
|
||||
_xIsoError : BOOL;
|
||||
|
||||
// Iso error timeout
|
||||
_fbTONIsoError : TON;
|
||||
|
||||
// Internal SOC
|
||||
_rSOC : REAL;
|
||||
|
||||
@@ -237,6 +248,31 @@ IF xRepairSwitchOk AND _fbDCMainSwitchNotClosed.bRaised THEN
|
||||
END_IF
|
||||
|
||||
|
||||
// ===============================
|
||||
// ISO Error handling
|
||||
// ===============================
|
||||
// Mute iso error when inverter is enabled
|
||||
_xIsoError := ((NOT xIsoErrorL1) OR (NOT xIsoErrorL2)) AND (NOT _fbInverter.xActive);
|
||||
_fbTONIsoError(IN := _xIsoError, PT := GVL_CONFIG.timIsoErrorTimeout);
|
||||
|
||||
// _fbInverter
|
||||
IF _fbTONIsoError.Q AND (NOT _fbIsolationAlarm.bRaised) AND xReleaseErrors THEN
|
||||
_fbIsolationAlarm.Raise(0);
|
||||
END_IF
|
||||
|
||||
IF (NOT _fbTONIsoError.Q) AND _fbIsolationAlarm.bRaised THEN
|
||||
_fbIsolationAlarm.Clear(0, FALSE);
|
||||
END_IF
|
||||
|
||||
IF _fbIsolationAlarm.eConfirmationState = TcEventConfirmationState.WaitForConfirmation AND xConfirmAlarms THEN
|
||||
_fbIsolationAlarm.Confirm(0);
|
||||
END_IF
|
||||
|
||||
IF _fbTONIsoError.Q THEN
|
||||
xError := TRUE;
|
||||
END_IF
|
||||
|
||||
|
||||
// ===============================
|
||||
// DC current measurement
|
||||
// ===============================
|
||||
@@ -813,7 +849,11 @@ _fbSDDCLevel.CreateEx(TC_EVENTS.BMSEvents.SDDCVoltage, 0);
|
||||
_fbSDDCLevel.ipArguments.Clear().AddString(_sName);
|
||||
|
||||
_fbSDUnitThreshold.CreateEx(TC_EVENTS.BMSEvents.SDUnitThreshhold, 0);
|
||||
_fbSDUnitThreshold.ipArguments.Clear().AddString(_sName);]]></ST>
|
||||
_fbSDUnitThreshold.ipArguments.Clear().AddString(_sName);
|
||||
|
||||
// isolation alarm creation
|
||||
_fbIsolationAlarm.CreateEx(stEventEntry := TC_EVENTS.General.IsoError, bWithConfirmation := TRUE, 0);
|
||||
_fbIsolationAlarm.ipArguments.Clear().AddString(_sName);]]></ST>
|
||||
</Implementation>
|
||||
</Method>
|
||||
<Property Name="Name" Id="{19fcb6d4-fd4b-49f9-9791-1e4c931b9e69}">
|
||||
@@ -858,7 +898,27 @@ _fbSafetyInterlocksNotOkAlarm.ipArguments.Clear().AddString(_sName);]]></ST>
|
||||
<LineId Id="611" Count="0" />
|
||||
<LineId Id="610" Count="0" />
|
||||
<LineId Id="612" Count="1" />
|
||||
<LineId Id="11" Count="248" />
|
||||
<LineId Id="11" Count="10" />
|
||||
<LineId Id="638" Count="3" />
|
||||
<LineId Id="22" Count="0" />
|
||||
<LineId Id="664" Count="0" />
|
||||
<LineId Id="662" Count="0" />
|
||||
<LineId Id="665" Count="0" />
|
||||
<LineId Id="663" Count="0" />
|
||||
<LineId Id="661" Count="0" />
|
||||
<LineId Id="643" Count="0" />
|
||||
<LineId Id="646" Count="1" />
|
||||
<LineId Id="649" Count="0" />
|
||||
<LineId Id="648" Count="0" />
|
||||
<LineId Id="650" Count="1" />
|
||||
<LineId Id="653" Count="0" />
|
||||
<LineId Id="652" Count="0" />
|
||||
<LineId Id="654" Count="1" />
|
||||
<LineId Id="658" Count="0" />
|
||||
<LineId Id="657" Count="0" />
|
||||
<LineId Id="659" Count="1" />
|
||||
<LineId Id="642" Count="0" />
|
||||
<LineId Id="23" Count="236" />
|
||||
<LineId Id="623" Count="0" />
|
||||
<LineId Id="260" Count="6" />
|
||||
<LineId Id="624" Count="0" />
|
||||
@@ -906,6 +966,9 @@ _fbSafetyInterlocksNotOkAlarm.ipArguments.Clear().AddString(_sName);]]></ST>
|
||||
<LineId Id="34" Count="0" />
|
||||
<LineId Id="25" Count="5" />
|
||||
<LineId Id="2" Count="0" />
|
||||
<LineId Id="37" Count="0" />
|
||||
<LineId Id="36" Count="0" />
|
||||
<LineId Id="38" Count="1" />
|
||||
</LineIds>
|
||||
<LineIds Name="FB_String.Name.Get">
|
||||
<LineId Id="1" Count="0" />
|
||||
|
||||
Reference in New Issue
Block a user