Commit before reloading Keyence camera on Profinet
This commit is contained in:
@@ -8,31 +8,27 @@ VAR
|
||||
_fbEtcher1 : FB_Etcher;
|
||||
_fbEtcher2 : FB_Etcher;
|
||||
|
||||
_stRobotCmd : ST_PMLc;
|
||||
|
||||
_xConfirmAlarms : BOOL;
|
||||
|
||||
_stRobotCmd : ST_PMLc;
|
||||
_stRobotStatus : ST_PMLs;
|
||||
_stRobotAdmin : ST_PMLa;
|
||||
|
||||
_stRobotJobParams : ST_KukaRobot_JobParams;
|
||||
|
||||
|
||||
// DEBUG commands
|
||||
_xClear : BOOL;
|
||||
_xReset : BOOL;
|
||||
_xStart : BOOL;
|
||||
|
||||
_stRobotStatus : ST_PMLs;
|
||||
_stRobotAdmin : ST_PMLa;
|
||||
|
||||
_xFirstCycle : BOOL := TRUE;
|
||||
|
||||
_stRecipeGripperChange : ST_PackMLRecipe := (
|
||||
diID := 0,
|
||||
sName := 'Change gripper'
|
||||
);
|
||||
_xStartTrigger : BOOL;
|
||||
_tofTriggerTime : TOF := (PT := T#1S);
|
||||
_xTriggerCamera AT %Q* : BOOL;
|
||||
END_VAR
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[IF _xFirstCycle THEN
|
||||
_xFirstCycle := FALSE;
|
||||
END_IF
|
||||
|
||||
IF _xClear THEN
|
||||
<ST><![CDATA[IF _xClear THEN
|
||||
_xClear := FALSE;
|
||||
_stRobotCmd.eCntrlCmd := E_PackMLCmd.CLEAR;
|
||||
_stRobotCmd.xCmdChangeRequest := TRUE;
|
||||
@@ -52,6 +48,7 @@ END_IF
|
||||
|
||||
_fbRobot(
|
||||
stCommand:= _stRobotCmd,
|
||||
stJobParams := _stRobotJobParams,
|
||||
xReleaseAlarms:= TRUE,
|
||||
xConfirmAlarms:= _xConfirmAlarms,
|
||||
stStatus => _stRobotStatus,
|
||||
@@ -72,6 +69,16 @@ _fbEtcher2(xOpenDoor:= GVL_SCADA.xOpenAllChambers);
|
||||
// Call safety program
|
||||
PRG_Safety(xConfirmAlarms := GVL_SCADA.xErrAck);
|
||||
|
||||
// =====
|
||||
// DEBUG
|
||||
// =====
|
||||
|
||||
_tofTriggerTime(IN := _xStartTrigger);
|
||||
IF _xStartTrigger THEN
|
||||
_xStartTrigger := FALSE;
|
||||
END_IF
|
||||
_xTriggerCamera := _tofTriggerTime.Q;
|
||||
|
||||
// Reset alarm reset request
|
||||
GVL_SCADA.xErrAck := FALSE;
|
||||
|
||||
|
||||
@@ -4,7 +4,11 @@
|
||||
<Declaration><![CDATA[// Positionen in um <=> 0.001mm
|
||||
FUNCTION_BLOCK FINAL FB_KukaRobot EXTENDS FB_PackMLGeneric
|
||||
VAR_INPUT
|
||||
eRobotJob : E_KukaRobot_JobNumberRobot;
|
||||
stJobParams : ST_KukaRobot_JobParams;
|
||||
|
||||
// Feedbacks from other units
|
||||
// like if a door is open and such things
|
||||
stUnitFeedbacks : ST_KukaRobot_UnitFeedbacks;
|
||||
|
||||
xReleaseAlarms : BOOL;
|
||||
xConfirmAlarms : BOOL;
|
||||
@@ -52,13 +56,15 @@ VAR
|
||||
_asiMotorTemps1To4 AT %I* : ARRAY[0..3] OF SINT;
|
||||
_asiMotorTemps5To8 AT %I* : ARRAY[0..3] OF SINT;
|
||||
|
||||
_eRobotJob : E_KukaRobot_JobNumberRobot;
|
||||
_ePlcJob :E_KukaRobot_JobNumerPLC;
|
||||
|
||||
_xRobotReady : BOOL;
|
||||
|
||||
_xError : BOOL;
|
||||
|
||||
// Internal job params will be copied from input
|
||||
// only from IDLE -> STARTING
|
||||
_stJobParams : ST_KukaRobot_JobParams;
|
||||
|
||||
// ======
|
||||
// Alarms
|
||||
@@ -139,12 +145,11 @@ IF _uState.stState.bT2 THEN
|
||||
END_IF
|
||||
|
||||
|
||||
// ==================
|
||||
// Write job outputs
|
||||
// ==================
|
||||
// ============================
|
||||
// Write unit feedbacks outputs
|
||||
// ============================
|
||||
|
||||
|
||||
//_uJobs.stJobs.wJobNrForRobot := _eRobotJob;
|
||||
//_uJobs.stJobs.wFinishedJobNrFromPlc := _ePlcJob;
|
||||
|
||||
|
||||
// =================
|
||||
@@ -236,8 +241,7 @@ END_IF]]></ST>
|
||||
<Declaration><![CDATA[METHOD M_Idle
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[
|
||||
]]></ST>
|
||||
<ST><![CDATA[_stJobParams := stJobParams;]]></ST>
|
||||
</Implementation>
|
||||
</Method>
|
||||
<Method Name="M_Resetting" Id="{dfe4d36a-80aa-4364-bfd8-6ddd41636d59}">
|
||||
@@ -309,29 +313,103 @@ END_CASE]]></ST>
|
||||
</Method>
|
||||
<Method Name="M_Starting" Id="{011f85d8-1225-4288-876f-918df6e4f235}">
|
||||
<Declaration><![CDATA[METHOD M_Starting
|
||||
]]></Declaration>
|
||||
VAR_INST
|
||||
_tonTimeout : TON;
|
||||
END_VAR]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[// Write robot job number
|
||||
_uJobs.stJobs.wJobNrForRobot := DINT_TO_WORD(_stRecipe.stProcessVariables.astParameterDInt[0].Value);
|
||||
<ST><![CDATA[CASE _iSSM OF
|
||||
// Check job parameters
|
||||
0:
|
||||
IF (_stJobParams.byGripperNumber < 0) OR (_stJobParams.byGripperNumber > 3) // Wrong gripper number
|
||||
OR (_stJobParams.byChuckNumber < 1) OR (_stJobParams.byChuckNumber > 6) // Wrong chuck number
|
||||
OR (_stJobParams.byGripperSide < 1) OR (_stJobParams.byGripperSide > 2) // Wrong gripper side
|
||||
THEN
|
||||
_eCmd := E_PackMLCmd.ABORT;
|
||||
ELSE
|
||||
_iSSM := 10;
|
||||
END_IF
|
||||
|
||||
// Transfer job data to robot
|
||||
10:
|
||||
// Pos x in um
|
||||
_diOffsetPosX := REAL_TO_DINT(_stJobParams.rPosX * 1000);
|
||||
|
||||
// Pos y in um
|
||||
_diOffsetPosY := REAL_TO_DINT(_stJobParams.rPosY * 1000);
|
||||
|
||||
// Thickness
|
||||
_diThickness := REAL_TO_DINT(_stJobParams.rThickness * 1000);
|
||||
|
||||
// Gripper side
|
||||
IF _stJobParams.byGripperSide = 1 THEN
|
||||
_uCtrl.stCtrl.bGripperSide1 := 1;
|
||||
_uCtrl.stCtrl.bGripperSide2 := 0;
|
||||
ELSIF _stJobParams.byGripperSide = 2 THEN
|
||||
_uCtrl.stCtrl.bGripperSide1 := 0;
|
||||
_uCtrl.stCtrl.bGripperSide2 := 1;
|
||||
ELSE
|
||||
_uCtrl.stCtrl.bGripperSide1 := 0;
|
||||
_uCtrl.stCtrl.bGripperSide2 := 0;
|
||||
END_IF
|
||||
|
||||
// Scan QR code
|
||||
IF stJobParams.xScanQRCode THEN
|
||||
_uCtrl.stCtrl.bScanQRCode := 1;
|
||||
ELSE
|
||||
_uCtrl.stCtrl.bScanQRCode := 0;
|
||||
END_IF
|
||||
|
||||
// Gripper number
|
||||
_abToolsAndPositions[0] := DINT_TO_BYTE(_stRecipe.stProcessVariables.astParameterDInt[1].Value);
|
||||
// Position on hotplate
|
||||
_abToolsAndPositions[2] := stJobParams.byPlaceOnHotplate;
|
||||
|
||||
// Position on coolplate
|
||||
_abToolsAndPositions[3] := stJobParams.byPlaceOnCoolPlate;
|
||||
|
||||
// Gripper number
|
||||
_abToolsAndPositions[0] := stJobParams.byGripperNumber;
|
||||
|
||||
// Chuck for etcher to load
|
||||
_abToolsAndPositions[1] := stJobParams.byChuckNumber;
|
||||
|
||||
// Write robot job number
|
||||
_uJobs.stJobs.wJobNrForRobot := DINT_TO_WORD(_stJobParams.eJob);
|
||||
|
||||
// Safety reset timout fb
|
||||
_tonTimeout(IN := FALSE);
|
||||
|
||||
_iSSM := 20;
|
||||
|
||||
// Wait for robot program start
|
||||
20:
|
||||
_tonTimeout(IN := TRUE, PT := T#5S);
|
||||
|
||||
// If job number is read back correct, go to next state
|
||||
IF _awJobStatesFromRobot[0] = _uJobs.stJobs.wJobNrForRobot THEN
|
||||
_uJobs.stJobs.wJobNrForRobot := E_KukaRobot_JobNumberRobot.NO_JOB;
|
||||
_tonTimeout(IN := FALSE);
|
||||
M_StateComplete();
|
||||
END_IF
|
||||
|
||||
// Timeout occured
|
||||
IF _tonTimeout.Q THEN
|
||||
_tonTimeout(IN := FALSE);
|
||||
_eCmd := E_PackMLCmd.ABORT;
|
||||
END_IF
|
||||
|
||||
// Robot has error
|
||||
IF _dwErrorBits <> 0 THEN
|
||||
_tonTimeout(IN := FALSE);
|
||||
_eCmd := E_PackMLCmd.ABORT;
|
||||
END_IF
|
||||
END_CASE
|
||||
|
||||
// If job number is read back correct, go to next state
|
||||
IF _awJobStatesFromRobot[0] = _uJobs.stJobs.wJobNrForRobot THEN
|
||||
_uJobs.stJobs.wJobNrForRobot := E_KukaRobot_JobNumberRobot.NO_JOB;
|
||||
M_StateComplete();
|
||||
END_IF
|
||||
|
||||
// Wrong job read back from robot -> Abort
|
||||
// IF _awJobStatesFromRobot[0] <> 0 AND _awJobStatesFromRobot[0] <> E_KukaRobot_JobNumberRobot.WARMUP THEN
|
||||
// _eCmd := E_PackMLCmd.ABORT;
|
||||
// END_IF
|
||||
//
|
||||
// // Robot has error
|
||||
// IF _dwErrorBits <> 0 THEN
|
||||
// _eCmd := E_PackMLCmd.ABORT;
|
||||
// END_IF]]></ST>
|
||||
]]></ST>
|
||||
</Implementation>
|
||||
</Method>
|
||||
<Method Name="M_Stopped" Id="{50813767-4bd7-4147-b5dc-1bbd18ae1555}">
|
||||
@@ -343,7 +421,7 @@ _uCtrl.stCtrl.bEnableAxes := 0;
|
||||
_uCtrl.stCtrl.bNotDisableAxes := 1;
|
||||
_uCtrl.stCtrl.bExtStart := 0;
|
||||
|
||||
_eRobotJob := E_KukaRobot_JobNumberRobot.NO_JOB;
|
||||
_uJobs.stJobs.wJobNrForRobot := E_KukaRobot_JobNumberRobot.NO_JOB;
|
||||
_ePlcJob := E_KukaRobot_JobNumerPLC.NO_JOB;]]></ST>
|
||||
</Implementation>
|
||||
</Method>
|
||||
|
||||
@@ -28,6 +28,25 @@ STRUCT
|
||||
// Abort job with rising edge
|
||||
bAbortJob : BIT;
|
||||
|
||||
// Scan qr code
|
||||
bScanQRCode : BIT;
|
||||
|
||||
// Dummy bits
|
||||
bDummy5 : BIT;
|
||||
bDummy6 : BIT;
|
||||
bDummy7 : BIT;
|
||||
bDummy8 : BIT;
|
||||
bDummy9 : BIT;
|
||||
|
||||
bGripperSide1 : BIT;
|
||||
bGripperSide2 : BIT;
|
||||
|
||||
bDummy10 : BIT;
|
||||
|
||||
bDoorEtcher1Open : BIT;
|
||||
bDoorEtcher2Open : BIT;
|
||||
bDoorHVTestHotOpen : BIT;
|
||||
bDoorHVTestColdOpen : BIT;
|
||||
END_STRUCT
|
||||
END_TYPE
|
||||
]]></Declaration>
|
||||
|
||||
39
PLC/01_Stationen/Kuka_Robot/ST_KukaRobot_JobParams.TcDUT
Normal file
39
PLC/01_Stationen/Kuka_Robot/ST_KukaRobot_JobParams.TcDUT
Normal file
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1">
|
||||
<DUT Name="ST_KukaRobot_JobParams" Id="{2332c64b-5fcf-4fc7-9272-3ad3ef2767d3}">
|
||||
<Declaration><![CDATA[TYPE ST_KukaRobot_JobParams :
|
||||
STRUCT
|
||||
// Robot job number
|
||||
eJob : E_KukaRobot_JobNumberRobot;
|
||||
|
||||
// Position in x in mm
|
||||
rPosX : REAL;
|
||||
|
||||
// Position in y in mm
|
||||
rPosY : REAL;
|
||||
|
||||
// Substrate thickness in mm
|
||||
rThickness : REAL;
|
||||
|
||||
// Gripper side (1 or 2)
|
||||
byGripperSide : BYTE;
|
||||
|
||||
// Scan QR Code during pickup from loading station
|
||||
xScanQRCode : BOOL;
|
||||
|
||||
// Position on hotplate (1-9)
|
||||
byPlaceOnHotplate : BYTE;
|
||||
|
||||
// Position on coolplate (1-9)
|
||||
byPlaceOnCoolPlate : BYTE;
|
||||
|
||||
// Gripper tool number (0-3)
|
||||
byGripperNumber : BYTE;
|
||||
|
||||
// Chuck for etcher to load (1-6)
|
||||
byChuckNumber : BYTE;
|
||||
END_STRUCT
|
||||
END_TYPE
|
||||
]]></Declaration>
|
||||
</DUT>
|
||||
</TcPlcObject>
|
||||
14
PLC/01_Stationen/Kuka_Robot/ST_KukaRobot_UnitFeedbacks.TcDUT
Normal file
14
PLC/01_Stationen/Kuka_Robot/ST_KukaRobot_UnitFeedbacks.TcDUT
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1">
|
||||
<DUT Name="ST_KukaRobot_UnitFeedbacks" Id="{d247890a-fdb7-498e-85a5-2423833e65fc}">
|
||||
<Declaration><![CDATA[TYPE ST_KukaRobot_UnitFeedbacks :
|
||||
STRUCT
|
||||
xDoorEthcher1Open : BOOL;
|
||||
xDoorEther2Open : BOOL;
|
||||
xDoorHVTestHotOpen : BOOL;
|
||||
xDoorHVTestColdOpen : BOOL;
|
||||
END_STRUCT
|
||||
END_TYPE
|
||||
]]></Declaration>
|
||||
</DUT>
|
||||
</TcPlcObject>
|
||||
@@ -9,7 +9,7 @@
|
||||
<WriteProductVersion>false</WriteProductVersion>
|
||||
<GenerateTpy>false</GenerateTpy>
|
||||
<Name>PLC</Name>
|
||||
<ProgramVersion>3.1.4026.19</ProgramVersion>
|
||||
<ProgramVersion>3.1.4026.20</ProgramVersion>
|
||||
<WriteBookmarksToFile>true</WriteBookmarksToFile>
|
||||
<Application>{504e694b-aca9-4a4a-af71-0bcb7e8cc6f1}</Application>
|
||||
<TypeSystem>{ca7afa57-b1d9-4c28-bd68-15ebf02c76f4}</TypeSystem>
|
||||
@@ -60,6 +60,12 @@
|
||||
<Compile Include="01_Stationen\Kuka_Robot\InterfaceUnions\U_KukaRobot_Ctrl.TcDUT">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="01_Stationen\Kuka_Robot\ST_KukaRobot_JobParams.TcDUT">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="01_Stationen\Kuka_Robot\ST_KukaRobot_UnitFeedbacks.TcDUT">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="01_Stationen\TrayFeeder\FB_TrayFeeder.TcPOU">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
@@ -297,6 +303,12 @@
|
||||
<v>410,5410</v>
|
||||
</d>
|
||||
</o>
|
||||
<v>{eeeeeeee-3909-4298-8022-501ac3238667}</v>
|
||||
<o>
|
||||
<v n="Name">"{eeeeeeee-3909-4298-8022-501ac3238667}"</v>
|
||||
<d n="SubKeys" t="Hashtable" />
|
||||
<d n="Values" t="Hashtable" />
|
||||
</o>
|
||||
<v>{F66C7017-BDD8-4114-926C-81D6D687E35F}</v>
|
||||
<o>
|
||||
<v n="Name">"{F66C7017-BDD8-4114-926C-81D6D687E35F}"</v>
|
||||
|
||||
36
PLC/PLC.tmc
36
PLC/PLC.tmc
File diff suppressed because one or more lines are too long
@@ -2,7 +2,7 @@
|
||||
<TcPlcObject Version="1.1.0.1">
|
||||
<Task Name="PlcTask" Id="{023d9255-c87e-4da8-8cda-8bd3501e3aa4}">
|
||||
<!--CycleTime in micro seconds.-->
|
||||
<CycleTime>10000</CycleTime>
|
||||
<CycleTime>8000</CycleTime>
|
||||
<Priority>20</Priority>
|
||||
<PouCall>
|
||||
<Name>PRG_Main</Name>
|
||||
|
||||
Reference in New Issue
Block a user