Changed from ISA88 to PackML
- Added PackML Base FB's - Added Unit Tests for PackML Base State Machine - Added Robot job numbers according to new interface - Added PLC job number for robot to call according to new interface - Change Robot to PackML interface
This commit is contained in:
67
PLC/01_Stationen/Kuka_Robot/E_KukaRobot_JobNumberRobot.TcDUT
Normal file
67
PLC/01_Stationen/Kuka_Robot/E_KukaRobot_JobNumberRobot.TcDUT
Normal file
@@ -0,0 +1,67 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1">
|
||||
<DUT Name="E_KukaRobot_JobNumberRobot" Id="{088c6121-55a8-439f-a5d4-6dc132a46dc5}">
|
||||
<Declaration><![CDATA[{attribute 'qualified_only'}
|
||||
{attribute 'strict'}
|
||||
{attribute 'to_string'}
|
||||
TYPE E_KukaRobot_JobNumberRobot :
|
||||
(
|
||||
// No job
|
||||
NO_JOB := 0,
|
||||
|
||||
// Tray feeder input station
|
||||
GET_FROM_INPUT := 10,
|
||||
|
||||
// Tray feeder output station
|
||||
PUT_TO_OUTPUT := 11,
|
||||
|
||||
// Aligner station
|
||||
PUT_INTO_ALIGNER := 15,
|
||||
GET_FROM_ALIGNER := 16,
|
||||
|
||||
// Etcher 1 station
|
||||
PUT_INTO_ETCHER1 := 20,
|
||||
GET_FROM_ETCHER1 := 22,
|
||||
GET_AND_PUT_ETCHER1 := 24,
|
||||
|
||||
// Etcher 2 station
|
||||
PUT_INTO_ETCHER2 := 21,
|
||||
GET_GROM_ETCHER2 := 23,
|
||||
GET_AND_PUT_ETCHER2 := 25,
|
||||
|
||||
// HV test station (1 - Hot, 2 - Cold)
|
||||
PUT_HV1 := 30,
|
||||
GET_HV1 := 32,
|
||||
GET_AND_PUT_HV1 := 34,
|
||||
|
||||
PUT_HV2 := 31,
|
||||
GET_HV2 := 33,
|
||||
GET_AND_PUT_HV2 := 35,
|
||||
|
||||
// Heating station
|
||||
PUT_HOT_PLATE := 40,
|
||||
GET_HOT_PLATE := 41,
|
||||
|
||||
// Cooling station
|
||||
PUT_COOL_PLATE := 42,
|
||||
GET_COOL_PLATE := 43,
|
||||
|
||||
// NIO station
|
||||
PUT_INTO_NIO := 70,
|
||||
GET_FROM_NIO := 71,
|
||||
|
||||
// Tool change robot gripper
|
||||
CHANGE_GRIPPER := 50,
|
||||
|
||||
// Tool change etchers
|
||||
GET_CHUCK_ETCHER1 := 60,
|
||||
GET_CHUCK_ETCHER2 := 61,
|
||||
PUT_CHUCK_ETCHER1 := 62,
|
||||
PUT_CHUCK_ETCHER2 := 63,
|
||||
PUT_CHUCK_INTO_MAGAZINE := 64,
|
||||
GET_CHUCK_FROM_MAGAZINE := 65
|
||||
) WORD := NO_JOB;
|
||||
END_TYPE
|
||||
]]></Declaration>
|
||||
</DUT>
|
||||
</TcPlcObject>
|
||||
31
PLC/01_Stationen/Kuka_Robot/E_KukaRobot_JobNumerPLC.TcDUT
Normal file
31
PLC/01_Stationen/Kuka_Robot/E_KukaRobot_JobNumerPLC.TcDUT
Normal file
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1">
|
||||
<DUT Name="E_KukaRobot_JobNumerPLC" Id="{42772339-3817-41dd-ac6e-f6eea439266e}">
|
||||
<Declaration><![CDATA[{attribute 'qualified_only'}
|
||||
{attribute 'strict'}
|
||||
{attribute 'to_string'}
|
||||
TYPE E_KukaRobot_JobNumerPLC :
|
||||
(
|
||||
// No job
|
||||
NO_JOB := 0,
|
||||
|
||||
// Aligner station
|
||||
ENABLE_VACUUM_ALIGNER := 15,
|
||||
DISABLE_VACUUM_ALIGNER := 16,
|
||||
|
||||
// Etcher 1 station
|
||||
ENABLE_VACUUM_ETCHER1 := 20,
|
||||
DISABLE_VACUUM_ETHER1 := 22,
|
||||
UNLOCK_CHUCK_ETCHER1 := 60,
|
||||
LOCK_CHUCK_ETCHER1 := 62,
|
||||
|
||||
// Ether 2 station
|
||||
ENABLE_VACUUM_ETCHER2 := 21,
|
||||
DISABLE_VACUUM_ETCHER2 := 23,
|
||||
UNLOCK_CHUCK_ETHCER2 := 61,
|
||||
LOCK_CHUCK_ETCHER2 := 63
|
||||
) WORD := NO_JOB;
|
||||
END_TYPE
|
||||
]]></Declaration>
|
||||
</DUT>
|
||||
</TcPlcObject>
|
||||
@@ -1,10 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1">
|
||||
<POU Name="FB_KukaRobot" Id="{6ca3e82a-4047-4132-872d-1f49057f08d6}" SpecialFunc="None">
|
||||
<Declaration><![CDATA[FUNCTION_BLOCK FINAL FB_KukaRobot EXTENDS FB_Isa88_SM
|
||||
<Declaration><![CDATA[// Positionen in um <=> 0.001mm
|
||||
FUNCTION_BLOCK FINAL FB_KukaRobot EXTENDS FB_PackMLGeneric
|
||||
VAR_INPUT
|
||||
xConfirmAlarms : BOOL;
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
xReady : BOOL;
|
||||
xError : BOOL;
|
||||
END_VAR
|
||||
VAR
|
||||
// 0 - Nicht aus
|
||||
@@ -45,46 +49,106 @@ VAR
|
||||
_asiMotorTemps1To4 AT %I* : ARRAY[0..3] OF SINT;
|
||||
_asiMotorTemps5To8 AT %I* : ARRAY[0..3] OF SINT;
|
||||
|
||||
END_VAR
|
||||
VAR CONSTANT
|
||||
// Bit indices for robot interface
|
||||
NOT_DISABLE_AXES : USINT := 0;
|
||||
ENABLE_AXES : USINT := 1;
|
||||
ENABLE_MOVE : USINT := 2;
|
||||
CONF_MESS : USINT := 3;
|
||||
_eRobotJob : E_KukaRobot_JobNumberRobot;
|
||||
_ePlcJob :E_KukaRobot_JobNumerPLC;
|
||||
|
||||
// Array indices for Job interface
|
||||
ROBOT_JOB : USINT := 0;
|
||||
PLC_JOB_FINISHED : USINT := 1;
|
||||
_xRobotReady : BOOL;
|
||||
|
||||
// Array indices for tools and plate positions
|
||||
GRIPPER_NR : USINT := 0;
|
||||
TURN_TABLE_NR : USINT := 1;
|
||||
HEATING_PLATE_POS : USINT := 2;
|
||||
COOLING_PLATE_POS : USINT := 3;
|
||||
_xError : BOOL;
|
||||
|
||||
// ======
|
||||
// Alarms
|
||||
// ======
|
||||
|
||||
_fbAlarmNotInExtMode : FB_AlarmMessage(stEventEntry := TC_EVENTS.RobotEvents.RobotNotInExtMode, xWithConfirmation := FALSE);
|
||||
_fbAlarmEStopActive : FB_AlarmMessage(stEventEntry := TC_EVENTS.RobotEvents.RobotEStopActive, xWithConfirmation := FALSE);
|
||||
_fbAlarmOperatorSafetyNotOk : FB_AlarmMessage(stEventEntry := TC_EVENTS.RobotEvents.OperatorSafetyNotOk, xWithConfirmation := FALSE);
|
||||
END_VAR
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[// Positionen in um <=> 0.001mm
|
||||
<ST><![CDATA[// =============
|
||||
// Handle alarms
|
||||
// =============
|
||||
|
||||
// Zur Sicherheit im T2 Zustand die Fahrfreigabe wegnehmen (da standardpasswort bleibt)
|
||||
_fbAlarmNotInExtMode(
|
||||
xActive:= (NOT _uState.stState.bExt),
|
||||
xRelease:= TRUE,
|
||||
xAcknowledge:= xConfirmAlarms,
|
||||
timOnDelay:= T#0S,
|
||||
timOffDelay:= T#0S);
|
||||
|
||||
_fbAlarmEStopActive(
|
||||
xActive:= (NOT _uState.stState.bAlarmStop),
|
||||
xRelease:= TRUE,
|
||||
xAcknowledge:= xConfirmAlarms,
|
||||
timOnDelay:= T#0S,
|
||||
timOffDelay:= T#0S);
|
||||
|
||||
_fbAlarmOperatorSafetyNotOk(
|
||||
xActive:= (NOT _uState.stState.bUserSAF),
|
||||
xRelease:= TRUE,
|
||||
xAcknowledge:= xConfirmAlarms,
|
||||
timOnDelay:= T#0S,
|
||||
timOffDelay:= T#0S);
|
||||
|
||||
|
||||
// =======================
|
||||
// Check if robot is ready
|
||||
// =======================
|
||||
|
||||
_xRobotReady := _uState.stState.bExt
|
||||
AND _uState.stState.bAlarmStop
|
||||
AND _uState.stState.bUserSAF
|
||||
AND _uState.stState.bPeriRdy
|
||||
AND _uState.stState.bIOActConf
|
||||
AND (NOT _uState.stState.bStopMess);
|
||||
|
||||
|
||||
// =============================
|
||||
// Call isa88 base state machine
|
||||
SUPER^();]]></ST>
|
||||
// =============================
|
||||
SUPER^();
|
||||
|
||||
|
||||
// ==============================
|
||||
// Handle general control outputs
|
||||
// ==============================
|
||||
|
||||
// Allow robot to be moved with programming pendant
|
||||
_uCtrl.stCtrl.bNotDisableAxes := 1;
|
||||
|
||||
// Disable move if in T2 for safety reasons
|
||||
IF (NOT _uState.stState.bT2) THEN
|
||||
_uCtrl.stCtrl.bEnableMove := 1;
|
||||
ELSE
|
||||
_uCtrl.stCtrl.bEnableMove := 0;
|
||||
END_IF
|
||||
|
||||
|
||||
// ==================
|
||||
// Write job outputs
|
||||
// ==================
|
||||
|
||||
_uJobs.stJobs.wJobNrForRobot := _eRobotJob;
|
||||
_uJobs.stJobs.wFinishedJobNrFromPlc := _ePlcJob;
|
||||
|
||||
|
||||
// =================
|
||||
// Write fb outputs
|
||||
// =================
|
||||
|
||||
xReady := _xRobotReady;
|
||||
xError := _xError;]]></ST>
|
||||
</Implementation>
|
||||
<Method Name="M_StateIdle" Id="{025437ab-beb0-4ad6-bdc3-468dec599ff4}">
|
||||
<Declaration><![CDATA[METHOD M_StateIdle
|
||||
<Method Name="M_Idle" Id="{025437ab-beb0-4ad6-bdc3-468dec599ff4}">
|
||||
<Declaration><![CDATA[METHOD M_Idle
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[// Allow robot to be moved with programming pendant
|
||||
_uCtrl.stCtrl.bNotDisableAxes := 1;
|
||||
_uCtrl.stCtrl.bEnableAxes := 1;
|
||||
_uCtrl.stCtrl.bEnableMove := 1;
|
||||
_uCtrl.stCtrl.bConfMess := 0;
|
||||
<ST><![CDATA[_uCtrl.stCtrl.bConfMess := 0;
|
||||
|
||||
// Deselect all jobs and set plc finished job to none
|
||||
//_awJobs[ROBOT_JOB] := 0;
|
||||
//_awJobs[PLC_JOB_FINISHED] := 0;]]></ST>
|
||||
_eRobotJob := E_KukaRobot_JobNumberRobot.NO_JOB;
|
||||
_ePlcJob := E_KukaRobot_JobNumerPLC.NO_JOB;
|
||||
]]></ST>
|
||||
</Implementation>
|
||||
</Method>
|
||||
</POU>
|
||||
|
||||
@@ -4,9 +4,16 @@
|
||||
<Declaration><![CDATA[{attribute 'pack_mode' := '0'}
|
||||
TYPE ST_KukaRobot_Ctrl :
|
||||
STRUCT
|
||||
// DRIVES_OFF
|
||||
bNotDisableAxes : BIT;
|
||||
|
||||
// DRIVES_ON
|
||||
bEnableAxes : BIT;
|
||||
|
||||
// MOVE_ENABLE
|
||||
bEnableMove : BIT;
|
||||
|
||||
// CONF_MESS
|
||||
bConfMess : BIT;
|
||||
END_STRUCT
|
||||
END_TYPE
|
||||
|
||||
Reference in New Issue
Block a user