Skip to content

Commit

Permalink
* provide blocking information into service view, fixed if suspend me…
Browse files Browse the repository at this point in the history
…thod is called more than one
  • Loading branch information
peterbarancek committed Dec 4, 2024
1 parent a283bbc commit eca54b7
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ VAR
increment: INT;
_suspendedHome:BOOL;
_suspendedWork:BOOL;
{attribute 'hide'}
_suspendedHomeCounter:INT;
{attribute 'hide'}
_suspendedWorkCounter:INT;
END_VAR
VAR
_config : TcoCylinderConfig;
Expand All @@ -23,6 +27,8 @@ VAR
END_VAR]]></Declaration>
<Implementation>
<ST><![CDATA[SUPER^(inoAtHomePos := inoAtHomePos, inoAtWorkPos := inoAtWorkPos, inoToHomePos := inoToHomePos, inoToWorkPos := inoToWorkPos);
_suspendedHomeCounter:=0;
_suspendedWorkCounter:=0;
IF(_atHomePos AND _atWorkPos) THEN Messenger.Error('<#Home and work position sensors are both active. Check the position of sensors!#>'); END_IF;
Expand Down Expand Up @@ -309,7 +315,10 @@ VAR
_signalInfo : TcoSignalInfo;
END_VAR]]></Declaration>
<Implementation>
<ST><![CDATA[_suspendedHome:=inoDisableCondition;
<ST><![CDATA[IF inoDisableCondition THEN
_suspendedHomeCounter:=_suspendedHomeCounter+1;
END_IF
_suspendedHome:=_suspendedHomeCounter>0;
IF (_toHomePos OR _moveHomeDefault.Busy) AND inoDisableCondition THEN
_signalInfo.GetSignalInfo(SIZEOF(inoDisableCondition), ADR(inoDisableCondition));
Expand All @@ -328,7 +337,10 @@ VAR_INPUT
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[_suspendedHome:=inDisableCondition;
<ST><![CDATA[IF inDisableCondition THEN
_suspendedHomeCounter:=_suspendedHomeCounter+1;
END_IF
_suspendedHome:=_suspendedHomeCounter>0;
IF (_toHomePos OR _moveHomeDefault.Busy) AND inDisableCondition THEN
Messenger.Warning(CONCAT('<#Movement suspended due to#> : ' , inMessage));
Expand Down Expand Up @@ -366,7 +378,10 @@ VAR
_signalInfo : TcoSignalInfo;
END_VAR]]></Declaration>
<Implementation>
<ST><![CDATA[_suspendedHome:=inoDisableCondition;
<ST><![CDATA[IF inoDisableCondition THEN
_suspendedHomeCounter:=_suspendedHomeCounter+1;
END_IF
_suspendedHome:=_suspendedHomeCounter>0;
IF (_toHomePos OR _moveHomeDefault.Busy) AND not inoDisableCondition THEN
_signalInfo.GetSignalInfo(SIZEOF(inoDisableCondition), ADR(inoDisableCondition));
Expand Down Expand Up @@ -405,7 +420,11 @@ VAR
_signalInfo : TcoSignalInfo;
END_VAR]]></Declaration>
<Implementation>
<ST><![CDATA[_suspendedWork:=inoDisableCondition;
<ST><![CDATA[IF inoDisableCondition THEN
_suspendedWorkCounter:=_suspendedWorkCounter+1;
END_IF
_suspendedWork:=_suspendedWorkCounter>0;
IF (_toWorkPos OR _moveWorkDefault.Busy) AND inoDisableCondition THEN
_signalInfo.GetSignalInfo(SIZEOF(inoDisableCondition), ADR(inoDisableCondition));
Messenger.Warning(CONCAT('<#Movement suspended due to#> : ' , _signalInfo.SymbolPath));
Expand All @@ -423,7 +442,10 @@ VAR_INPUT
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[_suspendedWork := inDisableCondition;
<ST><![CDATA[IF inDisableCondition THEN
_suspendedWorkCounter:=_suspendedWorkCounter+1;
END_IF
_suspendedWork:=_suspendedWorkCounter>0;
IF (_toWorkPos OR _moveWorkDefault.Busy) AND inDisableCondition THEN
Messenger.Warning(CONCAT('<#Movement suspended due to#> : ', inMessage));
Expand Down Expand Up @@ -463,7 +485,10 @@ VAR
_signalInfo : TcoSignalInfo;
END_VAR]]></Declaration>
<Implementation>
<ST><![CDATA[_suspendedWork := inoDisableCondition;
<ST><![CDATA[IF inoDisableCondition THEN
_suspendedWorkCounter:=_suspendedWorkCounter+1;
END_IF
_suspendedWork:=_suspendedWorkCounter>0;
IF (_toWorkPos OR _moveWorkDefault.Busy) AND not inoDisableCondition THEN
_signalInfo.GetSignalInfo(SIZEOF(inoDisableCondition), ADR(inoDisableCondition));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ VAR
increment : INT;
_suspendedHome : BOOL;
_suspendedWork : BOOL;
{attribute 'hide'}
_suspendedHomeCounter:INT;
{attribute 'hide'}
_suspendedWorkCounter:INT;
END_VAR
VAR
_config : TcoCylinderConfig;
Expand All @@ -24,7 +27,8 @@ VAR
END_VAR]]></Declaration>
<Implementation>
<ST><![CDATA[SUPER^(inoAtHomePos1 := inoAtHomePos1,inoAtHomePos2 := inoAtHomePos2, inoAtWorkPos1 := inoAtWorkPos1,inoAtWorkPos2 := inoAtWorkPos2, inoToHomePos := inoToHomePos, inoToWorkPos := inoToWorkPos);
_suspendedHomeCounter:=0;
_suspendedWorkCounter:=0;
IF(_atHomePos AND _atWorkPos) THEN Messenger.Error('<#Home and work position sensors are both active. Check the position of sensors!#>'); END_IF;
Expand Down Expand Up @@ -308,7 +312,10 @@ VAR
_signalInfo : TcoSignalInfo;
END_VAR]]></Declaration>
<Implementation>
<ST><![CDATA[_suspendedHome:=inoDisableCondition;
<ST><![CDATA[IF inoDisableCondition THEN
_suspendedHomeCounter:=_suspendedHomeCounter+1;
END_IF
_suspendedHome:=_suspendedHomeCounter>0;
IF (_toHomePos OR _moveHomeDefault.Busy) AND inoDisableCondition THEN
_signalInfo.GetSignalInfo(SIZEOF(inoDisableCondition), ADR(inoDisableCondition));
Expand All @@ -328,8 +335,10 @@ VAR_INPUT
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[_suspendedHome := inDisableCondition;
<ST><![CDATA[IF inDisableCondition THEN
_suspendedHomeCounter:=_suspendedHomeCounter+1;
END_IF
_suspendedHome:=_suspendedHomeCounter>0;
IF (_toHomePos OR _moveHomeDefault.Busy) AND inDisableCondition THEN
Messenger.Warning(CONCAT('<#Movement suspended due to#> : ', inMessage));
_toHomePos := FALSE;
Expand Down Expand Up @@ -369,7 +378,10 @@ VAR
_signalInfo : TcoSignalInfo;
END_VAR]]></Declaration>
<Implementation>
<ST><![CDATA[_suspendedHome := inoDisableCondition;
<ST><![CDATA[IF inoDisableCondition THEN
_suspendedHomeCounter:=_suspendedHomeCounter+1;
END_IF
_suspendedHome:=_suspendedHomeCounter>0;
IF (_toHomePos OR _moveHomeDefault.Busy) AND NOT inoDisableCondition THEN
_signalInfo.GetSignalInfo(SIZEOF(inoDisableCondition), ADR(inoDisableCondition));
Expand Down Expand Up @@ -411,7 +423,10 @@ VAR
_signalInfo : TcoSignalInfo;
END_VAR]]></Declaration>
<Implementation>
<ST><![CDATA[_suspendedWork := inoDisableCondition;
<ST><![CDATA[IF inoDisableCondition THEN
_suspendedWorkCounter:=_suspendedWorkCounter+1;
END_IF
_suspendedWork:=_suspendedWorkCounter>0;
IF (_toWorkPos OR _moveWorkDefault.Busy) AND inoDisableCondition THEN
_signalInfo.GetSignalInfo(SIZEOF(inoDisableCondition), ADR(inoDisableCondition));
Expand All @@ -436,7 +451,10 @@ VAR
inoDisableCondition: BOOL;
END_VAR]]></Declaration>
<Implementation>
<ST><![CDATA[_suspendedWork := inDisableCondition;
<ST><![CDATA[IF inDisableCondition THEN
_suspendedWorkCounter:=_suspendedWorkCounter+1;
END_IF
_suspendedWork:=_suspendedWorkCounter>0;
IF (_toWorkPos OR _moveWorkDefault.Busy) AND inDisableCondition THEN
Messenger.Warning(CONCAT('<#Movement suspended due to#> : ', inMessage));
Expand Down Expand Up @@ -477,7 +495,10 @@ VAR
_signalInfo : TcoSignalInfo;
END_VAR]]></Declaration>
<Implementation>
<ST><![CDATA[_suspendedWork := inoDisableCondition;
<ST><![CDATA[IF inoDisableCondition THEN
_suspendedWorkCounter:=_suspendedWorkCounter+1;
END_IF
_suspendedWork:=_suspendedWorkCounter>0;
IF (_toWorkPos OR _moveWorkDefault.Busy) AND NOT inoDisableCondition THEN
_signalInfo.GetSignalInfo(SIZEOF(inoDisableCondition), ADR(inoDisableCondition));
Expand Down

0 comments on commit eca54b7

Please sign in to comment.