Skip to content

Commit

Permalink
[BUG]TcoCarousel doesnt continue if is not in position (#624)
Browse files Browse the repository at this point in the history
* Create draft PR for #618

* +_notInPositionMessage  for aditional diag tool, if carousel not in default position there is option to rotate it anyway by ack notInPositionMessage

---------

Co-authored-by: peterbarancek <peterbarancek@users.noreply.github.com>
Co-authored-by: Peter Barancek <peter.barancek@mts.sk>
  • Loading branch information
3 people committed Jul 24, 2023
1 parent 04e0497 commit ff6ea7a
Showing 1 changed file with 19 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ VAR
_varInfo : __SYSTEM.VAR_INFO;
{attribute 'hide'}
_sb : TcoCore.StringBuilder;
_notInPositionMessage : TcoCore.TcoMessenger(THIS^);
END_VAR
]]></Declaration>
Expand Down Expand Up @@ -59,23 +61,28 @@ END_VAR
END_IF
IF _progress=1 THEN
Messenger.Info('<#Calulate next expected Id position#>');
inoStatus.ExpectedNextPosition := GetIdentifierAtPosition( inoConfig.NumberOfPositions,inoStatus.Positions);
Messenger.OnCondition(inoStatus.CurrentPosition=0 AND inoInPosition).Error('<#Incorrectly coded current position. Check configuration of code bits! #>').Pin();
IF inoStatus.CurrentPosition <> 0 AND inoInPosition THEN
_progress := 10;
END_IF;
_notInPositionMessage.OnCondition(NOT inoInPosition).Error('<#Rotatiting started , but table is not in default position! Acknowledge this alarm if you still want to turn! #>').Pin();
_progress:=10;
END_IF;
IF _progress=10 THEN
Messenger.Warning('<#Expecting table in position. #>');
IF inoInPosition THEN
Messenger.Info('<#Calulate next expected Id position#>');
IF inoStatus.CurrentPosition <> 0 THEN
inoStatus.ExpectedNextPosition := GetIdentifierAtPosition( inoConfig.NumberOfPositions,inoStatus.Positions);
END_IF;
_progress := _progress+10;
END_IF
Messenger.OnCondition(inoStatus.CurrentPosition=0 AND inoInPosition).Error('<#Incorrectly coded current position. Check configuration of code bits! #>').Pin();
IF inoStatus.CurrentPosition <> 0 AND inoInPosition THEN
_progress := 20;
ELSIF NOT _notInPositionMessage.Pinned THEN
_progress:=20;
_notInPositionMessage.UnPin();
END_IF;
END_IF;
IF _progress=20 THEN
Expand Down Expand Up @@ -231,6 +238,7 @@ METHOD Restore : ITcoRestorable]]></Declaration>
_progress := 0;
CallTimers(FALSE);
Messenger.UnPin();
_notInPositionMessage.UnPin();
]]></ST>
</Implementation>
</Method>
Expand Down

0 comments on commit ff6ea7a

Please sign in to comment.