- Added robot schift params for aligning etcher 1 position - Added HMI Interface to robot fb - Added machine LED's at main cabinet - Aligner now works in auto mode - Added HMI interface to etcher station - Added cReleaseAlarms to HeatCoolPlates - Added HMI interface to HVTester - STarted tray feeder response parsing - Fixed some packml base state machine bugs
172 lines
4.3 KiB
XML
172 lines
4.3 KiB
XML
<?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 EXTENDS FB_PackMLGeneric
|
|
VAR_INPUT
|
|
xReleaseAlarms : BOOL;
|
|
xConfirmAlarms : BOOL;
|
|
END_VAR
|
|
VAR_OUTPUT
|
|
END_VAR
|
|
VAR
|
|
_sIpAddr : STRING(15);
|
|
_udiPort : UDINT;
|
|
|
|
_sResponse : STRING(255);
|
|
|
|
_fbProtocolHandler : FB_TFProtocol;
|
|
_xConnect : BOOL := TRUE;
|
|
END_VAR
|
|
]]></Declaration>
|
|
<Implementation>
|
|
<ST><![CDATA[// IPs
|
|
// 192.168.1.10
|
|
// 192.168.1.11
|
|
_fbProtocolHandler(
|
|
sIpAddr:= _sIpAddr,
|
|
udiPort:= _udiPort,
|
|
xConnect := _xConnect,
|
|
xReleaseAlarms := xReleaseAlarms,
|
|
xConfirmAlarms:= xConfirmAlarms,
|
|
xConnected=> ,
|
|
xNewResponseReady=> ,
|
|
xBusy=> ,
|
|
xError=> );
|
|
|
|
// Call isa88 base state machine
|
|
SUPER^(stPackMLHMIInterface := THIS^.stPackMLHMIInterface);]]></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(15);
|
|
udiPort : UDINT;
|
|
END_VAR]]></Declaration>
|
|
<Implementation>
|
|
<ST><![CDATA[// Save connection settings
|
|
_sIpAddr := sIPAddr;
|
|
_udiPort := udiPort;
|
|
|
|
// Config state machine
|
|
_stSMConfig.xStoppingDisabled := TRUE;
|
|
|
|
_stSMConfig.xCompletingDisabled := TRUE;
|
|
_stSMConfig.xCompletedDisabled := TRUE;
|
|
_stSMConfig.xHeldDisabled := TRUE;
|
|
_stSMConfig.xSuspededDisabled := TRUE;
|
|
|
|
_stSMConfig.xAbortingDisabled := TRUE;]]></ST>
|
|
</Implementation>
|
|
</Method>
|
|
<Method Name="M_Clearing" Id="{c748d77d-f0af-4f18-845f-a10049447b5b}">
|
|
<Declaration><![CDATA[METHOD PROTECTED M_Clearing]]></Declaration>
|
|
<Implementation>
|
|
<ST><![CDATA[CASE _iSSM OF
|
|
// Request feeder status
|
|
0:
|
|
_fbProtocolHandler.M_SendCmd('STAT-FEED:');
|
|
_iSSM := 10;
|
|
|
|
// Await response
|
|
10:
|
|
IF (NOT _fbProtocolHandler.xBusy) THEN
|
|
_iSSM := 40;
|
|
END_IF
|
|
|
|
40:
|
|
M_StateComplete();
|
|
END_CASE]]></ST>
|
|
</Implementation>
|
|
</Method>
|
|
<Method Name="M_Execute" Id="{615f393e-f45c-4e99-890d-36c504a262b8}">
|
|
<Declaration><![CDATA[METHOD PROTECTED M_Execute
|
|
]]></Declaration>
|
|
<Implementation>
|
|
<ST><![CDATA[CASE _iSSM OF
|
|
0:
|
|
IF _fbProtocolHandler.M_SendCmd('TRAY-FEED:') THEN
|
|
_iSSM := 10;
|
|
ELSE
|
|
_eCmd := E_PackMLCmd.STOP;
|
|
END_IF
|
|
|
|
10:
|
|
IF (NOT _fbProtocolHandler.xBusy) AND (NOT _fbProtocolHandler.xError) THEN
|
|
_iSSM := 20;
|
|
END_IF
|
|
|
|
IF _fbProtocolHandler.xError THEN
|
|
_eCmd := E_PackMLCmd.STOP;
|
|
END_IF
|
|
|
|
20:
|
|
IF _fbProtocolHandler.stStatus.xInPickPosition THEN
|
|
_eCmd := E_PackMLCmd.COMPLETE;
|
|
END_IF
|
|
END_CASE]]></ST>
|
|
</Implementation>
|
|
</Method>
|
|
<Method Name="M_Resetting" Id="{d821c17b-c2d1-4267-b49d-1f82be218ca5}">
|
|
<Declaration><![CDATA[METHOD PROTECTED M_Resetting
|
|
VAR_INST
|
|
_tonReconnect : TON;
|
|
END_VAR]]></Declaration>
|
|
<Implementation>
|
|
<ST><![CDATA[CASE _iSSM OF
|
|
// Check state of connection
|
|
0:
|
|
IF _fbProtocolHandler.xConnected THEN
|
|
_iSSM := 10;
|
|
ELSE
|
|
_eCmd := E_PackMLCmd.STOP;
|
|
END_IF
|
|
|
|
// Send reset command
|
|
10:
|
|
IF _fbProtocolHandler.M_SendCmd('SYST-RESE:') THEN
|
|
_iSSM := 20;
|
|
ELSE
|
|
_eCmd := E_PackMLCmd.STOP;
|
|
END_IF
|
|
|
|
// Wait for reset command to be finished
|
|
20:
|
|
IF (NOT _fbProtocolHandler.xBusy) AND (NOT _fbProtocolHandler.xError) THEN
|
|
_xConnect := FALSE;
|
|
_iSSM := 30;
|
|
END_IF
|
|
|
|
IF _fbProtocolHandler.xError THEN
|
|
_eCmd := E_PackMLCmd.STOP;
|
|
END_IF
|
|
|
|
30:
|
|
_tonReconnect(IN := TRUE, PT := T#5S);
|
|
|
|
IF _tonReconnect.Q THEN
|
|
_tonReconnect(IN := FALSE, PT := T#5S);
|
|
_xConnect := TRUE;
|
|
_iSSM := 35;
|
|
END_IF
|
|
|
|
35:
|
|
// Wait for reset message
|
|
IF _fbProtocolHandler.stStatus.eState <> E_TrayFeederState.HOLD THEN
|
|
_iSSM := 40;
|
|
END_IF
|
|
|
|
// Check tray feeder status
|
|
40:
|
|
M_StateComplete();
|
|
END_CASE]]></ST>
|
|
</Implementation>
|
|
</Method>
|
|
</POU>
|
|
</TcPlcObject> |