Modify the templates to reflect the format and parameters
Add the temperature configuraiton in Axis_template Format the var field in Application_Template Call both from the PROG action in MAIN() as example modified: solution/tc_project_app/POUs/Application_Specific/Applications/Application_Template.TcPOU modified: solution/tc_project_app/POUs/Application_Specific/Axes/Axis_Template.TcPOU modified: solution/tc_project_app/POUs/MAIN.TcPOU
This commit is contained in:
@@ -3,7 +3,8 @@
|
||||
<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
|
||||
//Define all necessary variables for your application
|
||||
|
||||
END_VAR
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
|
||||
@@ -12,19 +12,23 @@ END_VAR
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[//Initial parameters of an Axis
|
||||
(*IF _TaskInfo[fbGetCurTaskIndex.index].FirstCycle THEN
|
||||
(* 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[1].stDescription.sAxisName := 'MotorApplication1';
|
||||
GVL.astAxes[1].stDescription.eUnit := E_AxisEngUnit.eMeter;
|
||||
GVL.astAxes[1].stDescription.nPrefix := -3;
|
||||
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[1].stConfig.eHomeSeq := 0;
|
||||
GVL.astAxes[1].stConfig.fHomePosition := 0.0;
|
||||
GVL.astAxes[1].stConfig.fHomeFinishDistance := 0.0;
|
||||
GVL.astAxes[1].stConfig.eRestorePosition := E_RestorePosition.eRestoreWithoutHome;
|
||||
END_IF*)
|
||||
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;
|
||||
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. GVL.astAxes[x].stControl.bInterlockFwd := NOT bInterlockFwdOK;*)
|
||||
|
||||
@@ -109,11 +109,11 @@ GVL.fbGetCurTaskIndex();
|
||||
//Create as many programs in that folder as axes and applications you have or need
|
||||
|
||||
//Axes initial parameters and program
|
||||
//Axis_Template();
|
||||
Axis_Template();
|
||||
//Pneumatics_Template();
|
||||
|
||||
//Application program calls
|
||||
//Application_Template();
|
||||
Application_Template();
|
||||
]]></ST>
|
||||
</Implementation>
|
||||
</Action>
|
||||
|
||||
Reference in New Issue
Block a user