From 2ce0dc599dbdf4dea1b08a72936251330fb079fe Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 2 Dec 2024 11:57:30 +0000 Subject: [PATCH 1/3] Create draft PR for #747 From 2ad4523cb3cc4889fb058648b2a44932d120619e Mon Sep 17 00:00:00 2001 From: peterbarancek <62284244+peterbarancek@users.noreply.github.com> Date: Tue, 3 Dec 2024 15:15:53 +0100 Subject: [PATCH 2/3] ***********TcoCore******** *service view of generic TcoComponent ,Details will be expanded by default if IsExpaded is selected **********TcoPneumatics******** +signalisation that movement is disabled by suspend method * MoveHomeTask automatically restores the opposite task, MoveWorkTask. This principle works in reverse as well --- .../TcoComponent/TcoComponentServiceView.xaml | 24 +++-- .../Cylinders/TcoCylinderServiceView.xaml | 31 +++--- .../TcoDoubleCylinderServiceView.xaml | 10 +- .../POUs/Cylinders/TcoCylinder.TcPOU | 57 ++++++---- .../POUs/Cylinders/TcoCylinderMoveTask.TcPOU | 7 +- .../POUs/Cylinders/TcoDoubleCylinder.TcPOU | 102 +++++++++++------- .../Sandbox/PlcOpen.Wpf.Sandbox/App.xaml | 2 + 7 files changed, 149 insertions(+), 84 deletions(-) diff --git a/src/TcoCore/src/TcoCore.Wpf/TcoComponent/TcoComponentServiceView.xaml b/src/TcoCore/src/TcoCore.Wpf/TcoComponent/TcoComponentServiceView.xaml index 3d2e1bb55..59ba553e2 100644 --- a/src/TcoCore/src/TcoCore.Wpf/TcoComponent/TcoComponentServiceView.xaml +++ b/src/TcoCore/src/TcoCore.Wpf/TcoComponent/TcoComponentServiceView.xaml @@ -31,7 +31,7 @@ - - - - - - - - - - + + + + + + + + + + + @@ -109,7 +111,7 @@ - + diff --git a/src/TcoPneumatics/src/TcoPneumatics.Wpf/Cylinders/TcoCylinderServiceView.xaml b/src/TcoPneumatics/src/TcoPneumatics.Wpf/Cylinders/TcoCylinderServiceView.xaml index 162a37a16..0f06218d4 100644 --- a/src/TcoPneumatics/src/TcoPneumatics.Wpf/Cylinders/TcoCylinderServiceView.xaml +++ b/src/TcoPneumatics/src/TcoPneumatics.Wpf/Cylinders/TcoCylinderServiceView.xaml @@ -6,7 +6,6 @@ xmlns:local="clr-namespace:TcOpen" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:tcopneumatics="clr-namespace:TcoPneumatics" xmlns:vortex="http://vortex.mts/xaml" mc:Ignorable="d"> @@ -22,28 +21,34 @@ - - + + - - + + + + + - - - - - + + + + + + + + diff --git a/src/TcoPneumatics/src/TcoPneumatics.Wpf/Cylinders/TcoDoubleCylinderServiceView.xaml b/src/TcoPneumatics/src/TcoPneumatics.Wpf/Cylinders/TcoDoubleCylinderServiceView.xaml index ae4c087c2..280e1aa65 100644 --- a/src/TcoPneumatics/src/TcoPneumatics.Wpf/Cylinders/TcoDoubleCylinderServiceView.xaml +++ b/src/TcoPneumatics/src/TcoPneumatics.Wpf/Cylinders/TcoDoubleCylinderServiceView.xaml @@ -28,7 +28,10 @@ Height="5" Background="{Binding _atHomePos.Cyclic, Converter={vortex:SignalToBrushConverter}}" CornerRadius="2" /> - + + + + - + + + + diff --git a/src/TcoPneumatics/src/XaeTcoPneumatics/TcoPneumatics/POUs/Cylinders/TcoCylinder.TcPOU b/src/TcoPneumatics/src/XaeTcoPneumatics/TcoPneumatics/POUs/Cylinders/TcoCylinder.TcPOU index 642c19edf..99e79e7e5 100644 --- a/src/TcoPneumatics/src/XaeTcoPneumatics/TcoPneumatics/POUs/Cylinders/TcoCylinder.TcPOU +++ b/src/TcoPneumatics/src/XaeTcoPneumatics/TcoPneumatics/POUs/Cylinders/TcoCylinder.TcPOU @@ -13,6 +13,8 @@ VAR {attribute addProperty Name "|[[1]Attribute_stopDefaultName]|"} _stopDefault : TcoCore.TcoTask(THIS^); increment: INT; + _suspendedHome:BOOL; + _suspendedWork:BOOL; END_VAR VAR _config : TcoCylinderConfig; @@ -21,6 +23,7 @@ VAR END_VAR]]> '); END_IF; @@ -32,12 +35,11 @@ _moveHomeDefault(PositionSensor := _atHomePos AND NOT _atWorkPos, MoveToPositionSignal := _toHomePos, InverseSignal := _toWorkPos, TimeToRefill:=_config.TimeToRefill, + refInverseTask:=_moveWorkDefault, MaxTimeToReachPosition := _config.TimeToReachHomePosition, PositionName := '<#Home#>'); -IF _moveHomeDefault.Execute() THEN - _moveWorkDefault.Restore(); -END_IF + // Disables mutualy exclusive actions _moveHomeDefault.Enabled := TRUE;//NOT _moveWorkDefault.Busy; @@ -46,12 +48,10 @@ _moveWorkDefault(PositionSensor := _atWorkPos AND NOT _atHomePos, MoveToPositionSignal := _toWorkPos, InverseSignal := _toHomePos, TimeToRefill:=_config.TimeToRefill, + refInverseTask:=_moveHomeDefault, MaxTimeToReachPosition := _config.TimeToReachWorkPosition, PositionName := '<#Work#>'); -IF _moveWorkDefault.Execute() THEN - _moveHomeDefault.Restore(); -END_IF IF (_stopDefault.Execute()) THEN _toHomePos := FALSE; @@ -65,6 +65,8 @@ IF (_stopDefault.Execute()) THEN _stopDefault.DoneWhen(TRUE); END_IF + + // For further discussion about Status IF(_moveHomeDefault.Busy) THEN _status.ActionDescription := 'Moving to home position'; @@ -307,7 +309,9 @@ VAR _signalInfo : TcoSignalInfo; END_VAR]]> - : ' , _signalInfo.SymbolPath)); _toHomePos := FALSE; @@ -324,7 +328,9 @@ VAR_INPUT END_VAR ]]> - : ' , inMessage)); _toHomePos := FALSE; IF(__ISVALIDREF(THIS^.inoToHomePos)) THEN THIS^.inoToHomePos := FALSE; END_IF; @@ -360,7 +366,9 @@ VAR _signalInfo : TcoSignalInfo; END_VAR]]> - : ' , _signalInfo.SymbolPath)); _toHomePos := FALSE; @@ -397,7 +405,8 @@ VAR _signalInfo : TcoSignalInfo; END_VAR]]> - : ' , _signalInfo.SymbolPath)); _toWorkPos := FALSE; @@ -414,11 +423,15 @@ VAR_INPUT END_VAR ]]> - : ' , inMessage)); - _toWorkPos := FALSE; - IF(__ISVALIDREF(THIS^.inoToWorkPos)) THEN THIS^.inoToWorkPos := FALSE; END_IF; - + : ', inMessage)); + _toWorkPos := FALSE; + IF (__ISVALIDREF(THIS^.inoToWorkPos)) THEN + THIS^.inoToWorkPos := FALSE; + END_IF; + END_IF]]> @@ -450,11 +463,15 @@ VAR _signalInfo : TcoSignalInfo; END_VAR]]> - : ' , _signalInfo.SymbolPath)); - _toWorkPos := FALSE; - IF(__ISVALIDREF(THIS^.inoToWorkPos)) THEN THIS^.inoToWorkPos := FALSE; END_IF; + : ', _signalInfo.SymbolPath)); + _toWorkPos := FALSE; + IF (__ISVALIDREF(THIS^.inoToWorkPos)) THEN + THIS^.inoToWorkPos := FALSE; + END_IF; END_IF]]> diff --git a/src/TcoPneumatics/src/XaeTcoPneumatics/TcoPneumatics/POUs/Cylinders/TcoCylinderMoveTask.TcPOU b/src/TcoPneumatics/src/XaeTcoPneumatics/TcoPneumatics/POUs/Cylinders/TcoCylinderMoveTask.TcPOU index f8c404cce..8a6ee7945 100644 --- a/src/TcoPneumatics/src/XaeTcoPneumatics/TcoPneumatics/POUs/Cylinders/TcoCylinderMoveTask.TcPOU +++ b/src/TcoPneumatics/src/XaeTcoPneumatics/TcoPneumatics/POUs/Cylinders/TcoCylinderMoveTask.TcPOU @@ -1,5 +1,5 @@  - + - + diff --git a/src/TcoPneumatics/src/XaeTcoPneumatics/TcoPneumatics/POUs/Cylinders/TcoDoubleCylinder.TcPOU b/src/TcoPneumatics/src/XaeTcoPneumatics/TcoPneumatics/POUs/Cylinders/TcoDoubleCylinder.TcPOU index 8b48d5f5b..2c431a033 100644 --- a/src/TcoPneumatics/src/XaeTcoPneumatics/TcoPneumatics/POUs/Cylinders/TcoDoubleCylinder.TcPOU +++ b/src/TcoPneumatics/src/XaeTcoPneumatics/TcoPneumatics/POUs/Cylinders/TcoDoubleCylinder.TcPOU @@ -12,16 +12,19 @@ VAR _moveWorkDefault : TcoCylinderMoveTask(THIS^); {attribute addProperty Name "|[[1]Attribute_stopDefaultName]|"} _stopDefault : TcoCore.TcoTask(THIS^); - increment: INT; + increment : INT; + _suspendedHome : BOOL; + _suspendedWork : BOOL; END_VAR VAR _config : TcoCylinderConfig; - _status : TcoCylinderStatus; - _refillTimer:TON; + _status : TcoCylinderStatus; + _refillTimer : TON; END_VAR]]> '); END_IF; @@ -32,11 +35,9 @@ _moveHomeDefault(PositionSensor := _atHomePos AND NOT _atWorkPos, MoveToPositionSignal := _toHomePos, InverseSignal := _toWorkPos, TimeToRefill:=_config.TimeToRefill, + refInverseTask:=_moveWorkDefault, MaxTimeToReachPosition := _config.TimeToReachHomePosition, PositionName := '<#Home#>'); -IF _moveHomeDefault.Execute() THEN - _moveWorkDefault.Restore(); -END_IF // Disables mutualy exclusive actions _moveHomeDefault.Enabled :=true;// NOT _moveWorkDefault.Busy; @@ -45,12 +46,10 @@ _moveWorkDefault(PositionSensor := _atWorkPos AND NOT _atHomePos, MoveToPositionSignal := _toWorkPos, InverseSignal := _toHomePos, TimeToRefill:=_config.TimeToRefill, + refInverseTask:=_moveHomeDefault, MaxTimeToReachPosition := _config.TimeToReachWorkPosition, PositionName := '<#Work#>'); -IF _moveWorkDefault.Execute() THEN - _moveHomeDefault.Restore(); -END_IF IF (_stopDefault.Execute()) THEN @@ -309,10 +308,13 @@ VAR _signalInfo : TcoSignalInfo; END_VAR]]> - : ' , _signalInfo.SymbolPath)); _toHomePos := FALSE; + IF(__ISVALIDREF(THIS^.inoToHomePos)) THEN THIS^.inoToHomePos := FALSE; END_IF; END_IF]]> @@ -326,11 +328,16 @@ VAR_INPUT END_VAR ]]> - : ' , inMessage)); - _toHomePos := FALSE; - IF(__ISVALIDREF(THIS^.inoToHomePos)) THEN THIS^.inoToHomePos := FALSE; END_IF; + : ', inMessage)); + _toHomePos := FALSE; + IF (__ISVALIDREF(THIS^.inoToHomePos)) THEN + THIS^.inoToHomePos := FALSE; + END_IF; + END_IF;]]> @@ -362,12 +369,17 @@ VAR _signalInfo : TcoSignalInfo; END_VAR]]> - : ' , _signalInfo.SymbolPath)); - _toHomePos := FALSE; - IF(__ISVALIDREF(THIS^.inoToHomePos)) THEN THIS^.inoToHomePos := FALSE; END_IF; - + : ', _signalInfo.SymbolPath)); + _toHomePos := FALSE; + + IF (__ISVALIDREF(THIS^.inoToHomePos)) THEN + THIS^.inoToHomePos := FALSE; + END_IF; + END_IF]]> @@ -399,11 +411,16 @@ VAR _signalInfo : TcoSignalInfo; END_VAR]]> - : ' , _signalInfo.SymbolPath)); - _toWorkPos := FALSE; - IF(__ISVALIDREF(THIS^.inoToWorkPos)) THEN THIS^.inoToWorkPos := FALSE; END_IF; + : ', _signalInfo.SymbolPath)); + _toWorkPos := FALSE; + + IF (__ISVALIDREF(THIS^.inoToWorkPos)) THEN + THIS^.inoToWorkPos := FALSE; + END_IF; END_IF]]> @@ -414,13 +431,21 @@ VAR_INPUT inDisableCondition : BOOL; inMessage:STRING; END_VAR -]]> + +VAR + inoDisableCondition: BOOL; +END_VAR]]> - : ' , inMessage)); - _toWorkPos := FALSE; - IF(__ISVALIDREF(THIS^.inoToWorkPos)) THEN THIS^.inoToWorkPos := FALSE; END_IF; - + : ', inMessage)); + _toWorkPos := FALSE; + + IF (__ISVALIDREF(THIS^.inoToWorkPos)) THEN + THIS^.inoToWorkPos := FALSE; + END_IF; + END_IF]]> @@ -452,11 +477,16 @@ VAR _signalInfo : TcoSignalInfo; END_VAR]]> - : ' , _signalInfo.SymbolPath)); - _toWorkPos := FALSE; - IF(__ISVALIDREF(THIS^.inoToWorkPos)) THEN THIS^.inoToWorkPos := FALSE; END_IF; + : ', _signalInfo.SymbolPath)); + _toWorkPos := FALSE; + + IF (__ISVALIDREF(THIS^.inoToWorkPos)) THEN + THIS^.inoToWorkPos := FALSE; + END_IF; END_IF]]> diff --git a/src/TcoPneumatics/tests/Sandbox/PlcOpen.Wpf.Sandbox/App.xaml b/src/TcoPneumatics/tests/Sandbox/PlcOpen.Wpf.Sandbox/App.xaml index ba25c3565..974fe0d94 100644 --- a/src/TcoPneumatics/tests/Sandbox/PlcOpen.Wpf.Sandbox/App.xaml +++ b/src/TcoPneumatics/tests/Sandbox/PlcOpen.Wpf.Sandbox/App.xaml @@ -16,6 +16,8 @@ + +