Initial
This commit is contained in:
83
PLC/6 Aligner/POUs/ALIGNER_IO_FB.TcPOU
Normal file
83
PLC/6 Aligner/POUs/ALIGNER_IO_FB.TcPOU
Normal file
@@ -0,0 +1,83 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4026.12">
|
||||
<POU Name="ALIGNER_IO_FB" Id="{617e5ee2-ae00-42c0-8de6-a2292df23fc7}" SpecialFunc="None">
|
||||
<Declaration><![CDATA[FUNCTION_BLOCK ALIGNER_IO_FB EXTENDS Station_GENERAL_IO_FB
|
||||
VAR_OUTPUT
|
||||
rInDiameter : LREAL; //mm
|
||||
rInRoundness : LREAL; //mm
|
||||
|
||||
rInX_Coordinates : LREAL; //mm
|
||||
rInY_Coordinates : LREAL; //mm
|
||||
END_VAR
|
||||
VAR
|
||||
KeyenceSensor AT %I* : ARRAY[0..3] OF UDINT;
|
||||
END_VAR
|
||||
VAR CONSTANT
|
||||
END_VAR
|
||||
VAR_INPUT
|
||||
ChuckVacuum : PneumaticCylinder_FB;
|
||||
END_VAR
|
||||
|
||||
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[//LedCylinder();
|
||||
ChuckVacuum();
|
||||
ChuckVacuum.bInDown := NOT ChuckVacuum.bInUp;
|
||||
rInDiameter := KeyenceSensor[0];
|
||||
rInDiameter := rInDiameter*2;
|
||||
rInDiameter := rInDiameter /1000;
|
||||
|
||||
|
||||
rInRoundness := KeyenceSensor[1];
|
||||
rInRoundness := rInRoundness/1000;
|
||||
|
||||
|
||||
rInX_Coordinates := UDINT_TO_DINT(KeyenceSensor[2]);
|
||||
rInX_Coordinates := rInX_Coordinates /1000;
|
||||
|
||||
|
||||
rInY_Coordinates := UDINT_TO_DINT(KeyenceSensor[3]);
|
||||
rInY_Coordinates := rInY_Coordinates /1000;
|
||||
|
||||
IF ROBOT_MAIN.TargetStation = iStation THEN
|
||||
CASE CMD[RobotStation] OF
|
||||
GetCMD:
|
||||
IF ROBOT_MAIN.RobotControl.bInPartOnSucker[ROBOT_MAIN.TargetPuddle] THEN
|
||||
ChuckVacuum.Down(TRUE);
|
||||
END_IF
|
||||
PutCMD:
|
||||
IF NOT ROBOT_MAIN.RobotControl.bInPartOnSucker[ROBOT_MAIN.TargetPuddle] THEN
|
||||
ChuckVacuum.Up(TRUE);
|
||||
END_IF
|
||||
ChangeCMD:
|
||||
IF SpinnerVacOff THEN
|
||||
ChuckVacuum.Down(TRUE);
|
||||
END_IF
|
||||
|
||||
IF SpinnerVacOn THEN
|
||||
ChuckVacuum.Up(TRUE);
|
||||
END_IF
|
||||
END_CASE
|
||||
END_IF]]></ST>
|
||||
</Implementation>
|
||||
<Method Name="Initialization" Id="{a871eb65-cceb-4b85-87c8-1d7073b58215}">
|
||||
<Declaration><![CDATA[METHOD Initialization
|
||||
VAR_INPUT
|
||||
iStation : INT;
|
||||
END_VAR]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[InitializationExt(iStation);
|
||||
|
||||
ChuckVacuum.Initialization(
|
||||
iStation,
|
||||
eAlignerMedienNamen.ChuckVacuumOn,
|
||||
eAlignerMedienNamen.ChuckVacuumOff,
|
||||
SPINNER_ErrorNr.eChuckVacuumOn,
|
||||
Peripherie_GVL.ServiceNameChuckVacuumOn,
|
||||
Peripherie_GVL.ServiceNameChuckVacuumOff
|
||||
);]]></ST>
|
||||
</Implementation>
|
||||
</Method>
|
||||
</POU>
|
||||
</TcPlcObject>
|
||||
444
PLC/6 Aligner/POUs/ALIGNER_MAIN_FB.TcPOU
Normal file
444
PLC/6 Aligner/POUs/ALIGNER_MAIN_FB.TcPOU
Normal file
@@ -0,0 +1,444 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4026.13">
|
||||
<POU Name="ALIGNER_MAIN_FB" Id="{776bb155-78b6-4cd1-a38b-c250c1e10738}" SpecialFunc="None">
|
||||
<Declaration><![CDATA[FUNCTION_BLOCK ALIGNER_MAIN_FB EXTENDS Station_GENERAL_MAIN_FB IMPLEMENTS I_STATION_CMD_CALL
|
||||
VAR_INPUT
|
||||
IO : ALIGNER_IO_FB;
|
||||
|
||||
bCalibration : BOOL;
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
Center : sPoint;
|
||||
Diameter : LREAL;
|
||||
Roundness : LREAL;
|
||||
END_VAR
|
||||
VAR
|
||||
TMX_5000 : TMX_5000_FB;
|
||||
|
||||
|
||||
XAxis : AXIS_FB;
|
||||
YAxis : AXIS_FB;
|
||||
|
||||
Config : sAlignerConfig;
|
||||
ConfigOld : sAlignerConfig;
|
||||
|
||||
XAxis_DefaultPosition : LREAL;
|
||||
END_VAR]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[]]></ST>
|
||||
</Implementation>
|
||||
<Method Name="CloseInOut" Id="{a0336e32-2f81-4f51-b564-9eda8a3acf8b}">
|
||||
<Declaration><![CDATA[METHOD CloseInOut : BOOL
|
||||
VAR_INST
|
||||
GripperSize : INT;
|
||||
END_VAR]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[CASE _Step OF
|
||||
0:
|
||||
GripperSize := ROBOT_MAIN.GetGripperSize(iStationStatus.WaferInfo[0].Size);
|
||||
CASE iCMD OF
|
||||
CloseInCMD:
|
||||
_Step := 10;
|
||||
CloseOutCMD:
|
||||
_Step := 50;
|
||||
END_CASE
|
||||
10:
|
||||
Center.X := 0;
|
||||
Center.Y := 0;
|
||||
|
||||
Diameter := 0;
|
||||
Roundness := 0;
|
||||
|
||||
|
||||
IF TMX_5000.ProgramChange(GripperSize) THEN
|
||||
_Step := 0;
|
||||
CloseInOut := TRUE;
|
||||
END_IF
|
||||
50:
|
||||
XAxis.rInTargetPosition := Config.RobotHandlingPosition[GripperSize].X;
|
||||
XAxis.rInTargetVelocity := Config.X_DefaultVelocity;
|
||||
|
||||
YAxis.rInTargetPosition := Config.RobotHandlingPosition[GripperSize].Y;
|
||||
YAxis.rInTargetVelocity := Config.Y_DefaultVelocity;
|
||||
|
||||
_Step := 60;
|
||||
60:
|
||||
IF XAxis.MoveAbsolute() AND YAxis.MoveAbsolute() THEN
|
||||
_Step := 0;
|
||||
CloseInOut := TRUE;
|
||||
END_IF
|
||||
END_CASE
|
||||
]]></ST>
|
||||
</Implementation>
|
||||
</Method>
|
||||
<Method Name="FB_Init" Id="{0eee1379-e597-4345-b84b-dc11d41915ec}">
|
||||
<Declaration><![CDATA[//FB_Init is always available implicitly and it is used primarily for initialization.
|
||||
//The return value is not evaluated. For a specific influence, you can also declare the
|
||||
//methods explicitly and provide additional code there with the standard initialization
|
||||
//code. You can evaluate the return value.
|
||||
METHOD FB_Init: BOOL
|
||||
VAR_INPUT
|
||||
bInitRetains: BOOL; // TRUE: the retain variables are initialized (reset warm / reset cold)
|
||||
bInCopyCode: BOOL; // TRUE: the instance will be copied to the copy code afterward (online change)
|
||||
END_VAR]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[_DataLogger := TRUE;
|
||||
_VisuName := 'ALIGNER';
|
||||
_SchedulerManagement := TRUE;
|
||||
_ManualSizeSelectionAvailable := TRUE;]]></ST>
|
||||
</Implementation>
|
||||
</Method>
|
||||
<Method Name="INIT" Id="{6a26cf46-6760-4e2a-968a-62bc5a2d5c0d}">
|
||||
<Declaration><![CDATA[METHOD INIT : BOOL
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[CASE _Step OF
|
||||
0:
|
||||
IF TMX_5000.RunMode(TRUE) THEN
|
||||
XAxis.bOutInitDone := FALSE;
|
||||
YAxis.bOutInitDone := FALSE;
|
||||
_Step := 10;
|
||||
END_IF
|
||||
10:
|
||||
IO.ChuckVacuum.Up(TRUE);
|
||||
IF NOT XAxis.bOutInitDone THEN
|
||||
XAxis.Init();
|
||||
END_IF
|
||||
|
||||
IF NOT YAxis.bOutInitDone THEN
|
||||
YAxis.Init();
|
||||
END_IF
|
||||
|
||||
IF XAxis.bOutInitDone AND YAxis.bOutInitDone THEN
|
||||
_Step := 20;
|
||||
END_IF
|
||||
20:
|
||||
XAxis.rInTargetPosition := 0;
|
||||
XAxis.rInTargetVelocity := Config.X_DefaultVelocity;
|
||||
|
||||
YAxis.rInTargetPosition := 0;
|
||||
YAxis.rInTargetVelocity := Config.Y_DefaultVelocity;
|
||||
|
||||
IF XAxis.MoveAbsolute() AND YAxis.MoveAbsolute() THEN
|
||||
_Step := 30;
|
||||
END_IF
|
||||
30:
|
||||
IF IO.ChuckVacuum.bInUp THEN
|
||||
iStationStatus.WaferInfo[0].Number := 100;
|
||||
ELSE
|
||||
IO.ChuckVacuum.Down(TRUE);
|
||||
END_IF
|
||||
_Step := 0;
|
||||
INIT := TRUE;
|
||||
END_CASE]]></ST>
|
||||
</Implementation>
|
||||
</Method>
|
||||
<Method Name="Initialization" Id="{25efd6e4-2ecd-4902-81d2-339bdb708353}">
|
||||
<Declaration><![CDATA[METHOD Initialization : BOOL
|
||||
VAR_INPUT
|
||||
iStation : INT;
|
||||
END_VAR
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[InitializationExt(iStation);
|
||||
|
||||
iStationStatus.NoScan := TRUE;
|
||||
iStationStatus.NoRecipe := TRUE;
|
||||
|
||||
IO.Initialization(iStation);
|
||||
|
||||
iStationStatus.StationName := 'Aligner';
|
||||
RecipeStationName[iStation] := 'Aligner';
|
||||
iStationStatus.ErrorList := 'ALIGNER_ErrorNr';
|
||||
|
||||
ConfigManagement.Initialization(ADR(Config), ADR(ConfigOld), SIZEOF(Config), 'sAlignerConfig', 'Aligner');
|
||||
ConfigPlausibility REF= Config.ConfigPlausibility;
|
||||
|
||||
TMX_5000.Initialization(iStation);
|
||||
|
||||
|
||||
{region "X Axis"}
|
||||
XAxis.Config.sInName := 'X';
|
||||
XAxis.Config.DeviceID := 1;
|
||||
XAxis.Config.sInPositionUnit := 'mm';
|
||||
XAxis.Config.sInVelocityUnit := 'mm/s';
|
||||
XAxis.Config.sInAccelerationUnit := 'mm/s²';
|
||||
XAxis.Config.rInMinPosition := -10;
|
||||
XAxis.Config.rInMaxPosition := 10;
|
||||
XAxis.Config.rInMaxVelocity := 10;
|
||||
XAxis.Config.rInMinVelocity := 0.1;
|
||||
XAxis.Config.rInMaxAcceleration := 50;
|
||||
XAxis.Config.rInMinAcceleration := 0.1;
|
||||
XAxis.Config.bInNoEncoder := TRUE;
|
||||
XAxis.Config.bInRelativeEncoder := TRUE;
|
||||
XAxis.Config.bInService := TRUE;
|
||||
XAxis.Config.rInOffset REF= Config.X_Offset;
|
||||
XAxis.Config.rInDefaultPosition REF= XAxis_DefaultPosition;
|
||||
XAxis.Config.rInDefaultVelocity REF= Config.X_DefaultVelocity;
|
||||
XAxis.Initialization(iStation);
|
||||
|
||||
XAxis.bInEnablePositive := TRUE;
|
||||
XAxis.bInEnableNegative := TRUE;
|
||||
{endregion}
|
||||
|
||||
{region "Y Axis"}
|
||||
YAxis.Config.sInName := 'Y';
|
||||
YAxis.Config.DeviceID := 2;
|
||||
YAxis.Config.sInPositionUnit := 'mm';
|
||||
YAxis.Config.sInVelocityUnit := 'mm/s';
|
||||
YAxis.Config.sInAccelerationUnit := 'mm/s²';
|
||||
YAxis.Config.rInMinPosition := -10;
|
||||
YAxis.Config.rInMaxPosition := 10;
|
||||
YAxis.Config.rInMaxVelocity := 10;
|
||||
YAxis.Config.rInMinVelocity := 0.1;
|
||||
YAxis.Config.rInMaxAcceleration := 50;
|
||||
YAxis.Config.rInMinAcceleration := 0.1;
|
||||
YAxis.Config.bInNoEncoder := TRUE;
|
||||
YAxis.Config.bInRelativeEncoder := TRUE;
|
||||
YAxis.Config.bInService := TRUE;
|
||||
YAxis.Config.rInOffset REF= Config.Y_Offset;
|
||||
YAxis.Config.rInDefaultPosition REF= XAxis_DefaultPosition;
|
||||
YAxis.Config.rInDefaultVelocity REF= Config.Y_DefaultVelocity;
|
||||
YAxis.Initialization(iStation);
|
||||
|
||||
YAxis.bInEnablePositive := TRUE;
|
||||
YAxis.bInEnableNegative := TRUE;
|
||||
{endregion}
|
||||
|
||||
|
||||
|
||||
|
||||
ConfigManagement.FileName := 'Aligner';
|
||||
|
||||
DataLogger.format := '%0.3f;%0.3f;%0.3f;%0.3f;$N';
|
||||
|
||||
DataLogger.Data[1].Name := 'X (mm)';
|
||||
DataLogger.Data[1].Value REF= Center.X;
|
||||
DataLogger.Data[1].Tolerence := 0.01;
|
||||
|
||||
DataLogger.Data[2].Name := 'Y (mm)';
|
||||
DataLogger.Data[2].Value REF= Center.Y;
|
||||
DataLogger.Data[2].Tolerence := 0.001;
|
||||
|
||||
DataLogger.Data[3].Name := 'Diameter (mm)';
|
||||
DataLogger.Data[3].Value REF= Diameter;
|
||||
DataLogger.Data[3].Tolerence := 0.1;
|
||||
|
||||
DataLogger.Data[4].Name := 'Roundness (mm)';
|
||||
DataLogger.Data[4].Value REF= Roundness;
|
||||
DataLogger.Data[4].Tolerence := 0.1;]]></ST>
|
||||
</Implementation>
|
||||
</Method>
|
||||
<Method Name="MAIN" Id="{9cf7526a-d13d-4844-b4ad-6d8c783ce101}">
|
||||
<Declaration><![CDATA[METHOD MAIN : BOOL
|
||||
VAR_INPUT
|
||||
END_VAR
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[IO();
|
||||
XAxis();
|
||||
YAxis();
|
||||
|
||||
TMX_5000();]]></ST>
|
||||
</Implementation>
|
||||
</Method>
|
||||
<Method Name="PrepInOut" Id="{0a96881a-2ba5-4bf7-8c73-d1adb06b73bf}">
|
||||
<Declaration><![CDATA[METHOD PrepInOut : BOOL
|
||||
VAR_INST
|
||||
GripperSize : USINT;
|
||||
END_VAR]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[CASE _Step OF
|
||||
0:
|
||||
CASE iCMD OF
|
||||
PrepInCMD:
|
||||
_Step := 10;
|
||||
PrepOutCMD:
|
||||
PrepInOut := TRUE;
|
||||
END_CASE
|
||||
10:
|
||||
GripperSize := ROBOT_MAIN.GetGripperSize(iStationStatus.WaferInfo[0].Size);
|
||||
|
||||
XAxis.rInTargetPosition := Config.RobotHandlingPosition[GripperSize].X;
|
||||
XAxis.rInTargetVelocity := Config.X_DefaultVelocity;
|
||||
|
||||
YAxis.rInTargetPosition := Config.RobotHandlingPosition[GripperSize].Y;
|
||||
YAxis.rInTargetVelocity := Config.Y_DefaultVelocity;
|
||||
|
||||
_Step := 20;
|
||||
20:
|
||||
IF XAxis.MoveAbsolute() AND YAxis.MoveAbsolute() THEN
|
||||
_Step := 0;
|
||||
PrepInOut := TRUE;
|
||||
END_IF
|
||||
END_CASE]]></ST>
|
||||
</Implementation>
|
||||
</Method>
|
||||
<Method Name="SetCalibration" Id="{711e4cb2-8003-42e7-a4d8-c18dc3d54615}">
|
||||
<Declaration><![CDATA[METHOD SetCalibration
|
||||
VAR_INPUT
|
||||
TargetStation : INT;
|
||||
TargetSize : INT;
|
||||
TargetPaddle : INT;
|
||||
Center : sPoint;
|
||||
END_VAR
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[Config.CalibrationPosition[TargetStation][TargetSize][TargetPaddle] := Center;
|
||||
|
||||
ConfigManagement.CMD := eConfigCMD.Save;]]></ST>
|
||||
</Implementation>
|
||||
</Method>
|
||||
<Method Name="Start" Id="{f2375d07-415a-4633-9dd2-e516d604a136}">
|
||||
<Declaration><![CDATA[METHOD Start : BOOL
|
||||
VAR
|
||||
In : ARRAY[0..7] OF DINT;
|
||||
i : INT;
|
||||
END_VAR
|
||||
VAR_INST
|
||||
RefPoint : sPoint;
|
||||
|
||||
CassetteNumber : INT;
|
||||
NextProcess : INT;
|
||||
|
||||
TargetEtcher : INT;
|
||||
END_VAR]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[CASE _Step OF
|
||||
0:
|
||||
FOR i := 0 TO 7 DO
|
||||
In[i] := UDINT_TO_DINT(TMX_5000.rInResult[i+7]);
|
||||
END_FOR
|
||||
|
||||
Diameter := In[0];
|
||||
Diameter := Diameter;
|
||||
Diameter := Diameter /1000;
|
||||
|
||||
|
||||
IF NOT ROBOT_MAIN.CheckDiameter(Diameter, iStationStatus.WaferInfo[0].Size) THEN
|
||||
RETURN;
|
||||
END_IF
|
||||
|
||||
Roundness := In[1];
|
||||
Roundness := Roundness/1000;
|
||||
|
||||
Center.X := In[2];
|
||||
Center.X := Center.X/1000;
|
||||
|
||||
IF ABS(Center.X) > 120 THEN
|
||||
RETURN;
|
||||
END_IF
|
||||
|
||||
Center.Y := In[3];
|
||||
Center.Y := Center.Y/1000;
|
||||
|
||||
|
||||
IF bCalibration THEN
|
||||
bCalibration := FALSE;
|
||||
_Step := 100;
|
||||
ELSE
|
||||
_Step := 10;
|
||||
END_IF
|
||||
10:
|
||||
CASE CMD[FirstStation] OF
|
||||
StartCMD:
|
||||
CassetteNumber := iStationStatus.WaferInfo[0].CassetteNumber;
|
||||
NextProcess := iStationStatus.WaferInfo[0].FlowStepNumber +1;
|
||||
|
||||
TargetEtcher := CASSETTE_PROCESS[CassetteNumber][iStationStatus.WaferInfo[0].Number][NextProcess].TargetStation;
|
||||
CASE TargetEtcher OF
|
||||
20,21:
|
||||
CASSETTE_PROCESS[CassetteNumber][iStationStatus.WaferInfo[0].Number][NextProcess].Alternative[1] := TargetEtcher;
|
||||
CASSETTE_PROCESS[CassetteNumber][iStationStatus.WaferInfo[0].Number][NextProcess].Alternative[2] := TargetEtcher;
|
||||
RefPoint := Config.CalibrationPosition[TargetEtcher][iStationStatus.WaferInfo[0].Size][0];
|
||||
ELSE
|
||||
RefPoint := Config.CalibrationPosition[FirstSpinner][iStationStatus.WaferInfo[0].Size][0];
|
||||
END_CASE
|
||||
ELSE
|
||||
RefPoint := Config.CalibrationPosition[FirstSpinner][iStationStatus.WaferInfo[0].Size][0];
|
||||
END_CASE
|
||||
|
||||
_Step := 20;
|
||||
20:
|
||||
FOR i := 0 TO 7 DO
|
||||
In[i] := UDINT_TO_DINT(TMX_5000.rInResult[i+7]);
|
||||
END_FOR
|
||||
|
||||
Center.X := In[2];
|
||||
Center.X := Center.X/1000;
|
||||
|
||||
Center.Y := In[3];
|
||||
Center.Y := Center.Y/1000;
|
||||
|
||||
IF ABS(RefPoint.X - Center.X) > 0.001 THEN
|
||||
IF RefPoint.X < Center.X THEN
|
||||
YAxis.bInJogNegative := TRUE;
|
||||
YAxis.bInJogPositive := FALSE;
|
||||
YAxis.rInTargetVelocity := ABS(RefPoint.X - Center.X);
|
||||
ELSIF RefPoint.X > Center.X THEN
|
||||
YAxis.bInJogNegative := FALSE;
|
||||
YAxis.bInJogPositive := TRUE;
|
||||
YAxis.rInTargetVelocity := ABS(RefPoint.X - Center.X);
|
||||
ELSE
|
||||
YAxis.bInJogNegative := FALSE;
|
||||
YAxis.bInJogPositive := FALSE;
|
||||
END_IF
|
||||
END_IF
|
||||
|
||||
IF ABS(RefPoint.Y - Center.Y) > 0.001 THEN
|
||||
IF RefPoint.Y < Center.Y THEN
|
||||
XAxis.bInJogNegative := TRUE;
|
||||
XAxis.bInJogPositive := FALSE;
|
||||
XAxis.rInTargetVelocity := ABS(RefPoint.Y - Center.Y);
|
||||
ELSIF RefPoint.Y > Center.Y THEN
|
||||
XAxis.bInJogNegative := FALSE;
|
||||
XAxis.bInJogPositive := TRUE;
|
||||
XAxis.rInTargetVelocity := ABS(RefPoint.Y - Center.Y);
|
||||
ELSE
|
||||
XAxis.bInJogNegative := FALSE;
|
||||
XAxis.bInJogPositive := FALSE;
|
||||
END_IF
|
||||
END_IF
|
||||
|
||||
IF XAxis.rInTargetVelocity < 0.005 THEN
|
||||
XAxis.rInTargetVelocity := 0.005;
|
||||
END_IF
|
||||
IF YAxis.rInTargetVelocity < 0.005 THEN
|
||||
YAxis.rInTargetVelocity := 0.005;
|
||||
END_IF
|
||||
|
||||
DelayTimer(IN := ABS(RefPoint.X - Center.X)<= 0.001 AND ABS(RefPoint.Y - Center.Y) <=0.001, PT := T#100MS);
|
||||
IF DelayTimer.Q THEN
|
||||
DelayTimer(IN := FALSE);
|
||||
YAxis.bInJogNegative := FALSE;
|
||||
YAxis.bInJogPositive := FALSE;
|
||||
|
||||
XAxis.bInJogNegative := FALSE;
|
||||
XAxis.bInJogPositive := FALSE;
|
||||
|
||||
XAxis.rInTargetVelocity := Config.X_DefaultVelocity;
|
||||
YAxis.rInTargetVelocity := Config.Y_DefaultVelocity;
|
||||
_Step := 30;
|
||||
END_IF
|
||||
30:
|
||||
_Step := 100;
|
||||
40:
|
||||
FOR i := 0 TO 7 DO
|
||||
In[i] := UDINT_TO_DINT(TMX_5000.rInResult[i+7]);
|
||||
END_FOR
|
||||
|
||||
Center.X := In[2];
|
||||
Center.X := Center.X/1000;
|
||||
|
||||
Center.Y := In[3];
|
||||
Center.Y := Center.Y/1000;
|
||||
100:
|
||||
_Step := 0;
|
||||
Start := TRUE;
|
||||
END_CASE
|
||||
|
||||
]]></ST>
|
||||
</Implementation>
|
||||
</Method>
|
||||
</POU>
|
||||
</TcPlcObject>
|
||||
173
PLC/6 Aligner/POUs/Peripherie/TMX_5000_FB.TcPOU
Normal file
173
PLC/6 Aligner/POUs/Peripherie/TMX_5000_FB.TcPOU
Normal file
@@ -0,0 +1,173 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4026.11">
|
||||
<POU Name="TMX_5000_FB" Id="{4d9eac39-6cf5-4d08-b510-b0066824a702}" SpecialFunc="None">
|
||||
<Declaration><![CDATA[FUNCTION_BLOCK TMX_5000_FB EXTENDS Peripherie_FB
|
||||
VAR_INPUT
|
||||
bOutCmdReq AT %Q* : BOOL;
|
||||
bOutResultAck AT %Q* : BOOL;
|
||||
rOutCmdNr AT %Q* : UDINT;
|
||||
|
||||
|
||||
rOutParameter AT %Q* : ARRAY [1..2] OF UDINT;
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
bInRUN AT %I* : BOOL;
|
||||
bInCmdReady AT %I* : BOOL;
|
||||
bInCmdComplete AT %I* : BOOL;
|
||||
|
||||
rInCmdResult AT %I* : UDINT;
|
||||
|
||||
rInResult AT %I* : ARRAY [1..14] OF UDINT;
|
||||
END_VAR
|
||||
VAR
|
||||
Test : BOOL;
|
||||
ToRun : BOOL;
|
||||
|
||||
|
||||
Test2 : BOOL;
|
||||
PrNr : UDINT;
|
||||
END_VAR]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[IF iStationStatus.Soll.Stop THEN
|
||||
RunMode();
|
||||
END_IF
|
||||
|
||||
IF Test THEN
|
||||
IF RunMode(ToRun) THEN
|
||||
Test := FALSE;
|
||||
END_IF
|
||||
END_IF
|
||||
|
||||
|
||||
IF Test2 THEN
|
||||
IF ProgramChange(PrNr) THEN
|
||||
Test2 := FALSE;
|
||||
END_IF
|
||||
END_IF]]></ST>
|
||||
</Implementation>
|
||||
<Method Name="Initialization" Id="{da7fcae4-c6e6-4693-b43f-0c1671d808f0}">
|
||||
<Declaration><![CDATA[METHOD Initialization : BOOL
|
||||
VAR_INPUT
|
||||
iStation : INT;
|
||||
END_VAR
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[PeripherieInitialization(iStation);]]></ST>
|
||||
</Implementation>
|
||||
</Method>
|
||||
<Method Name="ProgramChange" Id="{ccb2494b-9a08-4ffb-bf39-dd69143f78d2}">
|
||||
<Declaration><![CDATA[METHOD ProgramChange : BOOL
|
||||
VAR_INPUT
|
||||
In : UDINT;
|
||||
END_VAR
|
||||
VAR_INST
|
||||
Step : INT;
|
||||
END_VAR]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[IF iStationStatus.Soll.Stop THEN
|
||||
Step := 0;
|
||||
RETURN;
|
||||
END_IF
|
||||
|
||||
CASE Step OF
|
||||
0:
|
||||
IF bInCmdReady THEN
|
||||
rOutCmdNr := 25; //Programm lesen
|
||||
bOutCmdReq := TRUE;
|
||||
Step := Step +1;
|
||||
END_IF
|
||||
1:
|
||||
IF bInCmdComplete THEN
|
||||
bOutCmdReq := FALSE;
|
||||
Step := Step +1;
|
||||
END_IF
|
||||
2:
|
||||
CASE rInCmdResult OF
|
||||
0:
|
||||
Step := 10;
|
||||
ELSE
|
||||
Step := 0;
|
||||
END_CASE
|
||||
10:
|
||||
IF rInResult[2] = In THEN
|
||||
Step := 100;
|
||||
ELSE
|
||||
Step := 50;
|
||||
END_IF
|
||||
50:
|
||||
IF bInCmdReady THEN
|
||||
rOutCmdNr := 24; //Programm wechseln
|
||||
rOutParameter[1] := 1;
|
||||
rOutParameter[2] := In;
|
||||
bOutCmdReq := TRUE;
|
||||
Step := Step +1;
|
||||
END_IF
|
||||
51:
|
||||
IF bInCmdComplete THEN
|
||||
bOutCmdReq := FALSE;
|
||||
Step := Step +1;
|
||||
END_IF
|
||||
52:
|
||||
CASE rInCmdResult OF
|
||||
0:
|
||||
Step := 0;
|
||||
ELSE
|
||||
Step := 0;
|
||||
END_CASE
|
||||
100:
|
||||
Step := 0;
|
||||
ProgramChange := TRUE;
|
||||
END_CASE]]></ST>
|
||||
</Implementation>
|
||||
</Method>
|
||||
<Method Name="RunMode" Id="{4b277ed8-4412-4d3f-a78e-cb1c64dc36be}">
|
||||
<Declaration><![CDATA[METHOD RunMode : BOOL
|
||||
VAR_INPUT
|
||||
In : BOOL := FALSE;
|
||||
END_VAR
|
||||
VAR_INST
|
||||
Step : INT;
|
||||
END_VAR]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[IF iStationStatus.Soll.Stop THEN
|
||||
Step := 0;
|
||||
RETURN;
|
||||
END_IF
|
||||
|
||||
CASE Step OF
|
||||
0:
|
||||
IF bInRUN = In THEN
|
||||
Step := 100;
|
||||
ELSE
|
||||
Step := 10;
|
||||
END_IF
|
||||
10:
|
||||
IF bInCmdReady THEN
|
||||
IF In THEN
|
||||
rOutCmdNr := 8;
|
||||
ELSE
|
||||
rOutCmdNr := 9;
|
||||
END_IF
|
||||
bOutCmdReq := TRUE;
|
||||
Step := Step +1;
|
||||
END_IF
|
||||
11:
|
||||
IF bInCmdComplete THEN
|
||||
bOutCmdReq := FALSE;
|
||||
Step := Step +1;
|
||||
END_IF
|
||||
12:
|
||||
CASE rInCmdResult OF
|
||||
0:
|
||||
Step := 0;
|
||||
ELSE
|
||||
Step := 10;
|
||||
END_CASE
|
||||
100:
|
||||
RunMode := TRUE;
|
||||
Step := 0;
|
||||
END_CASE]]></ST>
|
||||
</Implementation>
|
||||
</Method>
|
||||
</POU>
|
||||
</TcPlcObject>
|
||||
Reference in New Issue
Block a user