Merge remote-tracking branch 'origin/master' into MBP-271-read-write-coe-parameters

This commit is contained in:
Federico Rojas
2024-11-25 15:45:04 +01:00
13 changed files with 166 additions and 56 deletions

View File

@@ -6,8 +6,8 @@ pipelines:
- step:
script:
- git submodule update --init
- python twincat_version_manager.py
- python check_fix_white_space.py
- ./check_no_lineids.sh
- ./check_code_before_sq_brackets.sh
#- python twincat_version_manager.py

View File

@@ -1,11 +1,7 @@
<?xml version="1.0"?>
<TcSmItem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.beckhoff.com/schemas/2012/07/TcSmProject" TcSmVersion="1.0" TcVersion="3.1.4024.56" ClassName="CNestedPlcProjDef">
<Project GUID="{FB261665-FD20-4BF2-97F8-2854C82B752D}" Name="tc_project_app" PrjFilePath="..\..\tc_project_app\tc_project_app.plcproj" TmcFilePath="..\..\tc_project_app\tc_project_app.tmc" ReloadTmc="true" AmsPort="852" FileArchiveSettings="#x000e" ClearInvalidPersist="true" SymbolicMapping="true">
<<<<<<< Updated upstream
<Instance Id="#x08502040" TcSmClass="TComPlcObjDef" KeepUnrestoredLinks="2" TmcPath="tc_project_app\tc_project_app.tmc" TmcHash="{8C816767-0D10-3155-C14B-F2E67A130AAA}">
=======
<Instance Id="#x08502040" TcSmClass="TComPlcObjDef" KeepUnrestoredLinks="2" TmcPath="tc_project_app\tc_project_app.tmc" TmcHash="{E6DABF99-C060-49F5-D308-99F6C0C71140}">
>>>>>>> Stashed changes
<Instance Id="#x08502040" TcSmClass="TComPlcObjDef" KeepUnrestoredLinks="2" TmcPath="tc_project_app\tc_project_app.tmc" TmcHash="{F6BC0CA5-B216-63D8-5C67-56DF490A268B}">
<Name>tc_project_app Instance</Name>
<CLSID ClassFactory="TcPlc30">{08500001-0000-0000-F000-000000000064}</CLSID>
<Contexts>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.11">
<TcPlcObject Version="1.1.0.1">
<DUT Name="E_CPUType" Id="{78ea3fa6-b103-4c1f-b5a7-d343f24fda9f}">
<Declaration><![CDATA[{attribute 'qualified_only'}
{attribute 'strict'}

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.11">
<TcPlcObject Version="1.1.0.1">
<GVL Name="GVL_APP" Id="{8fe9690c-7907-432e-bedb-6fc99b5ce255}">
<Declaration><![CDATA[{attribute 'qualified_only'}
VAR_GLOBAL

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.11">
<TcPlcObject Version="1.1.0.1">
<GlobalTextList Name="GlobalTextList" Id="{c3494959-baa5-4f73-b0cd-9c11912145dd}">
<XmlArchive>
<Data>
@@ -25,6 +25,11 @@
<v n="TextDefault">"%2.2f"</v>
<l n="LanguageTexts" t="ArrayList" />
</o>
<o>
<v n="TextID">"17"</v>
<v n="TextDefault">"%2.3f"</v>
<l n="LanguageTexts" t="ArrayList" />
</o>
<o>
<v n="TextID">"543"</v>
<v n="TextDefault">"%2.4f"</v>
@@ -65,6 +70,11 @@
<v n="TextDefault">"actVel"</v>
<l n="LanguageTexts" t="ArrayList" />
</o>
<o>
<v n="TextID">"414"</v>
<v n="TextDefault">"Allowed pressure out of range time(s)"</v>
<l n="LanguageTexts" t="ArrayList" />
</o>
<o>
<v n="TextID">"110"</v>
<v n="TextDefault">"AXESMAX"</v>
@@ -105,6 +115,11 @@
<v n="TextDefault">"bEnabled"</v>
<l n="LanguageTexts" t="ArrayList" />
</o>
<o>
<v n="TextID">"394"</v>
<v n="TextDefault">"bEnableStopWithAnyLS"</v>
<l n="LanguageTexts" t="ArrayList" />
</o>
<o>
<v n="TextID">"941"</v>
<v n="TextDefault">"bError"</v>
@@ -215,6 +230,11 @@
<v n="TextDefault">"Bwd Enable"</v>
<l n="LanguageTexts" t="ArrayList" />
</o>
<o>
<v n="TextID">"974"</v>
<v n="TextDefault">"Current pressure value (bar)"</v>
<l n="LanguageTexts" t="ArrayList" />
</o>
<o>
<v n="TextID">"986"</v>
<v n="TextDefault">"ehomeDirect"</v>
@@ -280,6 +300,11 @@
<v n="TextDefault">"Elapsed time"</v>
<l n="LanguageTexts" t="ArrayList" />
</o>
<o>
<v n="TextID">"87"</v>
<v n="TextDefault">"Elapsed time (ms)"</v>
<l n="LanguageTexts" t="ArrayList" />
</o>
<o>
<v n="TextID">"104"</v>
<v n="TextDefault">"ENABLE"</v>
@@ -295,6 +320,21 @@
<v n="TextDefault">"ENABLE FW"</v>
<l n="LanguageTexts" t="ArrayList" />
</o>
<o>
<v n="TextID">"1009"</v>
<v n="TextDefault">"End switches simulation"</v>
<l n="LanguageTexts" t="ArrayList" />
</o>
<o>
<v n="TextID">"554"</v>
<v n="TextDefault">"EndSwitchBwd"</v>
<l n="LanguageTexts" t="ArrayList" />
</o>
<o>
<v n="TextID">"1084"</v>
<v n="TextDefault">"EndSwitchFwd"</v>
<l n="LanguageTexts" t="ArrayList" />
</o>
<o>
<v n="TextID">"109"</v>
<v n="TextDefault">"English"</v>
@@ -415,6 +455,11 @@
<v n="TextDefault">"halt"</v>
<l n="LanguageTexts" t="ArrayList" />
</o>
<o>
<v n="TextID">"347"</v>
<v n="TextDefault">"High pressure limit (bar)"</v>
<l n="LanguageTexts" t="ArrayList" />
</o>
<o>
<v n="TextID">"123"</v>
<v n="TextDefault">"HOME"</v>
@@ -460,6 +505,11 @@
<v n="TextDefault">"jogFw"</v>
<l n="LanguageTexts" t="ArrayList" />
</o>
<o>
<v n="TextID">"1195"</v>
<v n="TextDefault">"Label"</v>
<l n="LanguageTexts" t="ArrayList" />
</o>
<o>
<v n="TextID">"19"</v>
<v n="TextDefault">"Limit switches simulation"</v>
@@ -475,6 +525,11 @@
<v n="TextDefault">"LimitFwd"</v>
<l n="LanguageTexts" t="ArrayList" />
</o>
<o>
<v n="TextID">"961"</v>
<v n="TextDefault">"Low pressure limit (bar)"</v>
<l n="LanguageTexts" t="ArrayList" />
</o>
<o>
<v n="TextID">"298"</v>
<v n="TextDefault">"masterGear"</v>
@@ -615,6 +670,11 @@
<v n="TextDefault">"stop"</v>
<l n="LanguageTexts" t="ArrayList" />
</o>
<o>
<v n="TextID">"978"</v>
<v n="TextDefault">"Stop at any Limit Swtich"</v>
<l n="LanguageTexts" t="ArrayList" />
</o>
<o>
<v n="TextID">"108"</v>
<v n="TextDefault">"Test Language"</v>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.11">
<TcPlcObject Version="1.1.0.1">
<POU Name="Application_Template" Id="{4bdeebc0-15d8-4790-97d0-e9c4239d121c}" SpecialFunc="None">
<Declaration><![CDATA[PROGRAM Application_Template
VAR

View File

@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1">
<POU Name="Shutter_Operator_panel_Template" Id="{09741edf-58a0-0d9d-0563-de91fec8904d}" SpecialFunc="None">
<Declaration><![CDATA[PROGRAM Shutter_Operator_panel_Template
VAR
//Variables used to control the LEDs of the Safety Shutter Operator panel
(*bExtendedLight AT %Q*: BOOL; //Power output for Open position + LED
bRetractedLight AT %Q*: BOOL; //Power output for Close position + LED
bMovingLight AT %Q*: BOOL; //Power output for cylinder Moving LED
bNoPermitLight AT %Q*: BOOL; //Power output for No permit LED
bErrorLight AT %Q*: BOOL; //Power output for Error LED
*)
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[//Uncomment the code, it is needed to control the LEDs of the Safety Shutter Operator panel
(*
//Assign LED to the permit status
bNoPermitLight := NOT GVL.astPneumaticAxes[x].stPneumaticAxisInputs.bPSSPermit;
//Assign LED to the error status
bErrorLight := GVL.astPneumaticAxes[x].stPneumaticAxisStatus.bError;
//Assign LEDs to the end switches statuses
bExtendedLight := GVL.astPneumaticAxes[x].stPneumaticAxisStatus.bExtended;
bRetractedLight := GVL.astPneumaticAxes[x].stPneumaticAxisStatus.bRetracted;
//Checking the condition for the Moving LED
bMovingLight := GVL.astPneumaticAxes[x].stPneumaticAxisStatus.bRetracting OR gvl.astPneumaticAxes[x].stPneumaticAxisStatus.bExtending;
*)
]]></ST>
</Implementation>
</POU>
</TcPlcObject>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.11">
<TcPlcObject Version="1.1.0.1">
<POU Name="Axis_Template" Id="{1a43acb4-bd2e-4637-97fb-9976d47292b6}" SpecialFunc="None">
<Declaration><![CDATA[PROGRAM Axis_Template
VAR
@@ -14,23 +14,22 @@ END_VAR
<ST><![CDATA[//Initial parameters of an Axis
(* Uncomment the next IF statement to configure and activate the intial parameters of the axis
IF _TaskInfo[fbGetCurTaskIndex.index].FirstCycle THEN
//Axis description for EPICS PV
GVL.astAxes[x].stDescription.sAxisName := 'MotorApplication1';
GVL.astAxes[x].stDescription.eUnit := E_AxisEngUnit.eMeter;
GVL.astAxes[x].stDescription.nPrefix := -3;
//Initial default values:
GVL.astAxes[x].stConfig.eHomeSeq := 0;
GVL.astAxes[x].stConfig.fHomePosition := 0.0;
GVL.astAxes[x].stConfig.fHomeFinishDistance := 0.0;
GVL.astAxes[x].stConfig.eRestorePosition := E_RestorePosition.eRestoreWithoutHome;
GVL.astAxes[x].stConfig.bEnableTemperatureDisable := FALSE;
GVL.astAxes[x].stConfig.fMaxTemperature := 0.0;
GVL.astAxes[x].stConfig.bEnableStopWithAnyLimitSwitch := TRUE;
//Add the variables of Advanced homing parameters if you need to chage them
GVL.astAxes[x].stConfig.stHomingConfig.bDisableDriveAccess := TRUE;
END_IF
*)
//Define ACTIONS() or write exclusive code for an specific axis.
(*Eg. Stop when temperature reaches certain values, reduce speed if a signal is activated, etc.
(*Eg. Reduce speed if a signal is activated, interlock to a variable etc.
Eg. GVL.astAxes[x].stControl.bInterlockFwd := NOT bInterlockFwdOK;*)
]]></ST>
</Implementation>

View File

@@ -1,13 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.11">
<TcPlcObject Version="1.1.0.1">
<POU Name="Pneumatics_Template" Id="{7bf401fb-a600-4741-a67b-36f20e194cfc}" SpecialFunc="None">
<Declaration><![CDATA[PROGRAM Pneumatics_Template
VAR
//Define all necessary variables for your application
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[//Test the program to control pneumatic acutator through PneumaticsVisu.
//Currently implemented control of single solenoid through PLC and and manually, with two momentary push buttons.
<ST><![CDATA[//Initial parameters of an Pneumatic Axis
//Uncomment the next IF statement to configure and activate the intial parameters of the axis
(*IF TaskInfo[fbGetCurTaskIndex.index].FirstCycle THEN
GVL.astPneumaticAxes[x].stPneumaticAxisConfig.sPneumaticAxisName := 'Shutter';
GVL.astPneumaticAxes[x].stPneumaticAxisConfig.bPneumaticAxisShutter := TRUE;
GVL.astPneumaticAxes[x].stPneumaticAxisConfig.nTimeToExtend := 10;
GVL.astPneumaticAxes[x].stPneumaticAxisConfig.nTimeToRetract := 10;
GVL.astPneumaticAxes[x].stPneumaticAxisConfig.nAllowTimePressureOutOfRange := 5;
GVL.astPneumaticAxes[x].stPneumaticAxisConfig.fLowLimitPressureValue := 3.5;
GVL.astPneumaticAxes[x].stPneumaticAxisConfig.fHighLimitPressureValue := 6.0;
END_IF
*)

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.11">
<TcPlcObject Version="1.1.0.1">
<POU Name="MAIN" Id="{33eb6f49-7781-4211-a70b-87ada6d80cb7}" SpecialFunc="None">
<Declaration><![CDATA[PROGRAM MAIN
VAR
@@ -45,6 +45,10 @@ IF _TaskInfo[fbGetCurTaskIndex.index].FirstCycle THEN
afbAxes[GVL.iAxis].stAxis REF= astAxes[GVL.iAxis];
aIAxes[GVL.iAxis] := afbAxes[GVL.iAxis];
END_FOR
FOR GVL.iPneumaticAxis := 1 TO GVL_APP.nPNEUMATIC_AXIS_NUM DO
afbPneumaticAxes[GVL.iPneumaticAxis].stPneumaticAxis REF= astPneumaticAxes[GVL.iPneumaticAxis];
END_FOR
//Custom axis types defined and linked to aiAxes here
//FB_CustomAxis extends FB_axis
//fbCustomAxis.stAxis REF= astAxes[x];
@@ -58,7 +62,7 @@ END_FOR
//Execute Pneumatic Axis logic
FOR GVL.iPneumaticAxis := 1 TO GVL_APP.nPNEUMATIC_AXIS_NUM DO
afbPneumaticAxes[GVL.iPneumaticAxis](stPneumaticAxisStruct := GVL.astPneumaticAxes[GVL.iPneumaticAxis]);
afbPneumaticAxes[GVL.iPneumaticAxis]();
END_FOR
]]></ST>
</Implementation>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.11">
<TcPlcObject Version="1.1.0.1">
<Task Name="PlcTask" Id="{96ece0eb-a21b-4000-8986-812071c196ce}">
<!--CycleTime in micro seconds.-->
<CycleTime>10000</CycleTime>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.11">
<TcPlcObject Version="1.1.0.1">
<VisuManager Name="Visualization Manager" Id="{9ab27b0a-e061-4269-b032-b221661a7379}">
<XmlArchive>
<Data>
@@ -43,12 +43,12 @@
</o>
<o n="RegisterDesc" t="GenericFbDescription">
<d n="FbMethods" t="CaseInsensitiveHashtable" ckt="String" cvt="Guid">
<v>FB_Exit</v>
<v>0be1b9ab-e8eb-4b33-b803-109abb46bde4</v>
<v>FB_Init</v>
<v>c98701bd-1e9f-450a-a2a8-a2474d536f2e</v>
<v>FB_Reinit</v>
<v>5b6e372a-a69d-40e8-aef7-f470b7c53d95</v>
<v>FB_Exit</v>
<v>0be1b9ab-e8eb-4b33-b803-109abb46bde4</v>
</d>
<v n="FbName">"NotImportant"</v>
<v n="FbGuid">{aa8b7e42-e967-427f-8f2e-f00f9d706470}</v>
@@ -464,42 +464,42 @@
</o>
<o n="DefInpHandlerGuids" t="GenericFbDescription">
<d n="FbMethods" t="CaseInsensitiveHashtable" ckt="String" cvt="Guid">
<v>ExecuteLooseCapture</v>
<v>4e2884cd-dc97-4120-914c-87a83e618f1f</v>
<v>ExecuteMouseUp</v>
<v>57eea9a5-15d9-4269-bb8d-9fee5420cdb2</v>
<v>Init</v>
<v>e61a0910-39b6-4bcc-9a64-fcab62230628</v>
<v>FB_Exit</v>
<v>e6e1ea47-0811-4b03-9888-d0564361e0d6</v>
<v>ExecuteMouseDblClick</v>
<v>a517a0ac-170b-4df4-b289-55dcb57628ed</v>
<v>GetElementInfo</v>
<v>f64cb89f-3016-4fba-85f5-02efcd4282c1</v>
<v>ExecuteMouseDown</v>
<v>94bab392-b395-4c03-9d0e-5738d11bd021</v>
<v>FB_Reinit</v>
<v>97933c03-0169-4afe-ac83-de892204e120</v>
<v>Initialize</v>
<v>6946d6e0-129f-4425-b8b0-ef98281a99e9</v>
<v>ExecuteMouseMove</v>
<v>58fc221c-be14-4e34-871e-a118f8ba9539</v>
<v>ExecuteDialogClosed</v>
<v>f08d08b6-e70c-4bef-a136-38845bd246d8</v>
<v>ExecuteKeyUp</v>
<v>7403635b-2725-4f00-93d4-e0dd125959de</v>
<v>ExecuteKeyDown</v>
<v>9649ecda-3794-4d6b-a8a7-71e528d9d170</v>
<v>abstrGetDefaultCursor</v>
<v>25718998-50a9-408d-8b3f-20a55e2cc784</v>
<v>ExecuteDialogClosed</v>
<v>f08d08b6-e70c-4bef-a136-38845bd246d8</v>
<v>ExecuteKeyDown</v>
<v>9649ecda-3794-4d6b-a8a7-71e528d9d170</v>
<v>ExecuteKeyUp</v>
<v>7403635b-2725-4f00-93d4-e0dd125959de</v>
<v>ExecuteLooseCapture</v>
<v>4e2884cd-dc97-4120-914c-87a83e618f1f</v>
<v>ExecuteMouseClick</v>
<v>cd348bda-7eaf-4dfe-8c4b-bf9b71e5b10c</v>
<v>ExecuteMouseDblClick</v>
<v>a517a0ac-170b-4df4-b289-55dcb57628ed</v>
<v>ExecuteMouseDown</v>
<v>94bab392-b395-4c03-9d0e-5738d11bd021</v>
<v>ExecuteMouseEnter</v>
<v>569205fa-533b-4fc2-8d51-21ccab693305</v>
<v>ExecuteMouseLeave</v>
<v>3bacea68-55b4-4764-928e-e69910299932</v>
<v>ExecuteMouseMove</v>
<v>58fc221c-be14-4e34-871e-a118f8ba9539</v>
<v>ExecuteMouseUp</v>
<v>57eea9a5-15d9-4269-bb8d-9fee5420cdb2</v>
<v>FB_Exit</v>
<v>e6e1ea47-0811-4b03-9888-d0564361e0d6</v>
<v>FB_Init</v>
<v>f37e1250-9b48-45ca-810e-c192ea9440ec</v>
<v>ExecuteMouseClick</v>
<v>cd348bda-7eaf-4dfe-8c4b-bf9b71e5b10c</v>
<v>FB_Reinit</v>
<v>97933c03-0169-4afe-ac83-de892204e120</v>
<v>GetElementInfo</v>
<v>f64cb89f-3016-4fba-85f5-02efcd4282c1</v>
<v>Init</v>
<v>e61a0910-39b6-4bcc-9a64-fcab62230628</v>
<v>Initialize</v>
<v>6946d6e0-129f-4425-b8b0-ef98281a99e9</v>
</d>
<v n="FbName">"NotImportant"</v>
<v n="FbGuid">{073ee466-cf0a-4c8b-ba92-64f671516699}</v>

View File

@@ -16,7 +16,7 @@
<Released>false</Released>
<CompilerVersion>
</CompilerVersion>
<WriteProductVersion>true</WriteProductVersion>
<WriteProductVersion>false</WriteProductVersion>
<GenerateTpy>false</GenerateTpy>
<CombineIds>true</CombineIds>
</PropertyGroup>
@@ -37,6 +37,9 @@
<Compile Include="POUs\Application_Specific\Applications\Application_Template.TcPOU">
<SubType>Code</SubType>
</Compile>
<Compile Include="POUs\Application_Specific\Applications\Shutter_Operator_panel_Template.TcPOU">
<SubType>Code</SubType>
</Compile>
<Compile Include="POUs\Application_Specific\Axes\Axis_Template.TcPOU">
<SubType>Code</SubType>
</Compile>
@@ -73,6 +76,9 @@
<Compile Include="tc_mca_std_lib\DUTs\Axis_Structures\ST_AxisStruct.TcDUT">
<SubType>Code</SubType>
</Compile>
<Compile Include="tc_mca_std_lib\DUTs\Axis_Structures\ST_BacklashConfig.TcDUT">
<SubType>Code</SubType>
</Compile>
<Compile Include="tc_mca_std_lib\DUTs\Axis_Structures\ST_GearAxis.TcDUT">
<SubType>Code</SubType>
</Compile>