Bugfixes in TrayFeeder and Aligner
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
This commit is contained in:
@@ -10,6 +10,7 @@ VAR
|
||||
_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;
|
||||
@@ -46,6 +47,9 @@ VAR
|
||||
_tofTriggerTime : TOF;
|
||||
xTriggerCamera AT %Q* : BOOL;
|
||||
|
||||
_xTRiggeredEV : BOOL;
|
||||
_xTRiggerDV : BOOL;
|
||||
|
||||
_iState : INT;
|
||||
END_VAR
|
||||
]]></Declaration>
|
||||
@@ -103,6 +107,11 @@ _fbTrayFeederInput(
|
||||
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,
|
||||
@@ -268,6 +277,7 @@ CASE _iState OF
|
||||
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);
|
||||
@@ -302,7 +312,7 @@ CASE _iState OF
|
||||
_fbEtcher1.xEnableVacuum := TRUE;
|
||||
|
||||
// Check for timeout
|
||||
_tonTimeout(IN := TRUE, PT := T#20S);
|
||||
//_tonTimeout(IN := TRUE, PT := T#20S);
|
||||
IF _tonTimeout.Q THEN
|
||||
_fbRobot.xAckPLCCmd := TRUE;
|
||||
_fbRobot.xPLCJobFailed := TRUE;
|
||||
@@ -318,7 +328,7 @@ CASE _iState OF
|
||||
_fbEtcher1.xEnableVacuum := FALSE;
|
||||
|
||||
// Check for timeout
|
||||
_tonTimeout(IN := TRUE, PT := T#20S);
|
||||
//_tonTimeout(IN := TRUE, PT := T#20S);
|
||||
IF _tonTimeout.Q THEN
|
||||
_fbRobot.xAckPLCCmd := TRUE;
|
||||
_fbRobot.xPLCJobFailed := TRUE;
|
||||
@@ -332,6 +342,7 @@ CASE _iState OF
|
||||
|
||||
E_KukaRobot_JobNumerPLC.ENABLE_VACUUM_ETCHER2:
|
||||
_fbEtcher2.xEnableVacuum := TRUE;
|
||||
_xTRiggeredEV := TRUE;
|
||||
|
||||
// Check for timeout
|
||||
_tonTimeout(IN := TRUE, PT := T#20S);
|
||||
@@ -348,6 +359,7 @@ CASE _iState OF
|
||||
|
||||
E_KukaRobot_JobNumerPLC.DISABLE_VACUUM_ETCHER2:
|
||||
_fbEtcher2.xEnableVacuum := FALSE;
|
||||
_xTriggerDV := TRUE;
|
||||
|
||||
// Check for timeout
|
||||
_tonTimeout(IN := TRUE, PT := T#20S);
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
VAR_INPUT
|
||||
xEnableVacuum : BOOL;
|
||||
xExecute : BOOL;
|
||||
|
||||
xReleaseManualMode : BOOL;
|
||||
xReleaseAlarms : BOOL;
|
||||
xConfirmAlarms : BOOL;
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
@@ -15,8 +16,9 @@ VAR_IN_OUT
|
||||
stHMIInterface : ST_HMI_Aligner;
|
||||
END_VAR
|
||||
VAR
|
||||
xActivateVacuum AT %Q* : BOOL := FALSE;
|
||||
xDeactivateVacuum AT %Q* : BOOL := TRUE;
|
||||
_fbValveVacuum : FB_Valve('Vacuum');
|
||||
_stValveVacuumConfig : ST_ValveConfig;
|
||||
|
||||
xVacuumOk AT %I* : BOOL;
|
||||
|
||||
diXOffset AT %I* : DINT;
|
||||
@@ -52,6 +54,14 @@ _fbYAxis(
|
||||
lrJerk:= 0,
|
||||
xConfirmAlarms:= xConfirmAlarms);
|
||||
|
||||
_fbValveVacuum(
|
||||
xAutomaticOpen:= xEnableVacuum,
|
||||
xReleaseErrors:= xReleaseAlarms,
|
||||
stValveConfig:= _stValveVacuumConfig,
|
||||
xReleaseManualMode:= xReleaseManualMode,
|
||||
xConfirmAlarms:= xConfirmAlarms,
|
||||
stHMIInterface:= stHMIInterface.stVacuumValve);
|
||||
|
||||
|
||||
// =============================
|
||||
// Call isa88 base state machine
|
||||
@@ -61,8 +71,6 @@ SUPER^(stPackMLHMIInterface := stHMIInterface.stStationCmds);
|
||||
_rtExecute(CLK:= xExecute, Q=> _xStartAlign);
|
||||
|
||||
// Handle enable disable vacuum command
|
||||
xActivateVacuum := xEnableVacuum;
|
||||
xDeactivateVacuum := (NOT xEnableVacuum);
|
||||
xVacuumEnabled := xVacuumOk;]]></ST>
|
||||
</Implementation>
|
||||
<Method Name="FB_init" Id="{5048e086-25a4-4fbb-bf29-7a016bcf2277}">
|
||||
@@ -81,7 +89,11 @@ END_VAR
|
||||
_stSMConfig.xStartingDisabled := TRUE;
|
||||
_stSMConfig.xHeldDisabled := TRUE;
|
||||
_stSMConfig.xSuspededDisabled := TRUE;
|
||||
_stSMConfig.xCompletedDisabled := FALSE;]]></ST>
|
||||
_stSMConfig.xCompletedDisabled := FALSE;
|
||||
|
||||
// Valve config
|
||||
_stValveVacuumConfig.xHasOpenFeedback := FALSE;
|
||||
_stValveVacuumConfig.xHasClosedFeedback := FALSE;]]></ST>
|
||||
</Implementation>
|
||||
</Method>
|
||||
<Method Name="M_Clearing" Id="{0b5b5108-3886-40a3-876f-a3460b5d5089}">
|
||||
@@ -146,7 +158,9 @@ END_CASE]]></ST>
|
||||
</Method>
|
||||
<Method Name="M_Resetting" Id="{015c2bf3-1e45-46dd-93fe-a1f154bfd906}">
|
||||
<Declaration><![CDATA[METHOD PROTECTED M_Resetting
|
||||
]]></Declaration>
|
||||
VAR
|
||||
_xFailed : BOOL;
|
||||
END_VAR]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[CASE _iSSM OF
|
||||
0:
|
||||
@@ -156,29 +170,48 @@ END_CASE]]></ST>
|
||||
|
||||
IF _fbXAxis.xEnabled AND _fbYAxis.xEnabled THEN
|
||||
IF (NOT _fbXAxis.xHomed) THEN
|
||||
_fbXAxis.M_Homing(lrHomingPosition := BC.Tc2_MC2.DEFAULT_HOME_POSITION);
|
||||
IF (NOT _fbXAxis.M_Homing(lrHomingPosition := BC.Tc2_MC2.DEFAULT_HOME_POSITION)) THEN
|
||||
_xFailed := TRUE;
|
||||
END_IF
|
||||
END_IF
|
||||
|
||||
IF (NOT _fbYAxis.xHomed) THEN
|
||||
_fbYAxis.M_Homing(lrHomingPosition := BC.Tc2_MC2.DEFAULT_HOME_POSITION);
|
||||
IF (NOT _fbYAxis.M_Homing(lrHomingPosition := BC.Tc2_MC2.DEFAULT_HOME_POSITION)) THEN
|
||||
_xFailed := TRUE;
|
||||
END_IF
|
||||
END_IF
|
||||
|
||||
_iSSM := 10;
|
||||
IF (NOT _xFailed) THEN
|
||||
_iSSM := 10;
|
||||
ELSE
|
||||
M_CmdAbort();
|
||||
END_IF
|
||||
|
||||
END_IF
|
||||
|
||||
10:
|
||||
// Home axes
|
||||
IF (NOT _fbXAxis.xBusy) AND (NOT _fbYAxis.xBusy) THEN
|
||||
_fbXAxis.M_MoveAbs(0.0);
|
||||
_fbYAxis.M_MoveAbs(0.0);
|
||||
IF _fbXAxis.xDone AND _fbYAxis.xDone THEN
|
||||
IF (NOT _fbXAxis.M_MoveAbs(0.0)) OR (NOT _fbYAxis.M_MoveAbs(0.0)) THEN
|
||||
M_CmdAbort();
|
||||
END_IF
|
||||
|
||||
_iSSM := 20;
|
||||
END_IF
|
||||
|
||||
IF _fbXAxis.xError OR _fbYAxis.xError THEN
|
||||
M_CmdAbort();
|
||||
END_IF
|
||||
|
||||
20:
|
||||
// Move to 0 position
|
||||
IF (NOT _fbXAxis.xBusy) AND (NOT _fbYAxis.xBusy) THEN
|
||||
IF _fbXAxis.xDone AND _fbYAxis.xDone THEN
|
||||
M_StateComplete();
|
||||
END_IF
|
||||
|
||||
IF _fbXAxis.xError OR _fbYAxis.xError THEN
|
||||
M_CmdAbort();
|
||||
END_IF
|
||||
END_CASE]]></ST>
|
||||
</Implementation>
|
||||
</Method>
|
||||
|
||||
@@ -20,6 +20,9 @@ VAR_IN_OUT
|
||||
stHMIInterface : ST_HMI_Etcher;
|
||||
END_VAR
|
||||
VAR
|
||||
_fbValveVacuum : FB_Valve('Vacuum');
|
||||
_stValveVacuumConfig : ST_ValveConfig;
|
||||
|
||||
_fbValveDoor : FB_Valve('Door');
|
||||
_stValveDoorCfg : ST_ValveConfig := (
|
||||
xHasClosedFeedback := TRUE,
|
||||
@@ -79,8 +82,6 @@ VAR
|
||||
_fbRobot : FB_Mecademics;
|
||||
_fbSpinner : FB_AxisPTP;
|
||||
|
||||
xDisableVacuum AT %Q* : BOOL;
|
||||
|
||||
_fbValveEnableFilmetch : FB_Valve('');
|
||||
|
||||
_stValveConfig : ST_ValveConfig;
|
||||
@@ -121,6 +122,14 @@ END_IF
|
||||
// Todo bessere implementierung finden
|
||||
//_xOpenChuckClamp := xOpenChuckClamp OR stHMIInterface.stChuckUnlockCmd.xRequest;
|
||||
|
||||
_fbValveVacuum(
|
||||
xAutomaticOpen := xEnableVacuum,
|
||||
xReleaseErrors:= xReleaseAlarms,
|
||||
stValveConfig:= _stValveVacuumConfig,
|
||||
xReleaseManualMode:= xReleaseManualMode,
|
||||
xConfirmAlarms:= xConfirmAlarms,
|
||||
stHMIInterface:= stHMIInterface.stVacuumValve);
|
||||
|
||||
_fbUnlockLeft(
|
||||
xAutomaticOpen:= _xOpenChuckClamp,
|
||||
xReleaseErrors:= xReleaseAlarms,
|
||||
@@ -162,8 +171,6 @@ _fbSpinner(
|
||||
rOverride:= 100.0,
|
||||
lrVelocity:= _lrSpinnerVelo,
|
||||
xConfirmAlarms:= xConfirmAlarms);
|
||||
|
||||
xDisableVacuum := (NOT xEnableVacuum);
|
||||
|
||||
_fbRobot(stPackMLHMIInterface := stHMIInterface.stMecaCmds);
|
||||
|
||||
@@ -309,7 +316,12 @@ _stSMConfig.xAbortingDisabled := TRUE;
|
||||
|
||||
// Valve config
|
||||
_stValveConfig.xHasOpenFeedback := FALSE;
|
||||
_stValveConfig.xHasClosedFeedback := FALSE;]]></ST>
|
||||
_stValveConfig.xHasClosedFeedback := FALSE;
|
||||
|
||||
// Vacuum valve config
|
||||
_stValveVacuumConfig.xHasOpenFeedback := FALSE;
|
||||
_stValveVacuumConfig.xHasClosedFeedback := FALSE;
|
||||
_stValveVacuumConfig.xNormallyOpen := TRUE;]]></ST>
|
||||
</Implementation>
|
||||
</Method>
|
||||
<Method Name="M_JetMeasurement" Id="{5ffd6d61-d32b-40d9-aa63-25591d7cd8df}">
|
||||
|
||||
@@ -39,6 +39,8 @@ VAR
|
||||
_xEnableReceiveTimeout : BOOL;
|
||||
_timReceiveResponseTimeout : TIME := T#5S;
|
||||
_tonReceiveTimeout : TON;
|
||||
_tonTryRecon : TON;
|
||||
_timTryRecon : TIME := T#10S;
|
||||
|
||||
// Receive state machine
|
||||
_iStateReceive : INT;
|
||||
@@ -61,6 +63,8 @@ VAR
|
||||
_xReceivedResponseOk : BOOL;
|
||||
_uiReceivedCommandId : UINT;
|
||||
|
||||
_xConnect : BOOL;
|
||||
|
||||
// Alarms
|
||||
_fbWrongCmdIdAck : FB_AlarmMessage(stEventEntry := TC_EVENTS.TrayFeeder.WrongCmdIdAck, xWithConfirmation := TRUE);
|
||||
_fbResponseNotOk : FB_AlarmMessage(stEventEntry := TC_EVENTS.TrayFeeder.ReceivedResponseNotOk, xWithConfirmation := TRUE);
|
||||
@@ -86,7 +90,7 @@ _fbTcpConnection(
|
||||
nMode:= ,
|
||||
sRemoteHost:= sIpAddr,
|
||||
nRemotePort:= udiPort,
|
||||
bEnable:= xConnect,
|
||||
bEnable:= _xConnect AND xConnect,
|
||||
tReconnect:= T#2S,
|
||||
bBusy=> ,
|
||||
bError=> ,
|
||||
@@ -111,7 +115,13 @@ CASE _iStateReceive OF
|
||||
IF _xConnected THEN
|
||||
_iStateReceive := 10;
|
||||
END_IF
|
||||
|
||||
|
||||
// Try reconnect
|
||||
IF (NOT _xConnected) THEN
|
||||
_xConnect := FALSE;
|
||||
_iStateReceive := 11;
|
||||
END_IF
|
||||
|
||||
// Call receive
|
||||
10:
|
||||
{analysis -64}
|
||||
@@ -140,8 +150,30 @@ CASE _iStateReceive OF
|
||||
|
||||
// If we have an error, check if we are connected
|
||||
IF _fbSocketReceive.bError THEN
|
||||
// Reconnect if socket was closed from feeder side
|
||||
IF _fbSocketReceive.nErrId = 32772 THEN
|
||||
_iStateReceive := 11;
|
||||
_xConnect := FALSE;
|
||||
END_IF
|
||||
_fbSocketReceive(bExecute := FALSE);
|
||||
_fbSocketReadError.xActive := TRUE;
|
||||
//_fbSocketReadError.xActive := TRUE;
|
||||
_iStateReceive := 0;
|
||||
END_IF
|
||||
|
||||
// Disconnect and wait some time before trying to reconnect
|
||||
11:
|
||||
_tonTryRecon(IN := TRUE, PT := _timTryRecon);
|
||||
IF _tonTryRecon.Q THEN
|
||||
_tonTryRecon(IN := FALSE);
|
||||
_xConnect := TRUE;
|
||||
_iStateReceive := 12;
|
||||
END_IF
|
||||
|
||||
// Wait for connection
|
||||
12:
|
||||
_tonTryRecon(IN := TRUE, PT := _timTryRecon);
|
||||
IF _xConnected OR _tonTryRecon.Q THEN
|
||||
_tonTryRecon(IN := FALSE);
|
||||
_iStateReceive := 0;
|
||||
END_IF
|
||||
|
||||
@@ -355,8 +387,7 @@ _xRunSMAgain := FALSE;
|
||||
// Parse response
|
||||
80:
|
||||
_xRunSMAgain := TRUE;
|
||||
_fbParser.M_ParseCmd(_sResponse);
|
||||
stStatus := _fbParser.stStatus;
|
||||
_fbParser.M_ParseCmd(_sResponse);;
|
||||
_iState := 10;
|
||||
|
||||
// Error
|
||||
@@ -400,9 +431,11 @@ _fbSocketReadError(
|
||||
_fbSocketWriteError(
|
||||
xRelease:= xReleaseAlarms,
|
||||
xAcknowledge:= xConfirmAlarms);
|
||||
|
||||
|
||||
|
||||
// Copy output buffers to outputs
|
||||
stStatus := _fbParser.stStatus;
|
||||
stStatus := _fbParser.P_Status;
|
||||
xConnected := _xConnected;
|
||||
xBusy := _xBusy;
|
||||
xError := _xError;]]></ST>
|
||||
|
||||
@@ -124,7 +124,7 @@ END_VAR]]></Declaration>
|
||||
// Wait for reset command to be finished
|
||||
20:
|
||||
IF (NOT _fbProtocolHandler.xBusy) AND (NOT _fbProtocolHandler.xError) THEN
|
||||
_xConnect := FALSE;
|
||||
//_xConnect := FALSE;
|
||||
_iSSM := 30;
|
||||
END_IF
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
VAR_INPUT
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
stStatus : ST_TrayFeederStatus;
|
||||
END_VAR
|
||||
VAR
|
||||
_stStatus : ST_TrayFeederStatus;
|
||||
@@ -116,7 +115,7 @@ _iLength := LEN(sResponse);
|
||||
|
||||
IF 'STAT-FEED' = _sGAF THEN
|
||||
// Get parameter string
|
||||
_sParams := MID(sResponse, LEN(sResponse) - 12, 12);
|
||||
_sParams := MID(sResponse, LEN(sResponse) - 11, 12);
|
||||
|
||||
FOR _uiCounter := 0 TO MAX_PARAMS DO
|
||||
_xSplitResult := FindAndSplit(
|
||||
@@ -127,6 +126,8 @@ IF 'STAT-FEED' = _sGAF THEN
|
||||
|
||||
IF _xSplitResult THEN
|
||||
M_StatFeedParams(_sParam);
|
||||
ELSE
|
||||
EXIT;
|
||||
END_IF
|
||||
END_FOR
|
||||
RETURN;
|
||||
@@ -147,7 +148,6 @@ IF 'EVEN-SYST' = _sGAF THEN
|
||||
M_EvenSystParams(_sParam);
|
||||
END_IF
|
||||
END_FOR
|
||||
RETURN;
|
||||
END_IF
|
||||
|
||||
IF 'EVEN-INIT' = _sGAF THEN
|
||||
@@ -220,9 +220,7 @@ END_IF
|
||||
|
||||
IF 'ERRO-DISP' = _sGAF THEN
|
||||
RETURN;
|
||||
END_IF
|
||||
|
||||
stStatus := _stStatus;]]></ST>
|
||||
END_IF]]></ST>
|
||||
</Implementation>
|
||||
</Method>
|
||||
<Method Name="M_StatFeedParams" Id="{0f709e96-deb5-41d4-a649-6a94f81e2861}">
|
||||
@@ -267,5 +265,16 @@ IF _xSplitOk THEN
|
||||
END_IF]]></ST>
|
||||
</Implementation>
|
||||
</Method>
|
||||
<Property Name="P_Status" Id="{20979751-d4c1-49d9-b10b-c37404f0389d}">
|
||||
<Declaration><![CDATA[PROPERTY P_Status : ST_TrayFeederStatus]]></Declaration>
|
||||
<Get Name="Get" Id="{fd6a9782-a339-4e31-8a2f-e1b1d771cedb}">
|
||||
<Declaration><![CDATA[VAR
|
||||
END_VAR
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[P_Status := _stStatus;]]></ST>
|
||||
</Implementation>
|
||||
</Get>
|
||||
</Property>
|
||||
</POU>
|
||||
</TcPlcObject>
|
||||
@@ -4,6 +4,15 @@
|
||||
<Declaration><![CDATA[TYPE ST_HMI_TrayFeeder :
|
||||
STRUCT
|
||||
stStationCmds : ST_HMI_PackML;
|
||||
|
||||
// Button to feed tray with number
|
||||
stFeedTray : ST_HMI_CONTROL_BUTTON;
|
||||
|
||||
// Number of tray to feed
|
||||
uiTrayNr : UINT;
|
||||
|
||||
// Button to move trayfeeder to loading position
|
||||
stUnloadFeeder : ST_HMI_CONTROL_BUTTON;
|
||||
END_STRUCT
|
||||
END_TYPE
|
||||
]]></Declaration>
|
||||
|
||||
@@ -519,7 +519,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PlaceholderResolution Include="BaseComponents">
|
||||
<Resolution>BaseComponents, 1.3.3 (Heisig GmbH)</Resolution>
|
||||
<Resolution>BaseComponents, 1.3.4 (Heisig GmbH)</Resolution>
|
||||
</PlaceholderResolution>
|
||||
</ItemGroup>
|
||||
<ProjectExtensions>
|
||||
|
||||
76
PLC/PLC.tmc
76
PLC/PLC.tmc
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user