Skip to content

Commit

Permalink
[ENHANCEMENT] Improve functionalities in Template (#159)
Browse files Browse the repository at this point in the history
* Create draft PR for #158

* +Rfid chip authentification port name  into config
+build in statistic counter
+entity searchers helpers (onliner,plainer)
*rework recipes in recipe instructor
+standart basic counter data
+scrolling by  content in ui
+RequestRestoreOrigin(),Next()
+public properties in Technology and ControledUnit
+supsend step execution property
+MTS feedeng (PLS,PLR,PLB paletizators,Oscilating feeder)
+Transfer System lib
+online data visual update

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: peterbarancek <[email protected]>
  • Loading branch information
github-actions[bot] and peterbarancek authored Jan 22, 2025
1 parent f5e59a9 commit 14f472d
Show file tree
Hide file tree
Showing 96 changed files with 13,565 additions and 1,782 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@
<ImageData Id="1016">424de6000000000000007600000028000000100000000e000000010004000000000070000000c30e0000c30e000010000000100000000000ff00ff00ff00ff000000ffff000000ff000000ffff0000008000800080008000000080800000008000000080800080808000c0c0c000ffffff0000000000111111111111111100ffffffffffffff00fffffffffff00ffffffffffffff00ffff00fff00fffffffff00fff00fffffffffffffffffff44f00fffffffffff44f00ffffffffffffffdddddd1111111111dddddd1111111111dddddd1111111111dddddd1111111111dddddd1111111111</ImageData>
<ImageData Id="1017">424de6000000000000007600000028000000100000000e000000010004000000000070000000c30e0000c30e000010000000100000000000ff00ff00ff00ff000000ffff000000ff000000ffff0000008000800080008000000080800000008000000080800080808000c0c0c000ffffff00000000001111111111111111fffffffffffffffffcfcfcfcfffff00ff4f4f4f4fffff00ffffffffffffffffffffffffffffffffffcfcfcfcfffff00ff4f4f4f4fffff00fffffffffffffffff55555511111111115555551111111111555555111111111155555511111111115555551111111111</ImageData>
</ImageDatas>
<Project ProjectGUID="{81535540-06FC-4400-AD30-5DF785BB9A0E}" Target64Bit="true" ShowHideConfigurations="#x106">
<Project ProjectGUID="{81535540-06FC-4400-AD30-5DF785BB9A0E}" TargetNetId="192.168.4.1.1.1" Target64Bit="true" ShowHideConfigurations="#x106">
<System>
<Settings MaxCpus="24" NonWinCpus="1"/>
<Settings MaxCpus="2" NonWinCpus="1"/>
<Tasks>
<Task Id="3" Priority="20" CycleTime="100000" AmsPort="350" AdtTasks="true">
<Name>PlcTask</Name>
Expand All @@ -151,7 +151,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="{EAD70BAD-0C4C-0592-AEDD-56DCCC2D4E2C}">
<Instance Id="#x08502000" TcSmClass="TComPlcObjDef" KeepUnrestoredLinks="2" TmcPath="x_template_xPlc\x_template_xPlc.tmc" TmcHash="{FDEFB46C-96EC-4CE5-B2E8-1397F61116A0}">
<Name>x_template_xPlc Instance</Name>
<CLSID ClassFactory="TcPlc30">{08500001-0000-0000-F000-000000000064}</CLSID>
<Vars VarGrpType="1">
Expand Down Expand Up @@ -849,7 +849,7 @@
</Project>
</Plc>
<Io>
<Device Id="6" Disabled="true" DevType="111" DevFlags="#x0003" AmsPort="28678" AmsNetId="172.20.21.220.7.1" RemoteName="EC1" InfoImageId="1">
<Device Id="6" Disabled="true" DevType="111" DevFlags="#x0003" AmsPort="28678" AmsNetId="192.168.4.1.7.1" RemoteName="EC1" InfoImageId="1">
<Name>EC1</Name>
<AddressInfo>
<Ccat>
Expand Down Expand Up @@ -891,7 +891,7 @@
<Box Id="3" BoxType="9106" BoxFlags="#x00000020">
<Name>PN (EL6631)</Name>
<ImageId>124</ImageId>
<EtherCAT SlaveType="5" AdsServerAddress="ac1415dc07040000" PdiType="#x0c08" ExecIo="true" MboxDataLinkLayer="true" StateMBoxPolling="true" CycleMBoxPollingTime="0" CoeType="47" FoeType="1" VendorId="#x00000002" ProductCode="#x19e73052" RevisionNo="#x00120000" InfoDataAddr="true" InfoDataNetId="true" TimeoutStateChange1="10000" TimeoutStateChange3="20000" GenerateOwnNetId="true" InitializeOwnNetId="true" PortPhys="51" MaxSlotCount="256" MaxSlotGroupCount="1" SlotPdoIncrement="1" SlotIndexIncrement="16" Type="EL6631 PROFINET IO Controller" Desc="EL6631" PortABoxInfo="#x02000002">
<EtherCAT SlaveType="5" AdsServerAddress="c0a8040107040000" PdiType="#x0c08" ExecIo="true" MboxDataLinkLayer="true" StateMBoxPolling="true" CycleMBoxPollingTime="0" CoeType="47" FoeType="1" VendorId="#x00000002" ProductCode="#x19e73052" RevisionNo="#x00120000" InfoDataAddr="true" InfoDataNetId="true" TimeoutStateChange1="10000" TimeoutStateChange3="20000" GenerateOwnNetId="true" InitializeOwnNetId="true" PortPhys="51" MaxSlotCount="256" MaxSlotGroupCount="1" SlotPdoIncrement="1" SlotIndexIncrement="16" Type="EL6631 PROFINET IO Controller" Desc="EL6631" PortABoxInfo="#x02000002">
<SyncMan>001000042600010001000000400000040004001026010000</SyncMan>
<SyncMan>001400042200010002000000400000040004001422010000</SyncMan>
<SyncMan>001800006400000003000000000000000000001864010000</SyncMan>
Expand Down Expand Up @@ -2705,7 +2705,7 @@
</Box>
<EtherCAT/>
</Device>
<Device Id="1" Disabled="true" DevType="111" DevFlags="#x0003" AmsPort="28673" AmsNetId="172.20.21.220.2.1" RemoteName="EC" InfoImageId="3">
<Device Id="1" Disabled="true" DevType="111" DevFlags="#x0003" AmsPort="28673" AmsNetId="192.168.4.1.2.1" RemoteName="EC" InfoImageId="3">
<Name>EC</Name>
<AddressInfo>
<Ccat>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,22 @@ VAR
_toggle: TcoUtilities.TcoBlinker(THIS^);
_recurringFails:CuBaseRecurringFailures:=(Parent:=THIS^);
_productionPlaner:ProductionPlaner(THIS^);
_internalData : REFERENCE TO InternalStorage;
{attribute clr [ReadOnly()]}
{attribute clr [RenderIgnore()]}
_readyForOperations : BOOL;
END_VAR]]></Declaration>
<Implementation>
<ST><![CDATA[]]></ST>
</Implementation>
<Folder Name="Misc" Id="{89a011fb-946c-4af2-b16f-4abd86442495}" />
<Folder Name="Modes" Id="{d650a7bf-6367-4a6c-a191-a985e54df897}" />
<Folder Name="ProcessData" Id="{1a8aa84b-31e4-41aa-b103-fbb20e0c7128}">
<Folder Name="CrudTaskState" Id="{3cbcef83-2f8f-092f-1642-2d5bb3f25f3f}" />
<Folder Name="DataFlaging" Id="{aed3d7b3-4fd1-0c13-2eed-417fc6b5b252}" />
<Folder Name="ExternalData" Id="{8389998d-539c-07b7-2bed-035331c1a0d8}" />
<Folder Name="InternalData" Id="{5ea75a1d-a09d-4e05-8586-dc704b6c3cc3}" />
</Folder>
<Folder Name="RecurringFailures" Id="{aea7587e-0f13-0992-2127-c34de6e860fe}" />
<Folder Name="Tasks" Id="{522e67de-7340-4416-b0c7-f54a63e10aed}" />
Expand All @@ -51,7 +57,8 @@ END_VAR
*)
AutomatTask.Task.Enabled := (GroundTask.GroundDone OR AutomatTask.Task.Busy) AND THIS^.Technology.AllowAutomat();
AutomatTask.Task.Enabled := AutomatTask.Task.Busy XOR
(GroundTask.GroundDone AND NOT AutomatTask.Task.Busy AND THIS^.Technology.AllowAutomat(inCuId:=CuId));
(*
Invokes `groundTask` from technology object.
Expand Down Expand Up @@ -119,6 +126,14 @@ END_VAR
</Implementation>
</Get>
</Property>
<Method Name="DoesBelong" Id="{55fc80ad-32c7-442e-a227-eb2402c499aa}" FolderPath="Misc\">
<Declaration><![CDATA[METHOD DoesBelong : BOOL
]]></Declaration>
<Implementation>
<ST><![CDATA[DoesBelong := THIS^.ProcessDataManager.Data.EntityHeader.NextStation = THIS^.CuId;]]></ST>
</Implementation>
</Method>
<Method Name="EntityFlowCloseForOperations" Id="{8bf49847-55ad-09e2-18b7-e269b9aac41c}" FolderPath="ProcessData\ExternalData\">
<Declaration><![CDATA[METHOD EntityFlowCloseForOperations : TcoCore.ITcoTaskStatus
VAR_IN_OUT
Expand Down Expand Up @@ -323,7 +338,7 @@ END_VAR
]
*)
GroundTask.Task.Enabled := THIS^.Technology.AllowGround();
GroundTask.Task.Enabled := THIS^.Technology.AllowGround(inCuId:=CuId) OR GroundTask.Task.Busy ;
(*
Invokes `groundTask` from technology object.
Expand Down Expand Up @@ -376,6 +391,116 @@ METHOD Idle : BOOL
<ST><![CDATA[]]></ST>
</Implementation>
</Method>
<Method Name="InternalCloseEntity" Id="{dfea0e83-d826-46d9-999d-a40573b91b00}" FolderPath="ProcessData\InternalData\">
<Declaration><![CDATA[METHOD InternalCloseEntity : BOOL
VAR_INPUT
inCarrier : UINT;
refStorage : REFERENCE TO InternalStorage;
END_VAR
VAR_IN_OUT
inoHeader : CuHeader;
END_VAR
VAR_INST
_internalData : REFERENCE TO InternalStorage;
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[THIS^.FlagCloseEntity(inoHeader);
_internalData REF= refStorage;
InternalCloseEntity := _internalData.SaveByCarrier(inCarrier, THIS^.ProcessDataManager.Data);]]></ST>
</Implementation>
</Method>
<Method Name="InternalCreateNewEntity" Id="{2a260e96-2965-4d92-91e5-527d8ec911bc}" FolderPath="ProcessData\InternalData\">
<Declaration><![CDATA[METHOD InternalCreateNewEntity : BOOL
VAR_INPUT
inCarrier : UINT;
refStorage : REFERENCE TO InternalStorage;
END_VAR
VAR_IN_OUT
inoHeader : CuHeader;
END_VAR
VAR_INST
_internalData : REFERENCE TO InternalStorage;
END_VAR]]></Declaration>
<Implementation>
<ST><![CDATA[THIS^.FlagCreateNewEntity(UINT_TO_STRING(inCarrier), inoHeader);
THIS^.ProcessDataManager.Data.EntityHeader.Carrier := UINT_TO_STRING(inCarrier);
_internalData REF= refStorage;
InternalCreateNewEntity := _internalData.SaveByCarrier(inCarrier, THIS^.ProcessDataManager.Data);]]></ST>
</Implementation>
</Method>
<Method Name="InternalFinishEntity" Id="{f4f6b5d3-650a-43ef-93bf-662dc33f326f}" FolderPath="ProcessData\InternalData\">
<Declaration><![CDATA[METHOD InternalFinishEntity : BOOL
VAR_INPUT
inCarrier : UINT;
refStorage : REFERENCE TO InternalStorage;
END_VAR
VAR_IN_OUT
inoHeader : CuHeader;
END_VAR
VAR_INST
_internalData : REFERENCE TO InternalStorage;
END_VAR]]></Declaration>
<Implementation>
<ST><![CDATA[THIS^.FlagFinishEntity(inoHeader);
_internalData REF= refStorage;
InternalFinishEntity := _internalData.SaveByCarrier(inCarrier, THIS^.ProcessDataManager.Data);
]]></ST>
</Implementation>
</Method>
<Method Name="InternalOpenEntity" Id="{c2a47fa2-fa48-4474-91bc-486ebcf5d6f6}" FolderPath="ProcessData\InternalData\">
<Declaration><![CDATA[METHOD InternalOpenEntity : BOOL
VAR_INPUT
inCarrier : UINT;
refStorage : REFERENCE TO InternalStorage;
END_VAR
VAR_IN_OUT
inoHeader : CuHeader;
END_VAR
VAR_INST
_internalData : REFERENCE TO InternalStorage;
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[_internalData REF= refStorage;
InternalOpenEntity := _internalData.GetByCarrier(inCarrier, THIS^.ProcessDataManager.Data);
THIS^.FlagOpenEntity(UINT_TO_STRING(inCarrier), inoHeader);]]></ST>
</Implementation>
</Method>
<Method Name="InternalRetrieveEntity" Id="{4e223708-c43d-4037-a2dd-eac052151e43}" FolderPath="ProcessData\InternalData\">
<Declaration><![CDATA[METHOD InternalRetrieveEntity : BOOL
VAR_INPUT
inCarrier : UINT;
refStorage : REFERENCE TO InternalStorage;
END_VAR
VAR_INST
_internalData : REFERENCE TO InternalStorage;
END_VAR]]></Declaration>
<Implementation>
<ST><![CDATA[_internalData REF= refStorage;
InternalRetrieveEntity := _internalData.GetByCarrier(inCarrier, THIS^.ProcessDataManager.Data);]]></ST>
</Implementation>
</Method>
<Method Name="InternalThrowAwayEntity" Id="{e3889063-3943-4256-b512-d2920a6f746b}" FolderPath="ProcessData\InternalData\">
<Declaration><![CDATA[METHOD InternalThrowAwayEntity : BOOL
VAR_INPUT
inCarrier : UINT;
refStorage : REFERENCE TO InternalStorage;
END_VAR
VAR_IN_OUT
inoHeader : CuHeader;
END_VAR
VAR_INST
_internalData : REFERENCE TO InternalStorage;
END_VAR]]></Declaration>
<Implementation>
<ST><![CDATA[THIS^.FlagThrowAwayEntity(inoHeader);
_internalData REF= refStorage;
InternalThrowAwayEntity := _internalData.SaveByCarrier(inCarrier, THIS^.ProcessDataManager.Data);
]]></ST>
</Implementation>
</Method>
<Method Name="Manual" Id="{ca59dfc2-4891-4382-ac63-95609aefa41f}" FolderPath="Modes\">
<Declaration><![CDATA[(*~
<docu>
Expand All @@ -398,7 +523,7 @@ END_VAR
]
*)
ManualTask.Task.Enabled := THIS^.Technology.AllowManual();
ManualTask.Task.Enabled := THIS^.Technology.AllowManual(inCuId:=CuId) OR ManualTask.Task.Busy;
]]></ST>
Expand Down Expand Up @@ -437,6 +562,15 @@ END_VAR
</Implementation>
</Get>
</Property>
<Method Name="ReadyForOperations" Id="{77a708be-476c-4f16-9146-a2c225c4a4d4}" FolderPath="Misc\">
<Declaration><![CDATA[METHOD ReadyForOperations : BOOL
VAR_INPUT
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[ReadyForOperations := _readyForOperations;]]></ST>
</Implementation>
</Method>
<Property Name="RecoverTask" Id="{3e03c8f5-0e6a-4257-b8ec-f05883753522}" FolderPath="Tasks\">
<Declaration><![CDATA[PROPERTY ABSTRACT RecoverTask : REFERENCE TO CUBaseRecover ]]></Declaration>
<Get Name="Get" Id="{b652b901-2fff-46c7-8e8d-0292570c5ddc}">
Expand All @@ -459,6 +593,36 @@ END_VAR
</Implementation>
</Get>
</Property>
<Method Name="ResetReadyForOperations" Id="{8bdd63cb-1ddc-4a3a-8a46-b497c45dd233}" FolderPath="Misc\">
<Declaration><![CDATA[METHOD ResetReadyForOperations : BOOL
]]></Declaration>
<Implementation>
<ST><![CDATA[_readyForOperations := false;]]></ST>
</Implementation>
</Method>
<Method Name="RunOperations" Id="{a957592c-a5b8-4fd8-8056-4beaed2d9ff5}" FolderPath="Misc\">
<Declaration><![CDATA[METHOD RunOperations : BOOL
VAR_INPUT
refGlobalTrigger:REFERENCE TO BOOL;
END_VAR
VAR
_trrigger:REFERENCE TO BOOL;
END_VAR]]></Declaration>
<Implementation>
<ST><![CDATA[_trrigger REF=refGlobalTrigger;
RunOperations := _trrigger;]]></ST>
</Implementation>
</Method>
<Method Name="SetReadyForOperations" Id="{58953506-ec17-4f2c-a7ed-ed0c9eabd4ea}" FolderPath="Misc\">
<Declaration><![CDATA[METHOD SetReadyForOperations : BOOL
VAR_INPUT
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[_readyForOperations := TRUE;]]></ST>
</Implementation>
</Method>
<Property Name="StatusInfo" Id="{8869b0c0-1b6b-4ea5-bfe7-ba8752959d51}">
<Declaration><![CDATA[PROPERTY ABSTRACT StatusInfo : REFERENCE TO CUBaseStatusInfo]]></Declaration>
<Get Name="Get" Id="{6df77d60-346a-4f90-8a89-5b3120d43b1f}">
Expand Down Expand Up @@ -495,6 +659,18 @@ END_IF]]></ST>
</Implementation>
</Get>
</Property>
<Property Name="ToggleBlinker" Id="{0ed49b78-0603-4128-ab5c-75f37242700d}">
<Declaration><![CDATA[PROPERTY PUBLIC ToggleBlinker : REFERENCE TO TcoUtilities.TcoBlinker
]]></Declaration>
<Get Name="Get" Id="{283c9d38-3bff-4a7f-abd0-6cf25f97bb1d}">
<Declaration><![CDATA[VAR
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[ToggleBlinker ref= _toggle;]]></ST>
</Implementation>
</Get>
</Property>
<Property Name="UpdateEntityTask" Id="{05c804c9-7f4b-0e37-2ebf-2fe6f3b9eb66}" FolderPath="ProcessData\CrudTaskState\">
<Declaration><![CDATA[PROPERTY UpdateEntityTask : TcoCore.ITcoTaskStatus]]></Declaration>
<Get Name="Get" Id="{efded1af-2b8a-0cbf-039b-3695e9082143}">
Expand All @@ -514,12 +690,17 @@ END_VAR
<Implementation>
<ST><![CDATA[_toggle(inOffTime:=T#500MS,inOnTime:=T#500MS);
IF AutomatTask.ClearCounterDataTask.Execute() THEN
AutomatTask.ClearCounter();
AutomatTask.ClearCounterDataTask.DoneWhen(TRUE);
END_IF
_statusInfo.State := eCUState.None;
IF _statusInfo.CurrentCycleTime >= _settings.WarningCycleTime
AND _statusInfo.CurrentCycleTime < _settings.ErrorCycleTime THEN
IF _statusInfo.CurrentCleanCycleTime >= _settings.WarningCycleTime
AND _statusInfo.CurrentCleanCycleTime < _settings.ErrorCycleTime THEN
_statusInfo.State:= eCUState.HasWarning;
ELSIF _statusInfo.CurrentCycleTime >= _settings.ErrorCycleTime THEN
ELSIF _statusInfo.CurrentCleanCycleTime >= _settings.ErrorCycleTime THEN
_statusInfo.State := eCUState.HasError;
END_IF;
Expand All @@ -531,6 +712,7 @@ END_IF
IF AutomatTask.Task.Busy THEN
_statusInfo.Mode := eCUMode.AutomatMode;
_statusInfo.CurrentTaskDescription := '<#AUTOMAT#>';
_statusInfo.CurrentCycleTime := AutomatTask._SequenceElapsedTime;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1">
<DUT Name="BasicCounterData" Id="{5462301d-0575-454a-97bb-bcbadc017c65}">
<Declaration><![CDATA[{attribute wpf [Container(Layout.Stack)]}
{attribute wpf [Group(Layout.Scroll)]}
{attribute addProperty Name "<#Entity header#>"}
TYPE BasicCounterData EXTENDS TcoCore.TcoStruct :
STRUCT
{attribute addProperty Name "<#OK#>"}
Passed : UDINT;
{attribute addProperty Name "<#NOK#>"}
Failed : UDINT;
{attribute addProperty Name "<#TOTAL#>"}
Total : UDINT;
{attribute addProperty Name "<#ALL TIME OK#>"}
LifeTimePassed : UDINT;
{attribute addProperty Name "<#ALL TIME NOK#>"}
LifeTimeFailed : UDINT;
{attribute addProperty Name "<#ALL TIME #>"}
LifeTime : UDINT;
END_STRUCT
END_TYPE
]]></Declaration>
</DUT>
</TcPlcObject>
Loading

0 comments on commit 14f472d

Please sign in to comment.