re add axis and application templates

This commit is contained in:
SCooper
2021-07-29 11:23:29 +01:00
parent d982c3585e
commit cc7d2233a7
5 changed files with 57 additions and 30 deletions

View File

@@ -905,18 +905,6 @@ External Setpoint Generation:
<CLSID ClassFactory="TcPlc30">{08500001-0000-0000-F000-000000000064}</CLSID>
<Vars VarGrpType="1">
<Name>PlcTask Inputs</Name>
<Var>
<Name>MAIN.axisBladeNeg.NcToPlc</Name>
<Type GUID="{72F5AAAA-16DF-4ED3-8367-F6C8C3ADAE99}" Namespace="MC">NCTOPLC_AXIS_REF</Type>
</Var>
<Var>
<Name>MAIN.axisBladePos.NcToPlc</Name>
<Type GUID="{72F5AAAA-16DF-4ED3-8367-F6C8C3ADAE99}" Namespace="MC">NCTOPLC_AXIS_REF</Type>
</Var>
<Var>
<Name>MAIN.axisGap.NcToPlc</Name>
<Type GUID="{72F5AAAA-16DF-4ED3-8367-F6C8C3ADAE99}" Namespace="MC">NCTOPLC_AXIS_REF</Type>
</Var>
<Var>
<Name>GVL.astAxes[1].stInputs.bLimitFwd</Name>
<Type>BOOL</Type>
@@ -1009,18 +997,6 @@ External Setpoint Generation:
<Name>limitsPower.bEnableAxis2Enc</Name>
<Type>BOOL</Type>
</Var>
<Var>
<Name>MAIN.axisBladeNeg.PlcToNc</Name>
<Type GUID="{63A84524-72E3-41C8-BEAB-4CCE44690A13}" Namespace="MC">PLCTONC_AXIS_REF</Type>
</Var>
<Var>
<Name>MAIN.axisBladePos.PlcToNc</Name>
<Type GUID="{63A84524-72E3-41C8-BEAB-4CCE44690A13}" Namespace="MC">PLCTONC_AXIS_REF</Type>
</Var>
<Var>
<Name>MAIN.axisGap.PlcToNc</Name>
<Type GUID="{63A84524-72E3-41C8-BEAB-4CCE44690A13}" Namespace="MC">PLCTONC_AXIS_REF</Type>
</Var>
<Var>
<Name>testProg.myFirstSlits.iGapSizePosition</Name>
<Type>UDINT</Type>
@@ -1080,10 +1056,6 @@ External Setpoint Generation:
<Link VarA="PlcTask Outputs^limitsPower.bEnableAxis1Enc" VarB="DIG Outputs^Channel 1^Output" Size="1"/>
<Link VarA="PlcTask Outputs^limitsPower.bEnableAxis2Enc" VarB="DIG Outputs^Channel 2^Output" Size="1"/>
</OwnerB>
<OwnerB Name="TINC^NC-Task 1 SAF^Axes^Axis 5">
<Link VarA="PlcTask Inputs^MAIN.axisGap.NcToPlc" VarB="Outputs^ToPlc"/>
<Link VarA="PlcTask Outputs^MAIN.axisGap.PlcToNc" VarB="Inputs^FromPlc"/>
</OwnerB>
<OwnerB Name="TINC^NC-Task 1 SAF^Axes^bladeNeg">
<Link VarA="PlcTask Inputs^GVL.astAxes[1].Axis.NcToPlc" VarB="Outputs^ToPlc"/>
<Link VarA="PlcTask Outputs^GVL.astAxes[1].Axis.PlcToNc" VarB="Inputs^FromPlc"/>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.5">
<POU Name="Application_Template" Id="{4bdeebc0-15d8-4790-97d0-e9c4239d121c}" SpecialFunc="None">
<Declaration><![CDATA[PROGRAM Application_Template
VAR
//Define all necessary variables for your application
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[//Program any specific code or safety code for an specific application when it involves multiple axes
//Eg. Collision avoidance, interlocks, sequencing, etc.]]></ST>
</Implementation>
<LineIds Name="Application_Template">
<LineId Id="5" Count="0" />
<LineId Id="10" Count="0" />
</LineIds>
</POU>
</TcPlcObject>

View File

@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.5">
<POU Name="Axis_Template" Id="{1a43acb4-bd2e-4637-97fb-9976d47292b6}" SpecialFunc="None">
<Declaration><![CDATA[PROGRAM Axis_Template
VAR
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[//Initial parameters of an Axis
(*IF _TaskInfo[fbGetCurTaskIndex.index].FirstCycle THEN
//Initial default values:
GVL.astAxes[1].stConfig.eHomeSeq := 0;
GVL.astAxes[1].stConfig.fHomePosition := 0.0;
GVL.astAxes[1].stConfig.fHomeFinishDistance := 0.0;
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.
]]></ST>
</Implementation>
<LineIds Name="Axis_Template">
<LineId Id="20" Count="0" />
<LineId Id="5" Count="0" />
<LineId Id="13" Count="0" />
<LineId Id="17" Count="2" />
<LineId Id="14" Count="0" />
<LineId Id="22" Count="0" />
<LineId Id="21" Count="0" />
<LineId Id="24" Count="0" />
<LineId Id="23" Count="0" />
</LineIds>
</POU>
</TcPlcObject>

View File

@@ -4,6 +4,7 @@
<Declaration><![CDATA[PROGRAM testProg
VAR
myFirstSlits : FB_SlitPair;
END_VAR
]]></Declaration>
<Implementation>
@@ -12,7 +13,8 @@ GVL.astAxes[1].stConfig.fHomePosition:=-30;
GVL.astAxes[2].stConfig.eHomeSeq:=E_HomingRoutines.eHomeToRef_Fwd;
GVL.astAxes[2].stConfig.fHomePosition:=30;
myFirstSlits(iBladeNegative:=1,iBladePositive:=2, iGapSize:=3, iGapCentre:=4, bEnable :=TRUE);]]></ST>
myFirstSlits(iBladeNegative:=1,iBladePositive:=2, iGapSize:=3, iGapCentre:=4);
]]></ST>
</Implementation>
<LineIds Name="testProg">
<LineId Id="10" Count="0" />
@@ -20,6 +22,7 @@ myFirstSlits(iBladeNegative:=1,iBladePositive:=2, iGapSize:=3, iGapCentre:=4, bE
<LineId Id="11" Count="0" />
<LineId Id="13" Count="1" />
<LineId Id="5" Count="0" />
<LineId Id="20" Count="0" />
</LineIds>
</POU>
</TcPlcObject>

View File

@@ -34,7 +34,7 @@ VAR PERSISTENT
bRestoreOnStartup: BOOL;
END_VAR]]></Declaration>
<Implementation>
<ST><![CDATA[//POSITION_RECOVERY();
<ST><![CDATA[POSITION_RECOVERY();
AXES();
PROG();