Aligner ======= - Fixed Aligner during resetting with library update to 1.3.4 - Added Vacuum valve to HMI Etcher ====== - Added Vacuum valve to HMI TrayFeeder ========== - Fixed a bug in protocoll parsing - Added automatic reconnect tries to protocoll handler - Added buttons to hmi interface for tray feeding and unloading
452 lines
12 KiB
XML
452 lines
12 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<TcPlcObject Version="1.1.0.1">
|
|
<POU Name="PRG_Main" Id="{e44f5145-cb67-4abd-8a28-92b41a0d9dbd}" SpecialFunc="None">
|
|
<Declaration><![CDATA[PROGRAM PRG_Main
|
|
VAR
|
|
// ========
|
|
// Stations
|
|
// ========
|
|
|
|
_fbRobot : FB_KukaRobot;
|
|
|
|
_fbTrayFeederInput : FB_TrayFeeder(sIPAddr := '192.168.1.10', udiPort := 5000);
|
|
_fbTrayFeederOutput : FB_TrayFeeder(sIPAddr := '192.168.1.11', udiPort := 5000);
|
|
_fbAligner : FB_Aligner;
|
|
_fbEtcher1 : FB_Etcher;
|
|
_fbEtcher2 : FB_Etcher;
|
|
_fbHotplate : FB_Hotplate;
|
|
_fbCoolplate : FB_Coolplate;
|
|
_fbHVTesterHot : FB_HVTester;
|
|
_fbHVTesterCold : FB_HVTester;
|
|
_fbMediaCabinet : FB_MediaCabinet;
|
|
|
|
_fbModbusMaster : FB_ModbusMaster;
|
|
_fbFlowSensor : FB_Levi_LFC6IO;
|
|
//_fbInput : FB_Input;
|
|
//_fbNOK : FB_NOK;
|
|
//_fbTrayFeederOutput : FB_TrayFeeder(sIPAddr := '192.168.1.11', udiPort := 5000);
|
|
|
|
|
|
// =======================
|
|
// DEBUG AND TESTING STUFF
|
|
// =======================
|
|
_xReadFullScale : BOOL;
|
|
|
|
_xReleaseAlarms : BOOL;
|
|
_stRobotCmd : ST_PMLc;
|
|
_stRobotStatus : ST_PMLs;
|
|
_stRobotAdmin : ST_PMLa;
|
|
_stRobotJobParams : ST_KukaRobot_JobParams;
|
|
_stUnitFeedbacks : ST_KukaRobot_UnitFeedbacks;
|
|
stCamResult AT %I* : ST_TrayFeederCamPosData;
|
|
_rtStopRobotFromSafety : R_TRIG;
|
|
|
|
_xStartCycle : BOOL;
|
|
|
|
_xStartTrigger : BOOL;
|
|
_tofTriggerTime : TOF;
|
|
xTriggerCamera AT %Q* : BOOL;
|
|
|
|
_xTRiggeredEV : BOOL;
|
|
_xTRiggerDV : BOOL;
|
|
|
|
_iState : INT;
|
|
END_VAR
|
|
]]></Declaration>
|
|
<Implementation>
|
|
<ST><![CDATA[// Data from safety
|
|
_xReleaseAlarms := PRG_Safety.xEStopOk;
|
|
|
|
_rtStopRobotFromSafety(CLK := PRG_Safety.xStopRobot);
|
|
IF _rtStopRobotFromSafety.Q THEN
|
|
_stRobotCmd.eCntrlCmd := E_PackMLCmd.STOP;
|
|
_stRobotCmd.xCmdChangeRequest := TRUE;
|
|
END_IF
|
|
|
|
// Unit feedbacks for the robot
|
|
_stUnitFeedbacks.xDoorEtcher1Open := _fbEtcher1.xDoorOpen;
|
|
_stUnitFeedbacks.xDoorEtcher2Open := _fbEtcher2.xDoorOpen;
|
|
_stUnitFeedbacks.xDoorHVTestHotOpen := _fbHVTesterHot.xDoorOpen AND _fbHVTesterHot.xTestChamberOpen;
|
|
_stUnitFeedbacks.xDoorHVTestColdOpen := _fbHVTesterCold.xDoorOpen AND _fbHVTesterCold.xTestChamberOpen;
|
|
|
|
_fbRobot(
|
|
stCommand:= _stRobotCmd,
|
|
stJobParams := _stRobotJobParams,
|
|
stUnitFeedbacks := _stUnitFeedbacks,
|
|
xReleaseAlarms:= _xReleaseAlarms,
|
|
xConfirmAlarms:= GVL_SCADA.stMachine.stConfirmAlarmsBtn.xRequest,
|
|
stStatus => _stRobotStatus,
|
|
stAdmin => _stRobotAdmin,
|
|
stHMIInterface := GVL_SCADA.stMachine.stKukaRobot);
|
|
|
|
IF _stRobotCmd.xCmdChangeRequest THEN
|
|
_stRobotCmd.xCmdChangeRequest := FALSE;
|
|
END_IF
|
|
|
|
_fbHVTesterHot(xOpenChambers:= GVL_SCADA.xOpenAllChambers, stHMIInterface := GVL_SCADA.stMachine.stHVTesterHot);
|
|
|
|
_fbHVTesterCold(xOpenChambers:= GVL_SCADA.xOpenAllChambers, stHMIInterface := GVL_SCADA.stMachine.stHVTesterCold);
|
|
|
|
_fbEtcher1(
|
|
xOpenDoor:= GVL_SCADA.xOpenAllChambers,
|
|
xOpenChuckClamp := GVL_SCADA.xOpenChuckClampEtcher1,
|
|
xReleaseAlarms := _xReleaseAlarms,
|
|
xConfirmAlarms := GVL_SCADA.stMachine.stConfirmAlarmsBtn.xRequest,
|
|
stHMIInterface := GVL_SCADA.stMachine.stEtcher1);
|
|
|
|
_fbEtcher2(
|
|
xOpenDoor:= GVL_SCADA.xOpenAllChambers,
|
|
xOpenChuckClamp := GVL_SCADA.xOpenChuckClampEtcher2,
|
|
xReleaseAlarms := _xReleaseAlarms,
|
|
xConfirmAlarms := GVL_SCADA.stMachine.stConfirmAlarmsBtn.xRequest,
|
|
stHMIInterface := GVL_SCADA.stMachine.stEtcher2);
|
|
|
|
_fbTrayFeederInput(
|
|
stCommand:= ,
|
|
xReleaseAlarms := _xReleaseAlarms,
|
|
xConfirmAlarms := GVL_SCADA.stMachine.stConfirmAlarmsBtn.xRequest,
|
|
stHMIInterface := GVL_SCADA.stMachine.stTrayFeederIn);
|
|
|
|
_fbTrayFeederOutput(
|
|
xReleaseAlarms := _xReleaseAlarms,
|
|
xConfirmAlarms := GVL_SCADA.stMachine.stConfirmAlarmsBtn.xRequest,
|
|
stHMIInterface := GVL_SCADA.stMachine.stTrayFeederOut);
|
|
|
|
// _fbTrayFeederOut(
|
|
// stCommand:= ,
|
|
// xReleaseAlarms := _xReleaseAlarms,
|
|
// xConfirmAlarms := GVL_SCADA.stMachine.stConfirmAlarmsBtn.xRequest,
|
|
// stStatus=> GVL_SCADA.stTrayFeederInputState,
|
|
// stAdmin=> GVL_SCADA.stTRayFeederInputAdmin,
|
|
// stHMIInterface := GVL_SCADA.stMachine.stTrayFeederOut);
|
|
|
|
_fbHotplate(stHMIInterface := GVL_SCADA.stMachine.stHotplate);
|
|
|
|
_fbCoolplate(stHMIInterface := GVL_SCADA.stMachine.stCoolplate);
|
|
|
|
_fbAligner(stCommand:= , stStatus=> , stAdmin=> , xConfirmAlarms:= GVL_SCADA.stMachine.stConfirmAlarmsBtn.xRequest, stHMIInterface := GVL_SCADA.stMachine.stAligner);
|
|
|
|
_fbMediaCabinet(
|
|
xReleaseManualMode := TRUE,
|
|
xReleaseErrors := _xReleaseAlarms,
|
|
xConfirmAlarms := GVL_SCADA.stMachine.stConfirmAlarmsBtn.xRequest,
|
|
stHMIInterface := GVL_SCADA.stMachine.stMediaCabinet);
|
|
|
|
|
|
// Call safety program
|
|
PRG_Safety(
|
|
xConfirmAlarms := GVL_SCADA.stMachine.stConfirmAlarmsBtn.xRequest,
|
|
xRobotStopped := (_stRobotStatus.eStateCurrent <> E_PackMLState.EXECUTE));
|
|
|
|
// Handle robot cmds
|
|
M_HandleRobotCmd();
|
|
|
|
// DEBUG
|
|
//_fbModbusMaster();
|
|
// IF _xReadFullScale THEN
|
|
// _xReadFullScale := FALSE;
|
|
//
|
|
// _fbFlowSensor(
|
|
// byBaseAddr:= ,
|
|
// xReleaseAlarms:= ,
|
|
// xConfirmAlarms:= ,
|
|
// fbMBMaster:= ,
|
|
// rCurrFlowrate=> ,
|
|
// xBusy=> ,
|
|
// xDone=> ,
|
|
// xError=> );
|
|
// END_IF
|
|
|
|
|
|
// Main state machine
|
|
CASE _iState OF
|
|
0: // Idle
|
|
IF _xStartCycle THEN
|
|
_xStartCycle := FALSE;
|
|
|
|
// Only start with robot in idle then put into aligner
|
|
IF _stRobotStatus.eStateCurrent = E_PackMLState.IDLE THEN
|
|
_stRobotJobParams.eJob := E_KukaRobot_JobNumberRobot.PUT_INTO_ALIGNER;
|
|
_fbRobot.M_CmdStart();
|
|
_iState := 10;
|
|
END_IF
|
|
END_IF
|
|
|
|
// Wait for part in aligner
|
|
10:
|
|
IF (_stRobotStatus.eStateCurrent = E_PackMLState.IDLE) THEN
|
|
_fbAligner.M_CmdStart();
|
|
_iState := 20;
|
|
END_IF
|
|
|
|
// Job aborted
|
|
// IF (_stRobotStatus.eStateCurrent = E_PackMLState.ABORTED) OR (_stRobotStatus.eStateCurrent = E_PackMLState.STOPPED) THEN
|
|
// _iState := 900;
|
|
// END_IF
|
|
|
|
// Wait for aligner to be done then get it with the robot
|
|
20:
|
|
IF (_fbAligner.stStatus.eStateCurrent = E_PackMLState.COMPLETED) THEN
|
|
_stRobotJobParams.eJob := E_KukaRobot_JobNumberRobot.GET_FROM_ALIGNER;
|
|
_fbRobot.M_CmdStart();
|
|
_iState := 40;
|
|
END_IF
|
|
|
|
// Get from aligner done, reset aligner
|
|
40:
|
|
IF (_stRobotStatus.eStateCurrent = E_PackMLState.IDLE) THEN
|
|
_fbAligner.M_CmdReset();
|
|
_iState := 45;
|
|
END_IF
|
|
|
|
45: // Wait for start to put into etcher
|
|
IF _xStartCycle THEN
|
|
_xStartCycle := FALSE;
|
|
_stRobotJobParams.eJob := E_KukaRobot_JobNumberRobot.PUT_INTO_ETCHER1;
|
|
_fbRobot.M_CmdStart();
|
|
_iState := 50;
|
|
END_IF
|
|
|
|
// Wait for robot to be done
|
|
50:
|
|
IF (_stRobotStatus.eStateCurrent = E_PackMLState.IDLE) THEN
|
|
_iState := 60;
|
|
END_IF
|
|
|
|
// Wait for start then get it from the etcher
|
|
60:
|
|
IF _xStartCycle THEN
|
|
_xStartCycle := FALSE;
|
|
_stRobotJobParams.eJob := E_KukaRobot_JobNumberRobot.GET_FROM_ETCHER1;
|
|
_fbRobot.M_CmdStart();
|
|
_iState := 70;
|
|
END_IF
|
|
|
|
// Done with getting it from the etcher
|
|
70:
|
|
IF (_stRobotStatus.eStateCurrent = E_PackMLState.IDLE) THEN
|
|
_stRobotJobParams.eJob := E_KukaRobot_JobNumberRobot.PUT_INTO_ALIGNER;
|
|
_fbRobot.M_CmdStart();
|
|
_iState := 10;
|
|
END_IF
|
|
|
|
|
|
ELSE
|
|
// Nothing to do here
|
|
;
|
|
END_CASE
|
|
|
|
// =====
|
|
// DEBUG
|
|
// =====
|
|
|
|
|
|
|
|
_tofTriggerTime(IN := _xStartTrigger, PT := T#1S);
|
|
IF _xStartTrigger THEN
|
|
_xStartTrigger := FALSE;
|
|
END_IF
|
|
xTriggerCamera := _tofTriggerTime.Q;
|
|
|
|
// Reset alarm reset request
|
|
GVL_SCADA.stMachine.stConfirmAlarmsBtn.xRequest := FALSE;]]></ST>
|
|
</Implementation>
|
|
<Method Name="M_HandleRobotCmd" Id="{14934aaa-b667-4ddb-915d-1d84e8eb799d}">
|
|
<Declaration><![CDATA[METHOD PRIVATE M_HandleRobotCmd
|
|
VAR_INST
|
|
_iState : INT;
|
|
_tonTimeout : TON;
|
|
END_VAR
|
|
]]></Declaration>
|
|
<Implementation>
|
|
<ST><![CDATA[// Handle robot commands to plc
|
|
CASE _iState OF
|
|
// Wait for command
|
|
0:
|
|
_fbRobot.xAckPLCCmd := FALSE;
|
|
|
|
IF _fbRobot.xNewCmdRequested THEN
|
|
_tonTimeout(IN := FALSE);
|
|
_fbRobot.xAckPLCCmd := FALSE;
|
|
_fbRobot.xPLCJobFailed := FALSE;
|
|
_iState := 10;
|
|
END_IF
|
|
|
|
// Do command
|
|
10:
|
|
CASE _fbRobot.eCmdFromRobot OF
|
|
E_KukaRobot_JobNumerPLC.ENABLE_VACUUM_ALIGNER:
|
|
_fbAligner.xEnableVacuum := TRUE;
|
|
ADSLOGSTR(msgCtrlMask := ADSLOG_MSGTYPE_LOG, msgFmtStr := 'ENABLE_VACUUM_ALIGNER', strArg := '');
|
|
|
|
// Check for timeout
|
|
_tonTimeout(IN := TRUE, PT := T#10S);
|
|
IF _tonTimeout.Q THEN
|
|
_fbRobot.xAckPLCCmd := TRUE;
|
|
_fbRobot.xPLCJobFailed := TRUE;
|
|
_iState := 0;
|
|
END_IF
|
|
|
|
IF _fbAligner.xVacuumEnabled THEN
|
|
_fbRobot.xAckPLCCmd := TRUE;
|
|
_iState := 0;
|
|
END_IF
|
|
|
|
E_KukaRobot_JobNumerPLC.DISABLE_VACUUM_ALIGNER:
|
|
_fbAligner.xEnableVacuum := FALSE;
|
|
|
|
// Check for timeout
|
|
_tonTimeout(IN := TRUE, PT := T#10S);
|
|
IF _tonTimeout.Q THEN
|
|
_fbRobot.xAckPLCCmd := TRUE;
|
|
_fbRobot.xPLCJobFailed := TRUE;
|
|
_iState := 0;
|
|
END_IF
|
|
|
|
IF (NOT _fbAligner.xVacuumEnabled) THEN
|
|
_fbRobot.xAckPLCCmd := TRUE;
|
|
_iState := 0;
|
|
END_IF
|
|
|
|
E_KukaRobot_JobNumerPLC.ENABLE_VACUUM_ETCHER1:
|
|
_fbEtcher1.xEnableVacuum := TRUE;
|
|
|
|
// Check for timeout
|
|
//_tonTimeout(IN := TRUE, PT := T#20S);
|
|
IF _tonTimeout.Q THEN
|
|
_fbRobot.xAckPLCCmd := TRUE;
|
|
_fbRobot.xPLCJobFailed := TRUE;
|
|
_iState := 0;
|
|
END_IF
|
|
|
|
IF _fbEtcher1.xVacuumEnabled THEN
|
|
_fbRobot.xAckPLCCmd := TRUE;
|
|
_iState := 0;
|
|
END_IF
|
|
|
|
E_KukaRobot_JobNumerPLC.DISABLE_VACUUM_ETCHER1:
|
|
_fbEtcher1.xEnableVacuum := FALSE;
|
|
|
|
// Check for timeout
|
|
//_tonTimeout(IN := TRUE, PT := T#20S);
|
|
IF _tonTimeout.Q THEN
|
|
_fbRobot.xAckPLCCmd := TRUE;
|
|
_fbRobot.xPLCJobFailed := TRUE;
|
|
_iState := 0;
|
|
END_IF
|
|
|
|
IF (NOT _fbEtcher1.xVacuumEnabled) THEN
|
|
_fbRobot.xAckPLCCmd := TRUE;
|
|
_iState := 0;
|
|
END_IF
|
|
|
|
E_KukaRobot_JobNumerPLC.ENABLE_VACUUM_ETCHER2:
|
|
_fbEtcher2.xEnableVacuum := TRUE;
|
|
_xTRiggeredEV := TRUE;
|
|
|
|
// Check for timeout
|
|
_tonTimeout(IN := TRUE, PT := T#20S);
|
|
IF _tonTimeout.Q THEN
|
|
_fbRobot.xAckPLCCmd := TRUE;
|
|
_fbRobot.xPLCJobFailed := TRUE;
|
|
_iState := 0;
|
|
END_IF
|
|
|
|
IF _fbEtcher2.xVacuumEnabled THEN
|
|
_fbRobot.xAckPLCCmd := TRUE;
|
|
_iState := 0;
|
|
END_IF
|
|
|
|
E_KukaRobot_JobNumerPLC.DISABLE_VACUUM_ETCHER2:
|
|
_fbEtcher2.xEnableVacuum := FALSE;
|
|
_xTriggerDV := TRUE;
|
|
|
|
// Check for timeout
|
|
_tonTimeout(IN := TRUE, PT := T#20S);
|
|
IF _tonTimeout.Q THEN
|
|
_fbRobot.xAckPLCCmd := TRUE;
|
|
_fbRobot.xPLCJobFailed := TRUE;
|
|
_iState := 0;
|
|
END_IF
|
|
|
|
IF (NOT _fbEtcher2.xVacuumEnabled) THEN
|
|
_fbRobot.xAckPLCCmd := TRUE;
|
|
_iState := 0;
|
|
END_IF
|
|
|
|
E_KukaRobot_JobNumerPLC.UNLOCK_CHUCK_ETCHER1:
|
|
_fbEtcher1.xOpenChuckClamp := TRUE;
|
|
|
|
// Check FOR timeout
|
|
_tonTimeout(IN := TRUE, PT := T#10S);
|
|
IF _tonTimeout.Q THEN
|
|
_fbRobot.xAckPLCCmd := TRUE;
|
|
_fbRobot.xPLCJobFailed := TRUE;
|
|
_iState := 0;
|
|
END_IF
|
|
|
|
IF _fbEtcher1.xChuckClampOpen THEN
|
|
_fbRobot.xAckPLCCmd := TRUE;
|
|
_iState := 0;
|
|
END_IF
|
|
|
|
E_KukaRobot_JobNumerPLC.LOCK_CHUCK_ETCHER1:
|
|
_fbEtcher1.xOpenChuckClamp := FALSE;
|
|
|
|
// Check FOR timeout
|
|
_tonTimeout(IN := TRUE, PT := T#10S);
|
|
IF _tonTimeout.Q THEN
|
|
_fbRobot.xAckPLCCmd := TRUE;
|
|
_fbRobot.xPLCJobFailed := TRUE;
|
|
_iState := 0;
|
|
END_IF
|
|
|
|
IF (NOT _fbEtcher1.xChuckClampOpen) THEN
|
|
_fbRobot.xAckPLCCmd := TRUE;
|
|
_iState := 0;
|
|
END_IF
|
|
|
|
E_KukaRobot_JobNumerPLC.UNLOCK_CHUCK_ETCHER2:
|
|
_fbEtcher2.xOpenChuckClamp := TRUE;
|
|
|
|
// Check FOR timeout
|
|
_tonTimeout(IN := TRUE, PT := T#10S);
|
|
IF _tonTimeout.Q THEN
|
|
_fbRobot.xAckPLCCmd := TRUE;
|
|
_fbRobot.xPLCJobFailed := TRUE;
|
|
_iState := 0;
|
|
END_IF
|
|
|
|
IF _fbEtcher2.xChuckClampOpen THEN
|
|
_fbRobot.xAckPLCCmd := TRUE;
|
|
_iState := 0;
|
|
END_IF
|
|
|
|
E_KukaRobot_JobNumerPLC.LOCK_CHUCK_ETCHER2:
|
|
_fbEtcher2.xOpenChuckClamp := FALSE;
|
|
|
|
// Check FOR timeout
|
|
_tonTimeout(IN := TRUE, PT := T#10S);
|
|
IF _tonTimeout.Q THEN
|
|
_fbRobot.xAckPLCCmd := TRUE;
|
|
_fbRobot.xPLCJobFailed := TRUE;
|
|
_iState := 0;
|
|
END_IF
|
|
|
|
IF (NOT _fbEtcher2.xChuckClampOpen) THEN
|
|
_fbRobot.xAckPLCCmd := TRUE;
|
|
_iState := 0;
|
|
END_IF
|
|
|
|
ELSE
|
|
_iState := 90;
|
|
END_CASE
|
|
|
|
ELSE
|
|
// Nothing to do here
|
|
;
|
|
END_CASE]]></ST>
|
|
</Implementation>
|
|
</Method>
|
|
</POU>
|
|
</TcPlcObject> |