Skip to content

Commit

Permalink
[ENHANCEMENT]Tcopen Wokrshop issues (#92)
Browse files Browse the repository at this point in the history
* Create draft PR for #91

* *fix open points  from workshop

---------

Co-authored-by: peterbarancek <[email protected]>
Co-authored-by: Peter Barancek <[email protected]>
  • Loading branch information
3 people authored Dec 4, 2023
1 parent ec2b13f commit b58064c
Show file tree
Hide file tree
Showing 333 changed files with 4,916 additions and 506 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<ImageData Id="1000">424dd6020000000000003600000028000000100000000e0000000100180000000000a0020000c40e0000c40e00000000000000000000ff00ffc0c0c0c0c0c0c0c0c0c0c0c0808080808080808080808080808080808080ff00ffff00ffff00ffff00ffff00ffff00ffc0c0c0c0c0c0c0c0c0c0c0c0808080c0c0c0000000c0c0c0000000808080ff00ffff00ffff00ffff00ffff00ffff00ffc0c0c000bfff00bfffc0c0c0808080c0c0c000ffffc0c0c000ffff808080ff00ffff00ffff00ffff00ffff00ffff00ffc0c0c000bfff00bfffc0c0c0808080c0c0c0c0c0c0c0c0c0c0c0c0808080ff00ffff00ffff00ffff00ffff00ffff00ffc0c0c000bfff00bfffc0c0c0808080c0c0c0000000c0c0c0000000808080ff00ffff00ffff00ffff00ffff00ffff00ffc0c0c0c0c0c0c0c0c0c0c0c0808080c0c0c0ff0000c0c0c0ff0000808080ff00ffff00ffff00ffff00ffff00ffff00ffc0c0c0c0c0c0c0c0c0c0c0c0808080c0c0c0c0c0c0c0c0c0c0c0c0808080ff00ffff00ffff00ffff00ffff00ffff00ffc0c0c0c0c0c0c0c0c0c0c0c0808080c0c0c0000000c0c0c0000000808080ff00ffff00ffff00ffff00ffff00ffff00ffc0c0c000bfff00bfffc0c0c0808080c0c0c00000ffc0c0c00000ff808080ff00ffff00ffff00ffff00ffff00ffff00ffc0c0c000bfff00bfffc0c0c0808080c0c0c0c0c0c0c0c0c0c0c0c0808080ff00ffff00ffff00ffff00ffff00ffff00ffc0c0c000bfff00bfffc0c0c0808080c0c0c0000000c0c0c0000000808080ff00ffff00ffff00ffff00ffff00ffff00ffc0c0c0c0c0c0c0c0c0c0c0c0808080c0c0c0c0c0c0c0c0c0c0c0c0808080ff00ffff00ffff00ffff00ffff00ffff00ffc0c0c0c0c0c0c0c0c0c0c0c0808080c0c0c0008000c0c0c0008000808080ff00ffff00ffff00ffff00ffff00ffff00ffc0c0c0c0c0c0c0c0c0c0c0c0808080c0c0c0c0c0c0c0c0c0c0c0c0808080ff00ffff00ffff00ffff00ffff00ff</ImageData>
<ImageData Id="1001">424dd6020000000000003600000028000000100000000e0000000100180000000000a0020000120b0000120b00000000000000000000ff00ffff00ffff00ffff00ffff00ffff00ff808080808080808080808080808080ff00ffff00ffff00ffff00ffff00ffff00ffff00ffff00ffff00ffff00ffff00ffc0c0c0000000c0c0c0000000808080ff00ffff00ffff00ffff00ffff00ffff00ffff00ffff00ffff00ffff00ffff00ffc0c0c000ffffc0c0c000ffff808080ff00ffff00ffff00ffff00ffff00ffff00ffff00ffff00ffff00ffff00ffff00ffc0c0c0c0c0c0c0c0c0c0c0c0808080ff00ffff00ffff00ffff00ffff00ffff00ffff00ffff00ffff00ffff00ffff00ffc0c0c0000000c0c0c0000000808080ff00ffff00ffff00ffff00ffff00ffff00ffff00ffff00ffff00ffff00ffff00ffc0c0c0ff0000c0c0c0ff0000808080ff00ffff00ffff00ffff00ffff00ffff00ffff00ffff00ffff00ffff00ffff00ffc0c0c0c0c0c0c0c0c0c0c0c0808080ff00ffff00ffff00ffff00ffff00ff0000ff0000ff0000ff0000ff0000ff0000ffc0c0c0000000c0c0c0000000808080ff00ffff00ffff00ffff00ffff00ff0000ff0000ff0000ff0000ff0000ff0000ffc0c0c00000ffc0c0c00000ff808080ff00ffff00ffff00ffff00ffff00ff0000ff0000ff0000ff0000ff0000ff0000ffc0c0c0c0c0c0c0c0c0c0c0c0808080ff00ffff00ffff00ffff00ffff00ff0000ff0000ff0000ff0000ff0000ff0000ffc0c0c0000000c0c0c0000000808080ff00ffff00ffff00ffff00ffff00ff0000ff0000ff0000ff0000ff0000ff0000ffc0c0c0c0c0c0c0c0c0c0c0c0808080ff00ffff00ffff00ffff00ffff00ff0000ff0000ff0000ff0000ff0000ff0000ffc0c0c0008000c0c0c0008000808080ff00ffff00ffff00ffff00ffff00ff0000ff0000ff0000ff0000ff0000ff0000ffc0c0c0c0c0c0c0c0c0c0c0c0808080ff00ffff00ffff00ffff00ffff00ff</ImageData>
</ImageDatas>
<Project ProjectGUID="{81535540-06FC-4400-AD30-5DF785BB9A0E}" TargetNetId="192.168.4.1.1.1" Target64Bit="true" ShowHideConfigurations="#x106">
<Project ProjectGUID="{81535540-06FC-4400-AD30-5DF785BB9A0E}" Target64Bit="true" ShowHideConfigurations="#x106">
<System>
<Settings MaxCpus="24" NonWinCpus="1"/>
<Tasks>
Expand All @@ -34,7 +34,7 @@
</System>
<Plc>
<Project GUID="{1F826822-78EF-46D2-B0C2-A803A090596D}" Name="x_template_xPlc" PrjFilePath="x_template_xPlc\x_template_xPlc.plcproj" TmcFilePath="x_template_xPlc\x_template_xPlc.tmc" ReloadTmc="true" AmsPort="851" FileArchiveSettings="#x000e" SymbolicMapping="true">
<Instance Id="#x08502000" TcSmClass="TComPlcObjDef" KeepUnrestoredLinks="2" TmcPath="x_template_xPlc\x_template_xPlc.tmc" TmcHash="{F49318A3-3D16-797F-DBAC-D8F8F3C26E65}">
<Instance Id="#x08502000" TcSmClass="TComPlcObjDef" KeepUnrestoredLinks="2" TmcPath="x_template_xPlc\x_template_xPlc.tmc" TmcHash="{1421DC72-BFA4-2759-AFA5-9D33B836A4BF}">
<Name>x_template_xPlc Instance</Name>
<CLSID ClassFactory="TcPlc30">{08500001-0000-0000-F000-000000000064}</CLSID>
<Vars VarGrpType="1">
Expand Down Expand Up @@ -300,7 +300,7 @@
</Project>
</Plc>
<Io>
<Device Id="6" Disabled="true" DevType="111" DevFlags="#x0003" AmsPort="28678" AmsNetId="192.168.4.1.7.1" RemoteName="EC1" InfoImageId="1">
<Device Id="6" Disabled="true" DevType="111" DevFlags="#x0003" AmsPort="28678" AmsNetId="172.20.21.220.7.1" RemoteName="EC1" InfoImageId="1">
<Name>EC1</Name>
<AddressInfo>
<Pnp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,22 @@
<Declaration><![CDATA[TYPE CuHeader EXTENDS TcoCore.TcoStruct :
STRUCT
{attribute addProperty Name "<#Next on Passed#>"}
{attribute 'qlik_load:NextOnPassed'}
NextOnPassed : eStations;
{attribute addProperty Name "<#Next on Failed#>"}
{attribute 'qlik_load:NextOnFailed'}
NextOnFailed : eStations;
{attribute clr [RenderIgnore("Control", "ShadowControl")]}
{attribute addProperty Name "<#Cycle time#>"}
{attribute 'qlik_load:CycleTime'}
CycleTime : TIME;
{attribute clr [RenderIgnore("Control", "ShadowControl")]}
{attribute addProperty Name "<#Clean loop time#>"}
{attribute 'qlik_load:CleanLoopTime'}
CleanLoopTime : TIME;
{attribute clr [RenderIgnore("Control", "ShadowControl")]}
{attribute addProperty Name "<#Operation started#>"}
{attribute 'qlik_load:OperationsStarted'}
OperationsStarted : DT;
{attribute clr [RenderIgnore("Control", "ShadowControl")]}
{attribute addProperty Name "<#Operation ended#>"}
{attribute 'qlik_load:OperationsEnded'}
OperationsEnded : DT;
{attribute clr [RenderIgnore("Control", "ShadowControl")]}
{attribute addProperty Name "<#Operator#>"}
{attribute 'qlik_load:Operator'}
Operator :STRING;
END_STRUCT
END_TYPE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,60 +9,44 @@ TYPE
STRUCT
{attribute addProperty Name "<#Recipe#>"}
{attribute clr [RenderIgnore("Control", "ShadowControl")]}
{attribute 'qlik_load:Recipe'}
Recipe : STRING(255);
{attribute addProperty Name "<#Recipe created#>"}
{attribute clr [RenderIgnore("Control", "ShadowControl")]}
{attribute 'qlik_load:ReciepeCreated'}
RecipeCreated : DT;
{attribute addProperty Name "<#Recipe modified#>"}
{attribute clr [RenderIgnore("Control", "ShadowControl")]}
{attribute 'qlik_load:ReciepeLastModified'}
RecipeLastModified : DT;
{attribute addProperty Name "<#Carrier#>"}
{attribute clr [RenderIgnore("Control", "ShadowControl")]}
{attribute 'qlik_load:Carrier'}
Carrier : STRING;
{attribute addProperty Name "<#Reset#>"}
{attribute clr [RenderIgnore("Control", "ShadowControl")]}
{attribute 'qlik_load:WasReset'}
{attribute 'qlikmap:Bool:0,No;1,Yes'}
WasReset : BOOL;
{attribute addProperty Name "<#Master#>"}
{attribute clr [RenderIgnore("Control", "ShadowControl")]}
{attribute 'qlik_load:IsMaster'}
{attribute 'qlikmap:Bool:0,No;1,Yes'}
IsMaster : BOOL;
{attribute addProperty Name "<#Empty#>"}
{attribute clr [RenderIgnore("Control", "ShadowControl")]}
{attribute 'qlik_load:IsEmpty'}
{attribute 'qlikmap:Bool:0,No;1,Yes'}
IsEmpty : BOOL;
{attribute addProperty Name "<#Last station#>"}
{attribute 'qlik_load:LastStation'}
LastStation : eStations;
{attribute addProperty Name "<#Next station#>"}
{attribute 'qlik_load:NextStation'}
NextStation : eStations;
{attribute addProperty Name "<#Operations opened#>"}
{attribute 'qlik_load:OpenOn'}
OpenOn : eStations;
{attribute addProperty Name "<#Results#>"}
Results : TcoInspectors.TcoComprehensiveResult;
{attribute addProperty Name "<#Reworked#>"}
{attribute clr [RenderIgnore("Control", "ShadowControl")]}
{attribute 'qlik_load:WasReworked'}
WasReworked : BOOL;
WasReworked : BOOL;
{attribute addProperty Name "<#Last Rework Name#>"}
{attribute clr [RenderIgnore("Control", "ShadowControl")]}
{attribute 'qlik_load:LastReworkName'}
LastReworkName : STRING;
LastReworkName : STRING;
{attribute addProperty Name "<#Rework Count#>"}
{attribute clr [RenderIgnore("Control", "ShadowControl")]}
{attribute 'qlik_load:ReworkCount'}
ReworkCount : SINT;
END_STRUCT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@ VAR
_cycleTimeAnalitics:CycleTimeAnalitics;
_startCleanCycleTime: TIME;
_stopCleanCycleTime: TIME;
_timer_1: TON;
_timer_2: TON;
_AllertMsg:string;
END_VAR]]></Declaration>
<Implementation>
<ST><![CDATA[]]></ST>
<ST><![CDATA[Run();]]></ST>
</Implementation>
<Folder Name="CycleTimeAnalitics" Id="{86c02bf1-155c-0d73-2b05-d09e4bb07f43}" />
<Folder Name="TaskRelay" Id="{afc41ea2-70b7-46a4-8ba7-73e4b0574c74}" />
<Folder Name="Timers" Id="{2af6797e-8e04-46b1-9884-5deb625c01f4}" />
<Property Name="AverageCleanCycleTime" Id="{2856e096-2c70-0832-3dad-a64ad95dfd66}" FolderPath="CycleTimeAnalitics\">
<Declaration><![CDATA[PROPERTY PUBLIC AverageCleanCycleTime : TIME]]></Declaration>
<Get Name="Get" Id="{77b100c9-2a8f-0c53-036a-faa56cf15504}">
Expand All @@ -39,6 +43,32 @@ END_VAR
</Implementation>
</Get>
</Property>
<Method Name="Await" Id="{12e57bae-9ee5-410f-b614-026e886ed168}">
<Declaration><![CDATA[(*~
<docu>
<summary>
Completes the actually running step, when the `inCondition` parameter is `TRUE`.
Method is typically called inside a step as the transition method.
</summary>
</docu>
~*)
METHOD PROTECTED FINAL Await
VAR_INPUT
(*~
<docu>
<summary>
The condition under which the step is completed.
</summary>
</docu>
~*)
inCondition : BOOL;
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[i_StepCompleteWhen(inCondition := inCondition);
]]></ST>
</Implementation>
</Method>
<Method Name="CompleteSequence" Id="{e660dda5-e822-0795-15da-43df1875907c}">
<Declaration><![CDATA[(*~
<docu>
Expand Down Expand Up @@ -112,7 +142,7 @@ END_VAR
</summary>
</docu>
~*)
METHOD PROTECTED ABSTRACT Main : BOOL
METHOD PROTECTED Main : BOOL
]]></Declaration>
<Implementation>
<ST><![CDATA[]]></ST>
Expand Down Expand Up @@ -266,6 +296,16 @@ _cycleTimeAnalitics.AverageCleanCycle:=T#0S;
]]></ST>
</Implementation>
</Method>
<Method Name="ResetTimers" Id="{c0e378a0-09f3-4f5d-8221-03bde2a0ef7b}" FolderPath="Timers\">
<Declaration><![CDATA[METHOD PRIVATE ResetTimers
VAR_INPUT
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[_timer_1.IN:=FALSE;
_timer_2.IN:=FALSE;]]></ST>
</Implementation>
</Method>
<Method Name="Restore" Id="{a3c44169-c865-41a7-b04d-fb6593fd4c0f}">
<Declaration><![CDATA[(*~
<docu>
Expand Down Expand Up @@ -366,7 +406,9 @@ END_VAR
<Implementation>
<ST><![CDATA[Step := i_Step(inStepID := inStepID, inEnabled := inEnabled, inStepDescription := inStepDescription);
IF IsFreshState THEN
_AllertMsg:='';
END_IF
]]></ST>
</Implementation>
</Method>
Expand Down Expand Up @@ -445,5 +487,29 @@ END_VAR
</Implementation>
</Get>
</Property>
<Method Name="Timer_1" Id="{1124a7d8-f03e-48d1-8410-80f26add3bdf}" FolderPath="Timers\">
<Declaration><![CDATA[METHOD PUBLIC FINAL Timer_1 : BOOL
VAR_INPUT
Condition : BOOL;
PT : TIME;
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[_timer_1(IN:= Condition and not IsFreshState, PT:=PT);
Timer_1 := _timer_1.Q;]]></ST>
</Implementation>
</Method>
<Method Name="Timer_2" Id="{ba7678b2-3bdc-4bb3-9f5e-196bf9a8fe98}" FolderPath="Timers\">
<Declaration><![CDATA[METHOD PUBLIC FINAL Timer_2 : BOOL
VAR_INPUT
Condition : BOOL;
PT : TIME;
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[_timer_2(IN:= Condition and not IsFreshState, PT:=PT);
Timer_2 := _timer_2.Q;]]></ST>
</Implementation>
</Method>
</POU>
</TcPlcObject>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
<TcPlcObject Version="1.1.0.1">
<POU Name="CU00xAutomatParalell_1_Task" Id="{9100e615-15b9-0e46-102a-be6dd0540361}" SpecialFunc="None">
<Declaration><![CDATA[FUNCTION_BLOCK CU00xAutomatParalell_1_Task EXTENDS TcoTaskedSequencer
]]></Declaration>
VAR
_customTimer: TON;
END_VAR]]></Declaration>
<Implementation>
<ST><![CDATA[Run();]]></ST>
</Implementation>
Expand All @@ -21,11 +24,32 @@ METHOD PROTECTED Main : BOOL
<ST><![CDATA[// Takes mode (step/continous) from the parent controller
THIS^.ModeController.Mode := ParentSequence.ModeController.Mode;
IF (Step(1000, TRUE, 'PARALELL STEP')) THEN
IF (Step(1000, TRUE, 'PARALELL STEP - EXAMPLE OF TIMERS')) THEN
//-------------------------------------
StepCompleteWhen(CurrentStep.Duration >= T#300mS);
//-------------------------------------
END_IF
IF (Step(1100, TRUE, 'PARALELL STEP - EXAMPLE OF TIMERS')) THEN
//-------------------------------------
StepCompleteWhen(inCondition:=Timer_1(TRUE,T#100MS));
//-------------------------------------
END_IF
IF (Step(1200, TRUE, 'PARALELL STEP - EXAMPLE OF TIMERS')) THEN
//-------------------------------------
StepCompleteWhen(inCondition:=Timer_1(TRUE,T#200MS));
//-------------------------------------
END_IF
IF THIS^.IsFreshState THEN
_customTimer(IN:=FALSE);
END_IF
IF (Step(1300, TRUE, 'PARALELL STEP - EXAMPLE OF TIMERS')) THEN
//-------------------------------------
_customTimer(IN:=TRUE,PT:=T#200MS);
StepCompleteWhen(inCondition:=_customTimer.Q);
//-------------------------------------
END_IF
IF (Step(10000, TRUE, 'PARALELL TASK DONE')) THEN
Expand Down
Loading

0 comments on commit b58064c

Please sign in to comment.