Fixed Modbus register access
This commit is contained in:
@@ -37,6 +37,9 @@ VAR_OUTPUT
|
||||
// Unit completely off
|
||||
xOff : BOOL := TRUE;
|
||||
|
||||
// All safetyinterlocks are ok
|
||||
xSafetyIntlksOk : BOOL;
|
||||
|
||||
// Unit can be discharged during shutdown sequence
|
||||
xShutdownDischargeAllowed : BOOL;
|
||||
|
||||
@@ -57,7 +60,7 @@ VAR_OUTPUT
|
||||
END_VAR
|
||||
VAR
|
||||
// Check unit condition after some time during startup
|
||||
_timUnitStartupWaitTime : TIME := T#20S;
|
||||
// _timUnitStartupWaitTime : TIME := T#10S;
|
||||
|
||||
// Valves posolyt
|
||||
_fbPosolytValveTankOutlet : FB_Valve('Posolyt tank outlet');
|
||||
@@ -152,6 +155,9 @@ _xErrorActive := FALSE;
|
||||
// Reset warning active
|
||||
_xWarningActive := FALSE;
|
||||
|
||||
// Reset safety interlocks flag
|
||||
xSafetyIntlksOk := TRUE;
|
||||
|
||||
// ===============================
|
||||
// Valve posolyt tank outlet
|
||||
// ===============================
|
||||
@@ -177,6 +183,11 @@ IF _fbPosolytValveTankOutlet.xError THEN
|
||||
_xErrorActive := TRUE;
|
||||
END_IF
|
||||
|
||||
// Set safety interlock flag if fb has safety interlocks active
|
||||
IF NOT stHMIInterface.stPosolytValve.stInterlock.xSafetyINTLKOk THEN
|
||||
xSafetyIntlksOk := FALSE;
|
||||
END_IF
|
||||
|
||||
|
||||
// ===============================
|
||||
// Valve negolyt tank outlet
|
||||
@@ -203,6 +214,11 @@ IF _fbNegolytValveTankOutlet.xError THEN
|
||||
_xErrorActive := TRUE;
|
||||
END_IF
|
||||
|
||||
// Set safety interlock flag if fb has safety interlocks active
|
||||
IF NOT stHMIInterface.stNegolytValve.stInterlock.xSafetyINTLKOk THEN
|
||||
xSafetyIntlksOk := FALSE;
|
||||
END_IF
|
||||
|
||||
|
||||
// ===============================
|
||||
// Pump posolyt segment inlet
|
||||
@@ -242,6 +258,11 @@ IF _fbPosolytPumpInlet.xWarning THEN
|
||||
_xWarningActive := TRUE;
|
||||
END_IF
|
||||
|
||||
// Set safety interlock flag if fb has safety interlocks active
|
||||
IF NOT stHMIInterface.stPosolytPump.stInterlock.xSafetyINTLKOk THEN
|
||||
xSafetyIntlksOk := FALSE;
|
||||
END_IF
|
||||
|
||||
|
||||
// ===============================
|
||||
// Pump negolyt segment inlet
|
||||
@@ -281,6 +302,11 @@ IF _fbNegolytPumpInlet.xWarning THEN
|
||||
_xWarningActive := TRUE;
|
||||
END_IF
|
||||
|
||||
// Set safety interlock flag if fb has safety interlocks active
|
||||
IF NOT stHMIInterface.stNegolytPump.stInterlock.xSafetyINTLKOk THEN
|
||||
xSafetyIntlksOk := FALSE;
|
||||
END_IF
|
||||
|
||||
|
||||
// ===============================
|
||||
// Pressure sensor posolyt segment inlet
|
||||
@@ -510,7 +536,7 @@ CASE _iState OF
|
||||
END_IF
|
||||
|
||||
30: // Wait some time
|
||||
_tonStartupCheck(In := TRUE, PT := _timUnitStartupWaitTime);
|
||||
_tonStartupCheck(In := TRUE, PT := GVL_CONFIG.timUnitStartupTime);
|
||||
|
||||
// After some time, check if all values are ok
|
||||
IF _tonStartupCheck.Q THEN
|
||||
@@ -534,7 +560,6 @@ CASE _iState OF
|
||||
|
||||
35: // Unit in enabled state
|
||||
IF (NOT xEnable) AND NOT _xErrorActive THEN
|
||||
_xEnableVoltageLimitChecks := FALSE;
|
||||
_iState := 40;
|
||||
END_IF
|
||||
|
||||
@@ -557,6 +582,7 @@ CASE _iState OF
|
||||
// When there is an error trying to close the valves,
|
||||
// dont try to discharge the segment
|
||||
IF _fbNegolytValveTankOutlet.xError OR _fbPosolytValveTankOutlet.xError THEN
|
||||
_xEnableVoltageLimitChecks := FALSE;
|
||||
_iState := 60;
|
||||
END_IF
|
||||
|
||||
@@ -570,6 +596,7 @@ CASE _iState OF
|
||||
xShutdownDischargeAllowed := TRUE;
|
||||
ELSE
|
||||
xShutdownDischargeAllowed := FALSE;
|
||||
_xEnableVoltageLimitChecks := FALSE;
|
||||
END_IF
|
||||
|
||||
IF (_fbVoltageSegment.rScaledValue <= GVL_CONFIG.rPumpshutoffThreshold) THEN
|
||||
@@ -648,14 +675,53 @@ END_VAR
|
||||
<Implementation>
|
||||
<ST><![CDATA[_sName := sName;
|
||||
|
||||
// Create not all components in automatic mode alarm
|
||||
_fbNotAllAutomaticAlarm.CreateEx(TC_EVENTS.General.NotAllCompInAutomatic, bWithConfirmation := FALSE, 0);
|
||||
_fbNotAllAutomaticAlarm.ipArguments.Clear().AddString(_sName);]]></ST>
|
||||
</Implementation>
|
||||
</Method>
|
||||
<Property Name="Name" Id="{a82783d4-f1f5-481b-bbb0-7ea8279de793}">
|
||||
<Declaration><![CDATA[PROPERTY Name : String]]></Declaration>
|
||||
<Get Name="Get" Id="{62ca6bce-5aa4-40f1-aa68-f3e5d22ad4a4}">
|
||||
<Declaration><![CDATA[VAR
|
||||
END_VAR
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[Name := _sName;]]></ST>
|
||||
</Implementation>
|
||||
</Get>
|
||||
<Set Name="Set" Id="{b2e0f6da-5412-45b8-aacd-c140a5beab95}">
|
||||
<Declaration><![CDATA[VAR
|
||||
END_VAR
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[_sName := Name;
|
||||
|
||||
// Create alarm message
|
||||
_fbNotAllAutomaticAlarm.ipArguments.Clear().AddString(_sName);]]></ST>
|
||||
</Implementation>
|
||||
</Set>
|
||||
</Property>
|
||||
<LineIds Name="FB_Unit">
|
||||
<LineId Id="4232" Count="29" />
|
||||
<LineId Id="4232" Count="4" />
|
||||
<LineId Id="5406" Count="1" />
|
||||
<LineId Id="5405" Count="0" />
|
||||
<LineId Id="4237" Count="24" />
|
||||
<LineId Id="5408" Count="0" />
|
||||
<LineId Id="4584" Count="0" />
|
||||
<LineId Id="4263" Count="102" />
|
||||
<LineId Id="5409" Count="2" />
|
||||
<LineId Id="5418" Count="0" />
|
||||
<LineId Id="4263" Count="25" />
|
||||
<LineId Id="5412" Count="2" />
|
||||
<LineId Id="4289" Count="0" />
|
||||
<LineId Id="5416" Count="0" />
|
||||
<LineId Id="5415" Count="0" />
|
||||
<LineId Id="4290" Count="36" />
|
||||
<LineId Id="5420" Count="3" />
|
||||
<LineId Id="5419" Count="0" />
|
||||
<LineId Id="4327" Count="38" />
|
||||
<LineId Id="5425" Count="3" />
|
||||
<LineId Id="5424" Count="0" />
|
||||
<LineId Id="4619" Count="0" />
|
||||
<LineId Id="4367" Count="46" />
|
||||
<LineId Id="5099" Count="0" />
|
||||
@@ -708,7 +774,6 @@ _fbNotAllAutomaticAlarm.ipArguments.Clear().AddString(_sName);]]></ST>
|
||||
<LineId Id="4496" Count="0" />
|
||||
<LineId Id="4794" Count="0" />
|
||||
<LineId Id="4497" Count="12" />
|
||||
<LineId Id="4795" Count="0" />
|
||||
<LineId Id="4511" Count="1" />
|
||||
<LineId Id="5078" Count="0" />
|
||||
<LineId Id="5083" Count="0" />
|
||||
@@ -717,7 +782,9 @@ _fbNotAllAutomaticAlarm.ipArguments.Clear().AddString(_sName);]]></ST>
|
||||
<LineId Id="5081" Count="0" />
|
||||
<LineId Id="4513" Count="7" />
|
||||
<LineId Id="5239" Count="0" />
|
||||
<LineId Id="4521" Count="7" />
|
||||
<LineId Id="4521" Count="5" />
|
||||
<LineId Id="5441" Count="0" />
|
||||
<LineId Id="4527" Count="1" />
|
||||
<LineId Id="4653" Count="0" />
|
||||
<LineId Id="4655" Count="2" />
|
||||
<LineId Id="4654" Count="0" />
|
||||
@@ -725,6 +792,7 @@ _fbNotAllAutomaticAlarm.ipArguments.Clear().AddString(_sName);]]></ST>
|
||||
<LineId Id="5220" Count="0" />
|
||||
<LineId Id="5223" Count="0" />
|
||||
<LineId Id="5225" Count="1" />
|
||||
<LineId Id="5440" Count="0" />
|
||||
<LineId Id="5224" Count="0" />
|
||||
<LineId Id="5221" Count="0" />
|
||||
<LineId Id="4531" Count="0" />
|
||||
@@ -751,7 +819,7 @@ _fbNotAllAutomaticAlarm.ipArguments.Clear().AddString(_sName);]]></ST>
|
||||
<LineId Id="5084" Count="0" />
|
||||
<LineId Id="5086" Count="1" />
|
||||
<LineId Id="5089" Count="1" />
|
||||
<LineId Id="5093" Count="0" />
|
||||
<LineId Id="5434" Count="0" />
|
||||
<LineId Id="5227" Count="0" />
|
||||
<LineId Id="5240" Count="0" />
|
||||
<LineId Id="5092" Count="0" />
|
||||
@@ -763,8 +831,19 @@ _fbNotAllAutomaticAlarm.ipArguments.Clear().AddString(_sName);]]></ST>
|
||||
<LineId Id="2754" Count="0" />
|
||||
</LineIds>
|
||||
<LineIds Name="FB_Unit.FB_init">
|
||||
<LineId Id="11" Count="1" />
|
||||
<LineId Id="11" Count="0" />
|
||||
<LineId Id="20" Count="0" />
|
||||
<LineId Id="12" Count="0" />
|
||||
<LineId Id="7" Count="1" />
|
||||
</LineIds>
|
||||
<LineIds Name="FB_Unit.Name.Get">
|
||||
<LineId Id="2" Count="0" />
|
||||
</LineIds>
|
||||
<LineIds Name="FB_Unit.Name.Set">
|
||||
<LineId Id="2" Count="0" />
|
||||
<LineId Id="7" Count="0" />
|
||||
<LineId Id="6" Count="0" />
|
||||
<LineId Id="5" Count="0" />
|
||||
</LineIds>
|
||||
</POU>
|
||||
</TcPlcObject>
|
||||
Reference in New Issue
Block a user