Added minimal functionality for Robot teaching
- Added minimal HMI - Added possibility to open and close all chamber doors
This commit is contained in:
25
PLC/01_Stationen/Etcher/FB_Etcher.TcPOU
Normal file
25
PLC/01_Stationen/Etcher/FB_Etcher.TcPOU
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1">
|
||||
<POU Name="FB_Etcher" Id="{e75b6d70-36db-4c78-b78d-a594609441d1}" SpecialFunc="None">
|
||||
<Declaration><![CDATA[FUNCTION_BLOCK FB_Etcher
|
||||
VAR_INPUT
|
||||
xOpenDoor : BOOL;
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
END_VAR
|
||||
VAR
|
||||
_xOpenDoor AT %Q* : BOOL;
|
||||
_xCloseDoor AT %Q* : BOOL;
|
||||
END_VAR
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[IF xOpenDoor THEN
|
||||
_xOpenDoor := TRUE;
|
||||
_xCloseDoor := FALSE;
|
||||
ELSE
|
||||
_xOpenDoor := FALSE;
|
||||
_xCloseDoor := TRUE;
|
||||
END_IF]]></ST>
|
||||
</Implementation>
|
||||
</POU>
|
||||
</TcPlcObject>
|
||||
41
PLC/01_Stationen/HVTester/FB_HVTester.TcPOU
Normal file
41
PLC/01_Stationen/HVTester/FB_HVTester.TcPOU
Normal file
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1">
|
||||
<POU Name="FB_HVTester" Id="{63fd7fbb-2896-492c-ad94-827a20571a58}" SpecialFunc="None">
|
||||
<Declaration><![CDATA[FUNCTION_BLOCK FB_HVTester
|
||||
VAR_INPUT
|
||||
xOpenChambers : BOOL;
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
END_VAR
|
||||
VAR
|
||||
_xOpenDoor1 AT %Q* : BOOL;
|
||||
_xOpenDoor2 AT %Q* : BOOL;
|
||||
|
||||
_xCloseDoor1 AT %Q* : BOOL;
|
||||
_xCloseDoor2 AT %Q* : BOOL;
|
||||
|
||||
// Chamber is the big cylinder not the door
|
||||
_xOpenChamber1 AT %Q* : BOOL;
|
||||
_xOpenChamber2 AT %Q* : BOOL;
|
||||
|
||||
_xCloseChamber1 AT %Q* : BOOL;
|
||||
_xCloseChamber2 AT %Q* : BOOL;
|
||||
END_VAR
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[IF xOpenChambers THEN
|
||||
_xOpenDoor1 := TRUE;
|
||||
_xOpenDoor2 := TRUE;
|
||||
|
||||
_xCloseDoor1 := FALSE;
|
||||
_xCloseDoor2 := FALSE;
|
||||
ELSE
|
||||
_xOpenDoor1 := FALSE;
|
||||
_xOpenDoor2 := FALSE;
|
||||
|
||||
_xCloseDoor1 := TRUE;
|
||||
_xCloseDoor2 := TRUE;
|
||||
END_IF]]></ST>
|
||||
</Implementation>
|
||||
</POU>
|
||||
</TcPlcObject>
|
||||
@@ -1,17 +1,91 @@
|
||||
<?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
|
||||
<Declaration><![CDATA[FUNCTION_BLOCK FINAL FB_KukaRobot EXTENDS FB_Isa88_SM
|
||||
VAR_INPUT
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
END_VAR
|
||||
VAR
|
||||
_eState : E_Isa88_State;
|
||||
// 0 - Nicht aus
|
||||
// 1 - Enable
|
||||
// 2 - Enable move
|
||||
// 3 - Conf_Mess (Reset)
|
||||
_uCtrl AT %Q* : U_KukaRobot_Ctrl;
|
||||
|
||||
// 0 -> Robot job to do
|
||||
// 1 -> PLC job which is finished
|
||||
_uJobs AT %Q* : U_KukaRobot_Jobs;
|
||||
|
||||
// 0 - Greifer nummer
|
||||
// 1 - Drehteller Nummer
|
||||
// 2 - Position Heizplatte
|
||||
// 3 - Position Kuehlplatte
|
||||
_abToolsAndPositions AT %Q* : ARRAY[0..3] OF BYTE;
|
||||
|
||||
// Positions in um
|
||||
_diOffsetPosX AT %Q* : DINT;
|
||||
_diOffsetPosY AT %Q* : DINT;
|
||||
_diThickness AT %Q* : DINT;
|
||||
|
||||
// Inputs
|
||||
_uState AT %I* : U_KukaRobot_State;
|
||||
_dwErrorBits AT %I* : DWORD;
|
||||
_awJobStatesFromRobot AT %I* : ARRAY[0..1] OF WORD;
|
||||
_dwJobForPLC AT %I* : DWORD;
|
||||
|
||||
_abMirrorToolsAndPositions AT %I* : ARRAY[0..3] OF BYTE;
|
||||
|
||||
// Position mirrors
|
||||
_diMirrorOffsetPosX AT %I* : DINT;
|
||||
_diMirrorOffsetPosY AT %I* : DINT;
|
||||
_diMirrorThickness AT %I* : DINT;
|
||||
|
||||
// Motortemperaturen
|
||||
_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;
|
||||
|
||||
// Array indices for Job interface
|
||||
ROBOT_JOB : USINT := 0;
|
||||
PLC_JOB_FINISHED : USINT := 1;
|
||||
|
||||
// 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;
|
||||
END_VAR
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[]]></ST>
|
||||
<ST><![CDATA[// Positionen in um <=> 0.001mm
|
||||
|
||||
// Zur Sicherheit im T2 Zustand die Fahrfreigabe wegnehmen (da standardpasswort bleibt)
|
||||
|
||||
// Call isa88 base state machine
|
||||
SUPER^();]]></ST>
|
||||
</Implementation>
|
||||
<Method Name="M_StateIdle" Id="{025437ab-beb0-4ad6-bdc3-468dec599ff4}">
|
||||
<Declaration><![CDATA[METHOD M_StateIdle
|
||||
]]></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;
|
||||
|
||||
// Deselect all jobs and set plc finished job to none
|
||||
//_awJobs[ROBOT_JOB] := 0;
|
||||
//_awJobs[PLC_JOB_FINISHED] := 0;]]></ST>
|
||||
</Implementation>
|
||||
</Method>
|
||||
</POU>
|
||||
</TcPlcObject>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1">
|
||||
<DUT Name="ST_KukaRobot_Ctrl" Id="{6a4fb617-ed87-4838-8f9a-7e8618b6ad47}">
|
||||
<Declaration><![CDATA[{attribute 'pack_mode' := '0'}
|
||||
TYPE ST_KukaRobot_Ctrl :
|
||||
STRUCT
|
||||
bNotDisableAxes : BIT;
|
||||
bEnableAxes : BIT;
|
||||
bEnableMove : BIT;
|
||||
bConfMess : BIT;
|
||||
END_STRUCT
|
||||
END_TYPE
|
||||
]]></Declaration>
|
||||
</DUT>
|
||||
</TcPlcObject>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1">
|
||||
<DUT Name="ST_KukaRobot_Jobs" Id="{149a955f-b7c0-4993-9b33-a66606ed8bcd}">
|
||||
<Declaration><![CDATA[{attribute 'pack_mode' := '0'}
|
||||
TYPE ST_KukaRobot_Jobs :
|
||||
STRUCT
|
||||
wJobNrForRobot : WORD;
|
||||
wFinishedJobNrFromPlc : WORD;
|
||||
END_STRUCT
|
||||
END_TYPE
|
||||
]]></Declaration>
|
||||
</DUT>
|
||||
</TcPlcObject>
|
||||
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1">
|
||||
<DUT Name="ST_KukaRobot_State" Id="{a63ba4ed-f6ed-4d69-91eb-1236a87f0780}">
|
||||
<Declaration><![CDATA[{attribute 'pack_mode' := '0'}
|
||||
TYPE ST_KukaRobot_State :
|
||||
STRUCT
|
||||
bUserSAF : BIT;
|
||||
bAlarmStop : BIT;
|
||||
bPeriRdy : BIT;
|
||||
bIOActConf : BIT;
|
||||
bStopMess : BIT;
|
||||
bProAct : BIT;
|
||||
bDummy : BIT;
|
||||
bRobStopped : BIT;
|
||||
bInHome : BIT;
|
||||
bRCRdy1 : BIT;
|
||||
bT1 : BIT;
|
||||
bT2 : BIT;
|
||||
bAut : BIT;
|
||||
bExt : BIT;
|
||||
END_STRUCT
|
||||
END_TYPE
|
||||
]]></Declaration>
|
||||
</DUT>
|
||||
</TcPlcObject>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1">
|
||||
<DUT Name="U_KukaRobot_Ctrl" Id="{c0890327-8227-4b1a-8f53-5fe8dcabd304}">
|
||||
<Declaration><![CDATA[TYPE U_KukaRobot_Ctrl :
|
||||
UNION
|
||||
dwCtrl : DWORD;
|
||||
stCtrl : ST_KukaRobot_Ctrl;
|
||||
END_UNION
|
||||
END_TYPE
|
||||
]]></Declaration>
|
||||
</DUT>
|
||||
</TcPlcObject>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1">
|
||||
<DUT Name="U_KukaRobot_Jobs" Id="{590c2205-ccc7-4ffe-977e-f7594d299bfd}">
|
||||
<Declaration><![CDATA[TYPE U_KukaRobot_Jobs :
|
||||
UNION
|
||||
dwJobs : DWORD;
|
||||
stJobs : ST_KukaRobot_Jobs;
|
||||
END_UNION
|
||||
END_TYPE
|
||||
]]></Declaration>
|
||||
</DUT>
|
||||
</TcPlcObject>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1">
|
||||
<DUT Name="U_KukaRobot_State" Id="{955531d4-f458-4580-a2f2-ab760c7d37eb}">
|
||||
<Declaration><![CDATA[TYPE U_KukaRobot_State :
|
||||
UNION
|
||||
dwState : DWORD;
|
||||
stState : ST_KukaRobot_State;
|
||||
END_UNION
|
||||
END_TYPE
|
||||
]]></Declaration>
|
||||
</DUT>
|
||||
</TcPlcObject>
|
||||
@@ -1,28 +1,56 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1">
|
||||
<POU Name="FB_TrayFeeder" Id="{e2e3e993-37de-42b1-80e1-7dba99a66e94}" SpecialFunc="None">
|
||||
<Declaration><![CDATA[FUNCTION_BLOCK FINAL FB_TrayFeeder
|
||||
<Declaration><![CDATA[FUNCTION_BLOCK FINAL FB_TrayFeeder EXTENDS FB_Isa88_SM
|
||||
VAR_INPUT
|
||||
xExecute : BOOL;
|
||||
eCMD : E_Isa88_Cmd;
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
eCurrentState : E_Isa88_State;
|
||||
eCurrentCMD : E_Isa88_Cmd;
|
||||
END_VAR
|
||||
VAR
|
||||
_eState : E_Isa88_State;
|
||||
_fbTcpConnection : FB_ClientServerConnection;
|
||||
_sIpAddr : STRING;
|
||||
_udiPort : UDINT;
|
||||
END_VAR
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[CASE _eState OF
|
||||
E_Isa88_State.IDLE:
|
||||
;
|
||||
END_CASE
|
||||
<ST><![CDATA[// Call client server connection fb
|
||||
_fbTcpConnection(
|
||||
sSrvNetID:= '',
|
||||
nMode:= ,
|
||||
sRemoteHost:= _sIpAddr,
|
||||
nRemotePort:= ,
|
||||
bEnable:= ,
|
||||
tReconnect:= ,
|
||||
bBusy=> ,
|
||||
bError=> ,
|
||||
nErrId=> ,
|
||||
hSocket=> ,
|
||||
eState=> );
|
||||
|
||||
// Call isa88 base state machine
|
||||
SUPER^();
|
||||
|
||||
// IPs
|
||||
// 192.168.1.10
|
||||
// 192.168.1.11]]></ST>
|
||||
</Implementation>
|
||||
<Method Name="FB_init" Id="{6c7048d9-3836-4289-b5f3-f8878267494f}">
|
||||
<Declaration><![CDATA[//FB_Init ist immer implizit verfügbar und wird primär für die Initialisierung verwendet.
|
||||
//Der Rückgabewert wird nicht ausgewertet. Für gezielte Einflussnahme können Sie
|
||||
//die Methoden explizit deklarieren und darin mit dem Standard-Initialisierungscode
|
||||
//zusätzlichen Code bereitstellen. Sie können den Rückgabewert auswerten.
|
||||
METHOD FB_Init: BOOL
|
||||
VAR_INPUT
|
||||
bInitRetains: BOOL; // TRUE: Die Retain-Variablen werden initialisiert (Reset warm / Reset kalt)
|
||||
bInCopyCode: BOOL; // TRUE: Die Instanz wird danach in den Kopiercode kopiert (Online-Change)
|
||||
|
||||
sIPAddr : STRING;
|
||||
udiPort : UDINT;
|
||||
END_VAR]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[_sIpAddr := sIPAddr;
|
||||
_udiPort := udiPort;]]></ST>
|
||||
</Implementation>
|
||||
</Method>
|
||||
</POU>
|
||||
</TcPlcObject>
|
||||
Reference in New Issue
Block a user