Changed gripper calculation and AlarmRaising
This commit is contained in:
@@ -88,6 +88,11 @@ VAR
|
||||
_fbAlarmOperatorSafetyNotOk : FB_AlarmMessage(stEventEntry := TC_EVENTS.KukaRobot.OperatorSafetyNotOk, xWithConfirmation := FALSE);
|
||||
_fbAlarmRobotErrorResetTimeout : FB_AlarmMessage(stEventEntry := TC_EVENTS.KukaRobot.ErrorResetTimeout, xWithConfirmation := TRUE);
|
||||
_fbAlarmDrivesEnableTimeout : FB_AlarmMessage(stEventEntry := TC_EVENTS.KukaRobot.DrivesEnableTimeout, xWithConfirmation := TRUE);
|
||||
_fbAlarmWrongJobMirrored : FB_AlarmMessage(stEventEntry := TC_EVENTS.KukaRobot.WrongJobReadBack, xWithConfirmation := TRUE);
|
||||
_fbAlarmWrongParamMirrored : FB_AlarmMessage(stEventEntry := TC_EVENTS.KukaRobot.WrongParamsReadBack, xWithConfirmation := TRUE);
|
||||
END_VAR
|
||||
VAR RETAIN
|
||||
byCurrentGripper : BYTE := 2;
|
||||
END_VAR
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
@@ -126,6 +131,16 @@ _fbAlarmRobotErrorResetTimeout(
|
||||
xRelease:= xReleaseAlarms,
|
||||
xAcknowledge:= xConfirmAlarms);
|
||||
|
||||
// Handled by M_Starting
|
||||
_fbAlarmWrongParamMirrored(
|
||||
xRelease:= xReleaseAlarms,
|
||||
xAcknowledge:= xConfirmAlarms);
|
||||
|
||||
// Handled by M_Starting
|
||||
_fbAlarmWrongJobMirrored(
|
||||
xRelease:= xReleaseAlarms,
|
||||
xAcknowledge:= xConfirmAlarms);
|
||||
|
||||
|
||||
// =======================
|
||||
// Check if robot is ready
|
||||
@@ -214,6 +229,16 @@ stJobs.wJobNrForRobot := E_KukaRobot_JobNumberRobot.NO_JOB;
|
||||
stJobs.wFinishedJobNrFromPlc := E_KukaRobot_JobNumerPLC.NO_JOB;]]></ST>
|
||||
</Implementation>
|
||||
</Method>
|
||||
<Method Name="M_CalcGripperNr" Id="{282207f3-bc23-43ae-a217-8c6b456b1a5f}">
|
||||
<Declaration><![CDATA[METHOD PRIVATE M_CalcGripperNr : BYTE
|
||||
VAR_INPUT
|
||||
byGripperSide : BYTE;
|
||||
END_VAR
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[M_CalcGripperNr := (byCurrentGripper - 1) + byGripperSide;]]></ST>
|
||||
</Implementation>
|
||||
</Method>
|
||||
<Method Name="M_Clearing" Id="{e6152288-8c7d-4b38-bfbc-4f861d76ccc5}" FolderPath="StateMachine\">
|
||||
<Declaration><![CDATA[METHOD PROTECTED M_Clearing
|
||||
VAR_INST
|
||||
@@ -373,7 +398,7 @@ CASE _iSSM OF
|
||||
// Timeout drives ready
|
||||
IF _tonTimeout.Q THEN
|
||||
stCtrl.bEnableAxes := 0;
|
||||
_fbAlarmDrivesEnableTimeout.xRelease := TRUE;
|
||||
_fbAlarmDrivesEnableTimeout.M_OneShot();
|
||||
_tonTimeout(IN := FALSE);
|
||||
_eCmd := E_PackMLCmd.ABORT;
|
||||
END_IF
|
||||
@@ -392,7 +417,7 @@ CASE _iSSM OF
|
||||
|
||||
// Timeout reset errors
|
||||
IF _tonTimeout.Q THEN
|
||||
_fbAlarmRobotErrorResetTimeout.xRelease := TRUE;
|
||||
_fbAlarmRobotErrorResetTimeout.M_OneShot();
|
||||
_tonTimeout(IN := FALSE);
|
||||
_eCmd := E_PackMLCmd.ABORT;
|
||||
END_IF
|
||||
@@ -420,6 +445,9 @@ END_CASE]]></ST>
|
||||
</Method>
|
||||
<Method Name="M_Starting" Id="{011f85d8-1225-4288-876f-918df6e4f235}" FolderPath="StateMachine\">
|
||||
<Declaration><![CDATA[METHOD PROTECTED M_Starting
|
||||
VAR
|
||||
_byGripperSideNrCalc : BYTE;
|
||||
END_VAR
|
||||
VAR_INST
|
||||
_tonTimeout : TON;
|
||||
END_VAR]]></Declaration>
|
||||
@@ -427,9 +455,11 @@ END_VAR]]></Declaration>
|
||||
<ST><![CDATA[CASE _iSSM OF
|
||||
// Check job parameters
|
||||
0:
|
||||
IF (_stJobParams.byGripperNumber > 4) // Wrong gripper number
|
||||
_byGripperSideNrCalc := M_CalcGripperNr(_stJobParams.byGripperNumber);
|
||||
|
||||
IF (_stJobParams.byGripperNumber > 3) // Wrong gripper number
|
||||
//OR (_stJobParams.byChuckNumber < 1) OR (_stJobParams.byChuckNumber > 6) // Wrong chuck number
|
||||
OR (_stJobParams.byGripperSide < 1) OR (_stJobParams.byGripperSide > 6) // Wrong gripper side
|
||||
OR (_byGripperSideNrCalc < 1) OR (_byGripperSideNrCalc > 6) // Wrong gripper side
|
||||
THEN
|
||||
_eCmd := E_PackMLCmd.ABORT;
|
||||
ELSE
|
||||
@@ -474,9 +504,6 @@ END_VAR]]></Declaration>
|
||||
// Chuck for etcher to load
|
||||
abyToolsAndPositions[1] := stJobParams.byChuckNumber;
|
||||
|
||||
// Write robot job number
|
||||
stJobs.wJobNrForRobot := DINT_TO_WORD(_stJobParams.eJob);
|
||||
|
||||
// Safety reset timout fb
|
||||
_tonTimeout(IN := FALSE);
|
||||
|
||||
@@ -484,17 +511,29 @@ END_VAR]]></Declaration>
|
||||
|
||||
// Check mirrored values
|
||||
15:
|
||||
_tonTimeout(IN := TRUE, PT := T#5S);
|
||||
|
||||
IF abyMirrorToolsAndPositions[0] = stJobParams.byGripperNumber
|
||||
AND abyMirrorToolsAndPositions[1] = stJobParams.byChuckNumber
|
||||
AND abyMirrorToolsAndPositions[2] = stJobParams.byPlaceOnHotplate
|
||||
AND abyMirrorToolsAndPositions[3] = stJobParams.byPlaceOnCoolPlate
|
||||
THEN
|
||||
_tonTimeout(IN := FALSE);
|
||||
_iSSM := 20;
|
||||
END_IF
|
||||
|
||||
IF _tonTimeout.Q THEN
|
||||
_tonTimeout(IN := FALSE);
|
||||
_fbAlarmWrongParamMirrored.M_OneShot();
|
||||
_eCmd := E_PackMLCmd.STOP;
|
||||
END_IF
|
||||
|
||||
// Wait for robot program start
|
||||
20:
|
||||
_tonTimeout(IN := TRUE, PT := T#15S);
|
||||
// Write robot job number
|
||||
stJobs.wJobNrForRobot := DINT_TO_WORD(_stJobParams.eJob);
|
||||
|
||||
_tonTimeout(IN := TRUE, PT := T#5S);
|
||||
|
||||
// If job number is read back correct, go to next state
|
||||
IF awJobStatesFromRobot[0] = stJobs.wJobNrForRobot THEN
|
||||
@@ -506,6 +545,7 @@ END_VAR]]></Declaration>
|
||||
// Timeout occured
|
||||
IF _tonTimeout.Q THEN
|
||||
_tonTimeout(IN := FALSE);
|
||||
_fbAlarmWrongJobMirrored.M_OneShot();
|
||||
_eCmd := E_PackMLCmd.ABORT;
|
||||
END_IF
|
||||
|
||||
|
||||
Reference in New Issue
Block a user