Some improvements and fixes
- 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
This commit is contained in:
@@ -7,10 +7,12 @@ VAR
|
||||
_fbHVTester : FB_HVTester;
|
||||
_fbEtcher1 : FB_Etcher;
|
||||
_fbEtcher2 : FB_Etcher;
|
||||
_fbTrayFeederInput : FB_TrayFeeder(sIPAddr := '192.168.0.41', udiPort := 1337);
|
||||
_fbTrayFeederInput : FB_TrayFeeder(sIPAddr := '192.168.1.10', udiPort := 5000);
|
||||
_fbHeatCoolPlates : FB_HeatCoolPlates;
|
||||
_fbAligner : FB_Aligner;
|
||||
|
||||
_xReleaseAlarms : BOOL;
|
||||
|
||||
_xConfirmAlarms : BOOL;
|
||||
|
||||
_stRobotCmd : ST_PMLc;
|
||||
@@ -43,7 +45,10 @@ VAR
|
||||
END_VAR
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[IF _xClear THEN
|
||||
<ST><![CDATA[// Data from safety
|
||||
_xReleaseAlarms := PRG_Safety.xEStopOk;
|
||||
|
||||
IF _xClear THEN
|
||||
_xClear := FALSE;
|
||||
_fbRobot.M_Clear();
|
||||
END_IF
|
||||
@@ -86,40 +91,46 @@ _fbRobot(
|
||||
stCommand:= _stRobotCmd,
|
||||
stJobParams := _stRobotJobParams,
|
||||
stUnitFeedbacks := _stUnitFeedbacks,
|
||||
xReleaseAlarms:= TRUE,
|
||||
xReleaseAlarms:= _xReleaseAlarms,
|
||||
xConfirmAlarms:= GVL_SCADA.xErrAck,
|
||||
stStatus => _stRobotStatus,
|
||||
stAdmin => _stRobotAdmin,
|
||||
xReady=> ,
|
||||
xError=> );
|
||||
stPackMLHMIInterface := GVL_SCADA.stMachine.stKukaRobot);
|
||||
|
||||
IF _stRobotCmd.xCmdChangeRequest THEN
|
||||
_stRobotCmd.xCmdChangeRequest := FALSE;
|
||||
END_IF
|
||||
|
||||
_fbHVTester(xOpenChambers:= GVL_SCADA.xOpenAllChambers);
|
||||
_fbHVTester(xOpenChambers:= GVL_SCADA.xOpenAllChambers, stPackMLHMIInterface := GVL_SCADA.stMachine.stHVTester);
|
||||
|
||||
_fbEtcher1(
|
||||
xOpenDoor:= GVL_SCADA.xOpenAllChambers,
|
||||
xOpenChuckClamp := GVL_SCADA.xOpenChuckClampEtcher1,
|
||||
xConfirmAlarms := GVL_SCADA.xErrAck);
|
||||
xReleaseAlarms := _xReleaseAlarms,
|
||||
xConfirmAlarms := GVL_SCADA.xErrAck,
|
||||
stPackMLHMIInterface := GVL_SCADA.stMachine.stEtcher1);
|
||||
|
||||
_fbEtcher2(
|
||||
xOpenDoor:= GVL_SCADA.xOpenAllChambers,
|
||||
xOpenChuckClamp := GVL_SCADA.xOpenChuckClampEtcher2,
|
||||
xConfirmAlarms := GVL_SCADA.xErrAck);
|
||||
xReleaseAlarms := _xReleaseAlarms,
|
||||
xConfirmAlarms := GVL_SCADA.xErrAck,
|
||||
stPackMLHMIInterface := GVL_SCADA.stMachine.stEtcher2);
|
||||
|
||||
_fbTrayFeederInput(
|
||||
stCommand:= ,
|
||||
xReleaseAlarms := _xReleaseAlarms,
|
||||
xConfirmAlarms := GVL_SCADA.xErrAck,
|
||||
stStatus=> GVL_SCADA.stTrayFeederInputState,
|
||||
stAdmin=> GVL_SCADA.stTRayFeederInputAdmin);
|
||||
stAdmin=> GVL_SCADA.stTRayFeederInputAdmin,
|
||||
stPackMLHMIInterface := GVL_SCADA.stMachine.stTrayFeeder);
|
||||
|
||||
_fbHeatCoolPlates(
|
||||
stHMIInterface := GVL_SCADA.stHCPlatesHMIInterface,
|
||||
xReleaseAlarms := _xReleaseAlarms,
|
||||
xConfirmAlarms:= GVL_SCADA.xErrAck);
|
||||
|
||||
_fbAligner(stCommand:= , stStatus=> , stAdmin=> , xConfirmAlarms:= GVL_SCADA.xErrAck);
|
||||
_fbAligner(stCommand:= , stStatus=> , stAdmin=> , xConfirmAlarms:= GVL_SCADA.xErrAck, stPackMLHMIInterface := GVL_SCADA.stMachine.stAligner);
|
||||
|
||||
|
||||
// Call safety program
|
||||
@@ -136,48 +147,72 @@ CASE _iState OF
|
||||
IF _xStartCycle THEN
|
||||
_xStartCycle := FALSE;
|
||||
|
||||
// Only start with robot in idle
|
||||
// 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_Start();
|
||||
_iState := 10;
|
||||
END_IF
|
||||
END_IF
|
||||
|
||||
// Grab from position 1
|
||||
// Wait for part in aligner
|
||||
10:
|
||||
// Prepare robot command
|
||||
_stRobotJobParams.eJob := E_KukaRobot_JobNumberRobot.GET_FROM_INPUT;
|
||||
_stRobotJobParams.rPosX := 88.0;
|
||||
_stRobotJobParams.rPosY := 79.0;
|
||||
_stRobotJobParams.byGripperSide := 3;
|
||||
|
||||
_stRobotCmd.eCntrlCmd := E_PackMLCmd.START;
|
||||
_stRobotCmd.xCmdChangeRequest := TRUE;
|
||||
|
||||
_iState := 20;
|
||||
|
||||
// Wait for Robot to be done
|
||||
20:
|
||||
IF (_stRobotStatus.eStateCurrent = E_PackMLState.IDLE) THEN
|
||||
_iState := 30;
|
||||
_fbAligner.M_Start();
|
||||
_iState := 20;
|
||||
END_IF
|
||||
|
||||
// Job aborted
|
||||
IF (_stRobotStatus.eStateCurrent = E_PackMLState.ABORTED) OR (_stRobotStatus.eStateCurrent = E_PackMLState.STOPPED) THEN
|
||||
_iState := 900;
|
||||
// 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_Start();
|
||||
_iState := 40;
|
||||
END_IF
|
||||
|
||||
// Put part onto aligner
|
||||
30:
|
||||
_stRobotJobParams.eJob := E_KukaRobot_JobNumberRobot.PUT_INTO_ALIGNER;
|
||||
|
||||
_stRobotCmd.eCntrlCmd := E_PackMLCmd.START;
|
||||
_stRobotCmd.xCmdChangeRequest := TRUE;
|
||||
|
||||
_iState := 40;
|
||||
|
||||
// Align blank
|
||||
// Get from aligner done, reset aligner
|
||||
40:
|
||||
;
|
||||
IF (_stRobotStatus.eStateCurrent = E_PackMLState.IDLE) THEN
|
||||
_fbAligner.M_Reset();
|
||||
_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_Start();
|
||||
_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_Start();
|
||||
_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_Start();
|
||||
_iState := 10;
|
||||
END_IF
|
||||
|
||||
|
||||
ELSE
|
||||
// Nothing to do here
|
||||
@@ -188,6 +223,8 @@ END_CASE
|
||||
// DEBUG
|
||||
// =====
|
||||
|
||||
|
||||
|
||||
_tofTriggerTime(IN := _xStartTrigger, PT := T#1S);
|
||||
IF _xStartTrigger THEN
|
||||
_xStartTrigger := FALSE;
|
||||
|
||||
@@ -19,6 +19,9 @@ VAR
|
||||
xErrorAck AT %Q* : BOOL;
|
||||
xLockDoor AT %Q* : BOOL := TRUE;
|
||||
|
||||
xLEDMachineOn AT %Q* : BOOL;
|
||||
xLEDMachineOff AT %Q* : BOOL;
|
||||
|
||||
_rtDoorUnlock : R_TRIG;
|
||||
_tofErrorAck : TOF;
|
||||
|
||||
@@ -38,7 +41,9 @@ END_IF
|
||||
_tofErrorAck(IN:= xConfirmAlarms, PT:= T#500MS, Q=> xErrorAck, ET=> );
|
||||
|
||||
// Copy internal signals to outputs
|
||||
xStopRobot := _xStopRobot;]]></ST>
|
||||
xStopRobot := _xStopRobot;
|
||||
xLEDMachineOn := xEStopOk;
|
||||
xLEDMachineOff := (NOT xEStopOk);]]></ST>
|
||||
</Implementation>
|
||||
</POU>
|
||||
</TcPlcObject>
|
||||
16
PLC/00_Main/ST_HMI_Machine.TcDUT
Normal file
16
PLC/00_Main/ST_HMI_Machine.TcDUT
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1">
|
||||
<DUT Name="ST_HMI_Machine" Id="{60f4c1e9-5df6-4709-9b42-c771abc6cf78}">
|
||||
<Declaration><![CDATA[TYPE ST_HMI_Machine :
|
||||
STRUCT
|
||||
stAligner : ST_HMI_PackML;
|
||||
stEtcher1 : ST_HMI_PackML;
|
||||
stEtcher2 : ST_HMI_PackML;
|
||||
stHVTester : ST_HMI_PackML;
|
||||
stKukaRobot : ST_HMI_PackML;
|
||||
stTrayFeeder : ST_HMI_PackML;
|
||||
END_STRUCT
|
||||
END_TYPE
|
||||
]]></Declaration>
|
||||
</DUT>
|
||||
</TcPlcObject>
|
||||
@@ -30,8 +30,7 @@ VAR
|
||||
END_VAR
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[_fbXAxis(
|
||||
xEnable:= TRUE,
|
||||
<ST><![CDATA[_fbXAxis(
|
||||
xInvertCalibrationCam:= FALSE,
|
||||
xEnablePositive:= TRUE,
|
||||
xEnableNegative:= TRUE,
|
||||
@@ -43,7 +42,6 @@ END_VAR
|
||||
xConfirmAlarms:= xConfirmAlarms);
|
||||
|
||||
_fbYAxis(
|
||||
xEnable:= TRUE,
|
||||
xInvertCalibrationCam:= FALSE,
|
||||
xEnablePositive:= TRUE,
|
||||
xEnableNegative:= TRUE,
|
||||
@@ -54,6 +52,12 @@ _fbYAxis(
|
||||
lrJerk:= 0,
|
||||
xConfirmAlarms:= xConfirmAlarms);
|
||||
|
||||
|
||||
// =============================
|
||||
// Call isa88 base state machine
|
||||
// =============================
|
||||
SUPER^(stPackMLHMIInterface := THIS^.stPackMLHMIInterface);
|
||||
|
||||
_rtExecute(CLK:= xExecute, Q=> _xStartAlign);
|
||||
|
||||
// Drei mal ausführen damit die Position genau ist
|
||||
@@ -73,5 +77,122 @@ xActivateVacuum := xEnableVacuum;
|
||||
xDeactivateVacuum := (NOT xEnableVacuum);
|
||||
xVacuumEnabled := xVacuumOk;]]></ST>
|
||||
</Implementation>
|
||||
<Method Name="FB_init" Id="{5048e086-25a4-4fbb-bf29-7a016bcf2277}">
|
||||
<Declaration><![CDATA[//FB_Init is always available implicitly and it is used primarily for initialization.
|
||||
//The return value is not evaluated. For a specific influence, you can also declare the
|
||||
//methods explicitly and provide additional code there with the standard initialization
|
||||
//code. You can evaluate the return value.
|
||||
METHOD FB_Init: BOOL
|
||||
VAR_INPUT
|
||||
bInitRetains: BOOL; // TRUE: the retain variables are initialized (reset warm / reset cold)
|
||||
bInCopyCode: BOOL; // TRUE: the instance will be copied to the copy code afterward (online change)
|
||||
END_VAR
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[_stSMConfig.xClearingDisabled := TRUE;
|
||||
_stSMConfig.xStartingDisabled := TRUE;
|
||||
_stSMConfig.xHeldDisabled := TRUE;
|
||||
_stSMConfig.xSuspededDisabled := TRUE;
|
||||
_stSMConfig.xCompletedDisabled := FALSE;]]></ST>
|
||||
</Implementation>
|
||||
</Method>
|
||||
<Method Name="M_Clearing" Id="{0b5b5108-3886-40a3-876f-a3460b5d5089}">
|
||||
<Declaration><![CDATA[METHOD PROTECTED M_Clearing
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[CASE _iSSM OF
|
||||
0:
|
||||
// TODO: Reset axes
|
||||
M_StateComplete();
|
||||
END_CASE]]></ST>
|
||||
</Implementation>
|
||||
</Method>
|
||||
<Method Name="M_Execute" Id="{d508050c-8f62-4fb2-be6c-88cfee1bab3b}">
|
||||
<Declaration><![CDATA[METHOD PROTECTED M_Execute
|
||||
VAR_INST
|
||||
_deltaX : REAL;
|
||||
_deltaY : REAL;
|
||||
|
||||
_uiRuns : UINT;
|
||||
_tonWait : TON;
|
||||
END_VAR]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[CASE _iSSM OF
|
||||
// Start first alignment
|
||||
0:
|
||||
_deltaX := DINT_TO_REAL(diXOffset) * -0.001;
|
||||
_deltaY := ((DINT_TO_REAL(diYOffset) * 0.001) - 37.5) * -1;
|
||||
|
||||
IF (ABS(_deltaX) < 10.0) AND (ABS(_deltaY) < 10.0) AND (NOT _fbXAxis.xError) AND (NOT _fbYAxis.xError) THEN
|
||||
_fbXAxis.M_MoveRel(lrRelDist := _deltaX);
|
||||
_fbYAxis.M_MoveRel(lrRelDist := _deltaY);
|
||||
_iSSM := 10;
|
||||
END_IF
|
||||
|
||||
// Wait for axis movements to be done
|
||||
10:
|
||||
IF (NOT _fbXAxis.xBusy) AND (NOT _fbYAxis.xBusy) THEN
|
||||
_uiRuns := _uiRuns + 1;
|
||||
|
||||
// Do alignment twice because of backlash in aligner station
|
||||
IF _uiRuns > 1 THEN
|
||||
_iSSM := 30;
|
||||
ELSE
|
||||
_iSSM := 20;
|
||||
END_IF
|
||||
END_IF
|
||||
|
||||
// Wait 1 second to stabelise reading
|
||||
20:
|
||||
_tonWait(IN := TRUE, PT := T#2S);
|
||||
IF _tonWait.Q THEN
|
||||
_tonWait(IN := FALSE);
|
||||
_iSSM := 0;
|
||||
END_IF
|
||||
|
||||
30:
|
||||
_uiRuns := 0;
|
||||
_eCmd := E_PackMLCmd.COMPLETE;
|
||||
END_CASE]]></ST>
|
||||
</Implementation>
|
||||
</Method>
|
||||
<Method Name="M_Resetting" Id="{015c2bf3-1e45-46dd-93fe-a1f154bfd906}">
|
||||
<Declaration><![CDATA[METHOD PROTECTED M_Resetting
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[CASE _iSSM OF
|
||||
0:
|
||||
// Enable axes
|
||||
_fbXAxis.xEnable := TRUE;
|
||||
_fbYAxis.xEnable := TRUE;
|
||||
|
||||
IF _fbXAxis.xEnabled AND _fbYAxis.xEnabled THEN
|
||||
IF (NOT _fbXAxis.xHomed) THEN
|
||||
_fbXAxis.M_Homing(lrHomingPosition := BC.Tc2_MC2.DEFAULT_HOME_POSITION);
|
||||
END_IF
|
||||
|
||||
IF (NOT _fbYAxis.xHomed) THEN
|
||||
_fbYAxis.M_Homing(lrHomingPosition := BC.Tc2_MC2.DEFAULT_HOME_POSITION);
|
||||
END_IF
|
||||
|
||||
_iSSM := 10;
|
||||
END_IF
|
||||
|
||||
10:
|
||||
// Home axes
|
||||
IF (NOT _fbXAxis.xBusy) AND (NOT _fbYAxis.xBusy) THEN
|
||||
_fbXAxis.M_MoveAbs(0.0);
|
||||
_fbYAxis.M_MoveAbs(0.0);
|
||||
_iSSM := 20;
|
||||
END_IF
|
||||
|
||||
20:
|
||||
// Move to 0 position
|
||||
IF (NOT _fbXAxis.xBusy) AND (NOT _fbYAxis.xBusy) THEN
|
||||
M_StateComplete();
|
||||
END_IF
|
||||
END_CASE]]></ST>
|
||||
</Implementation>
|
||||
</Method>
|
||||
</POU>
|
||||
</TcPlcObject>
|
||||
@@ -8,6 +8,7 @@ VAR_INPUT
|
||||
xOpenChuckClamp : BOOL;
|
||||
xEjectChuck : BOOL;
|
||||
xReleaseManualMode : BOOL;
|
||||
xReleaseAlarms : BOOL;
|
||||
xConfirmAlarms : BOOL;
|
||||
stHMIInterface : ST_Etcher_HMIInterface;
|
||||
END_VAR
|
||||
@@ -80,13 +81,12 @@ END_VAR
|
||||
<ST><![CDATA[// Main door
|
||||
_fbValveDoor(
|
||||
xAutomaticOpen:= xOpenDoor,
|
||||
xReleaseErrors:= TRUE,
|
||||
xReleaseErrors:= xReleaseAlarms,
|
||||
stValveConfig:= _stValveDoorCfg,
|
||||
xReleaseManualMode:= FALSE,
|
||||
xConfirmAlarms:= xConfirmAlarms,
|
||||
stHMIInterface:= stHMIInterface.stDoorHMIInterface);
|
||||
|
||||
|
||||
|
||||
// Chuck
|
||||
_rtEjectChuckCmd(CLK := xEjectChuck);
|
||||
@@ -98,7 +98,7 @@ END_IF
|
||||
|
||||
_fbUnlockLeft(
|
||||
xAutomaticOpen:= xOpenChuckClamp,
|
||||
xReleaseErrors:= TRUE,
|
||||
xReleaseErrors:= xReleaseAlarms,
|
||||
stValveConfig:= _stValveUnlockLeftCfg,
|
||||
xReleaseManualMode:= xReleaseManualMode,
|
||||
xConfirmAlarms:= xConfirmAlarms,
|
||||
@@ -106,7 +106,7 @@ _fbUnlockLeft(
|
||||
|
||||
_fbUnlockRight(
|
||||
xAutomaticOpen:= xOpenChuckClamp,
|
||||
xReleaseErrors:= TRUE,
|
||||
xReleaseErrors:= xReleaseAlarms,
|
||||
stValveConfig:= _stValveUnlockRightCfg,
|
||||
xReleaseManualMode:= xReleaseManualMode,
|
||||
xConfirmAlarms:= xConfirmAlarms,
|
||||
@@ -114,7 +114,7 @@ _fbUnlockRight(
|
||||
|
||||
_fbEjectFront(
|
||||
xAutomaticOpen:= _tpEjectChuck.Q,
|
||||
xReleaseErrors:= TRUE,
|
||||
xReleaseErrors:= xReleaseAlarms,
|
||||
stValveConfig:= _stValveClampingFrontCfg,
|
||||
xReleaseManualMode:= xReleaseManualMode,
|
||||
xConfirmAlarms:= xConfirmAlarms,
|
||||
@@ -122,7 +122,7 @@ _fbEjectFront(
|
||||
|
||||
_fbEjectBack(
|
||||
xAutomaticOpen:= _tpEjectChuck.Q,
|
||||
xReleaseErrors:= TRUE,
|
||||
xReleaseErrors:= xReleaseAlarms,
|
||||
stValveConfig:= _stValveEjectBackCfg,
|
||||
xReleaseManualMode:= xReleaseManualMode,
|
||||
xConfirmAlarms:= xConfirmAlarms,
|
||||
@@ -131,7 +131,7 @@ _fbEjectBack(
|
||||
xDisableVacuum := (NOT xEnableVacuum);
|
||||
|
||||
// Call base sm
|
||||
SUPER^();
|
||||
SUPER^(stPackMLHMIInterface := THIS^.stPackMLHMIInterface);
|
||||
|
||||
// Copy internal signals to output
|
||||
xDoorOpen := _fbValveDoor.IsOpen;
|
||||
|
||||
@@ -38,7 +38,7 @@ ELSE
|
||||
END_IF
|
||||
|
||||
// Call base sm
|
||||
SUPER^();]]></ST>
|
||||
SUPER^(stPackMLHMIInterface := THIS^.stPackMLHMIInterface);]]></ST>
|
||||
</Implementation>
|
||||
</POU>
|
||||
</TcPlcObject>
|
||||
@@ -3,6 +3,7 @@
|
||||
<POU Name="FB_HeatCoolPlates" Id="{a2be063c-19d7-4ca2-8121-529d61cc7bc2}" SpecialFunc="None">
|
||||
<Declaration><![CDATA[FUNCTION_BLOCK FB_HeatCoolPlates
|
||||
VAR_INPUT
|
||||
xReleaseAlarms : BOOL;
|
||||
xConfirmAlarms : BOOL;
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
@@ -25,6 +26,7 @@ END_VAR
|
||||
xEnable:= _xEnableHotplate,
|
||||
rTargetTemp:= _rTargetTemp,
|
||||
stHMIInterface := stHMIInterface.stHotplateHMIInterface,
|
||||
xReleaseAlarms := xReleaseAlarms,
|
||||
xConfirmAlarms:= xConfirmAlarms,
|
||||
uiNextFreeSlot=> ,
|
||||
uiNextReadySlot=> );
|
||||
|
||||
@@ -6,6 +6,7 @@ VAR_INPUT
|
||||
xEnable : BOOL;
|
||||
rTargetTemp : REAL;
|
||||
|
||||
xReleaseAlarms : BOOL;
|
||||
xConfirmAlarms : BOOL;
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
@@ -47,7 +48,7 @@ END_VAR
|
||||
_fbTempSensor(
|
||||
stAnalogIOConfig:= _stTempSensorConfig,
|
||||
stAnalogEWConfig:= _stTempSEnsorEWConfig,
|
||||
xReleaseErrors:= TRUE,
|
||||
xReleaseErrors:= xReleaseAlarms,
|
||||
xReleaseLimitErrors:= FALSE,
|
||||
xReleaseHardwareErrors:= TRUE,
|
||||
xConfirmAlarms:= xConfirmAlarms,
|
||||
@@ -79,7 +80,7 @@ _fbLimit(
|
||||
xClampedLower=> _fbPITempControl.xSaturatedLower);
|
||||
|
||||
_fbPWMOut(
|
||||
timPeriod:= T#10S,
|
||||
timPeriod:= T#100MS,
|
||||
xOutput=> xEnableHotplate);
|
||||
|
||||
// Output HMI Interface
|
||||
|
||||
@@ -45,6 +45,11 @@ VAR
|
||||
diOffsetPosY AT %Q* : DINT;
|
||||
diThickness AT %Q* : DINT;
|
||||
|
||||
// Offsets for etcher 1 in um
|
||||
diOffsetXE1 AT %Q* : DINT := -280;
|
||||
diOffsetYE1 AT %Q* : DINT := 340;
|
||||
diOffsetZE1 AT %Q* : DINT := 0;
|
||||
|
||||
// Inputs
|
||||
stState AT %I* : ST_KukaRobot_State;
|
||||
dwErrorBits AT %I* : DWORD;
|
||||
@@ -137,7 +142,7 @@ _xRobotReady := stState.bExt
|
||||
// =============================
|
||||
// Call isa88 base state machine
|
||||
// =============================
|
||||
SUPER^();
|
||||
SUPER^(stPackMLHMIInterface := THIS^.stPackMLHMIInterface);
|
||||
|
||||
|
||||
// ==============================
|
||||
@@ -475,11 +480,21 @@ END_VAR]]></Declaration>
|
||||
// Safety reset timout fb
|
||||
_tonTimeout(IN := FALSE);
|
||||
|
||||
_iSSM := 20;
|
||||
_iSSM := 15;
|
||||
|
||||
// Check mirrored values
|
||||
15:
|
||||
IF abyMirrorToolsAndPositions[0] = stJobParams.byGripperNumber
|
||||
AND abyMirrorToolsAndPositions[1] = stJobParams.byChuckNumber
|
||||
AND abyMirrorToolsAndPositions[2] = stJobParams.byPlaceOnHotplate
|
||||
AND abyMirrorToolsAndPositions[3] = stJobParams.byPlaceOnCoolPlate
|
||||
THEN
|
||||
_iSSM := 20;
|
||||
END_IF
|
||||
|
||||
// Wait for robot program start
|
||||
20:
|
||||
_tonTimeout(IN := TRUE, PT := T#5S);
|
||||
_tonTimeout(IN := TRUE, PT := T#15S);
|
||||
|
||||
// If job number is read back correct, go to next state
|
||||
IF awJobStatesFromRobot[0] = stJobs.wJobNrForRobot THEN
|
||||
|
||||
17
PLC/01_Stationen/TrayFeeder/E_TFInputStackState.TcDUT
Normal file
17
PLC/01_Stationen/TrayFeeder/E_TFInputStackState.TcDUT
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1">
|
||||
<DUT Name="E_TFInputStackState" Id="{116af561-bb7d-4305-a2c0-a49c88c2ea9c}">
|
||||
<Declaration><![CDATA[{attribute 'qualified_only'}
|
||||
{attribute 'strict'}
|
||||
{attribute 'to_string'}
|
||||
TYPE E_TFInputStackState :
|
||||
(
|
||||
UNDEFINED := 0,
|
||||
EMTPY,
|
||||
NO_MAGAZINE,
|
||||
ALMOST_EMPTY
|
||||
);
|
||||
END_TYPE
|
||||
]]></Declaration>
|
||||
</DUT>
|
||||
</TcPlcObject>
|
||||
16
PLC/01_Stationen/TrayFeeder/E_TrayFeederState.TcDUT
Normal file
16
PLC/01_Stationen/TrayFeeder/E_TrayFeederState.TcDUT
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1">
|
||||
<DUT Name="E_TrayFeederState" Id="{daeef904-23f3-4403-9629-33fc3b92cc18}">
|
||||
<Declaration><![CDATA[{attribute 'qualified_only'}
|
||||
{attribute 'strict'}
|
||||
{attribute 'to_string'}
|
||||
TYPE E_TrayFeederState :
|
||||
(
|
||||
HOLD := 0,
|
||||
LOAD_POS,
|
||||
FEED_POS,
|
||||
BUSY
|
||||
);
|
||||
END_TYPE]]></Declaration>
|
||||
</DUT>
|
||||
</TcPlcObject>
|
||||
51
PLC/01_Stationen/TrayFeeder/FB_StringRingbufferOwn.TcPOU
Normal file
51
PLC/01_Stationen/TrayFeeder/FB_StringRingbufferOwn.TcPOU
Normal file
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1">
|
||||
<POU Name="FB_StringRingbufferOwn" Id="{b0c904f8-c254-4be5-aa41-60a384fcb4a2}" SpecialFunc="None">
|
||||
<Declaration><![CDATA[FUNCTION_BLOCK FB_StringRingbufferOwn
|
||||
VAR_INPUT
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
xHasData : BOOL;
|
||||
xFull : BOOL;
|
||||
END_VAR
|
||||
VAR
|
||||
_asBuffer : ARRAY[0..BUFFER_SIZE-1] OF STRING(255);
|
||||
_uiWriteIdx : UINT := 0;
|
||||
_uiReadIdx : UINT := 0;
|
||||
_uiCount : UINT := 0;
|
||||
END_VAR
|
||||
VAR CONSTANT
|
||||
BUFFER_SIZE : UINT := 10;
|
||||
END_VAR
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[// Write outputs
|
||||
xHasData := (_uiCount > 0);
|
||||
xFull := (_uiCount >= BUFFER_SIZE);]]></ST>
|
||||
</Implementation>
|
||||
<Method Name="M_ReadData" Id="{2d123e62-f6df-4eb9-a215-009779534bc5}">
|
||||
<Declaration><![CDATA[METHOD M_ReadData : STRING(255)
|
||||
VAR_INPUT
|
||||
END_VAR
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[]]></ST>
|
||||
</Implementation>
|
||||
</Method>
|
||||
<Method Name="M_WriteData" Id="{dc0dd3d7-badb-4886-8590-850ff7625fa1}">
|
||||
<Declaration><![CDATA[METHOD M_WriteData
|
||||
VAR_INPUT
|
||||
sData : STRING(255);
|
||||
END_VAR
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[// Check if buffer is full
|
||||
IF _uiCount < BUFFER_SIZE THEN
|
||||
_asBuffer[_uiWriteIdx] := sData;
|
||||
_uiWriteIdx := (_uiWriteIdx + 1) MOD BUFFER_SIZE;
|
||||
_uiCount := _uiCount + 1;
|
||||
END_IF]]></ST>
|
||||
</Implementation>
|
||||
</Method>
|
||||
</POU>
|
||||
</TcPlcObject>
|
||||
@@ -5,12 +5,13 @@
|
||||
VAR_INPUT
|
||||
sIpAddr : STRING(15);
|
||||
udiPort : UDINT;
|
||||
|
||||
xConnect : BOOL := TRUE;
|
||||
xReleaseAlarms : BOOL;
|
||||
xConfirmAlarms : BOOL;
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
stStatus : ST_TrayFeederStatus;
|
||||
xConnected : BOOL;
|
||||
|
||||
xNewResponseReady : BOOL;
|
||||
xBusy : BOOL;
|
||||
xError : BOOL;
|
||||
@@ -19,7 +20,6 @@ VAR
|
||||
// Connection settings
|
||||
_fbTcpConnection : FB_ClientServerConnection;
|
||||
_hSocket : T_HSOCKET;
|
||||
_xConnect : BOOL := TRUE;
|
||||
_xConnected : BOOL;
|
||||
|
||||
// Socket send
|
||||
@@ -29,20 +29,23 @@ VAR
|
||||
|
||||
// Socket receive
|
||||
_fbSocketReceive : FB_SocketReceive;
|
||||
_timReceiveTimeout : TIME := T#5S;
|
||||
_timReceiveTimeout : TIME := T#1M;
|
||||
_abyReceivedBuffer : ARRAY[0..100] OF BYTE;
|
||||
_sReceivedResponse : STRING(255);
|
||||
_udiResponseLength : UDINT;
|
||||
_udiReceivedBytes : UDINT;
|
||||
_timPollingTime : TIME := T#1S;
|
||||
_timPollingTime : TIME := T#100MS;
|
||||
_tonPollTimer : TON;
|
||||
_xEnableReceiveTimeout : BOOL;
|
||||
_timReceiveTimeoutTime : TIME := T#5S;
|
||||
_timReceiveResponseTimeout : TIME := T#5S;
|
||||
_tonReceiveTimeout : TON;
|
||||
|
||||
// Receive state machine
|
||||
_iStateReceive : INT;
|
||||
|
||||
// Command parser
|
||||
_fbParser : FB_TrayFeederParser;
|
||||
|
||||
// Command data
|
||||
_uiCmdId : UINT := 1;
|
||||
_sCmd : STRING(255);
|
||||
@@ -58,7 +61,15 @@ VAR
|
||||
_xReceivedResponseOk : BOOL;
|
||||
_uiReceivedCommandId : UINT;
|
||||
|
||||
// Alarms
|
||||
_fbWrongCmdIdAck : FB_AlarmMessage(stEventEntry := TC_EVENTS.TrayFeeder.WrongCmdIdAck, xWithConfirmation := TRUE);
|
||||
_fbResponseNotOk : FB_AlarmMessage(stEventEntry := TC_EVENTS.TrayFeeder.ReceivedResponseNotOk, xWithConfirmation := TRUE);
|
||||
_fbWrongResponseIndicator : FB_AlarmMessage(stEventEntry := TC_EVENTS.TrayFeeder.WrongResponseIndicator, xWithConfirmation := TRUE);
|
||||
_fbSocketReadError : FB_AlarmMessage(stEventEntry := TC_EVENTS.TrayFeeder.SocketReadError, xWithConfirmation := TRUE);
|
||||
_fbSocketWriteError : FB_AlarmMessage(stEventEntry := TC_EVENTS.TrayFeeder.SocketWriteError, xWithConfirmation := TRUE);
|
||||
|
||||
// Buffer before output
|
||||
_sResponse : STRING(255);
|
||||
_xBusy : BOOL;
|
||||
_xError : BOOL;
|
||||
END_VAR
|
||||
@@ -75,7 +86,7 @@ _fbTcpConnection(
|
||||
nMode:= ,
|
||||
sRemoteHost:= sIpAddr,
|
||||
nRemotePort:= udiPort,
|
||||
bEnable:= _xConnect,
|
||||
bEnable:= xConnect,
|
||||
tReconnect:= T#2S,
|
||||
bBusy=> ,
|
||||
bError=> ,
|
||||
@@ -87,7 +98,7 @@ _fbTcpConnection(
|
||||
_xConnected := (_fbTcpConnection.eState = E_SocketConnectionState.eSOCKET_CONNECTED);
|
||||
|
||||
// Receive timeout after sending a command
|
||||
_tonReceiveTimeout(IN := _xEnableReceiveTimeout, PT := _timReceiveTimeoutTime);
|
||||
_tonReceiveTimeout(IN := _xEnableReceiveTimeout, PT := _timReceiveResponseTimeout);
|
||||
|
||||
// Receive state machine
|
||||
CASE _iStateReceive OF
|
||||
@@ -121,12 +132,12 @@ CASE _iStateReceive OF
|
||||
ELSE
|
||||
_iStateReceive := 15;
|
||||
END_IF
|
||||
|
||||
END_IF
|
||||
|
||||
// If we have an error, check if we are connected
|
||||
IF _fbSocketReceive.bError THEN
|
||||
_fbSocketReceive(bExecute := FALSE);
|
||||
_fbSocketReadError.xActive := TRUE;
|
||||
_iStateReceive := 0;
|
||||
END_IF
|
||||
|
||||
@@ -148,7 +159,8 @@ CASE _iStateReceive OF
|
||||
|
||||
// Check received data
|
||||
20:
|
||||
// Check if received command is complete
|
||||
// Get command
|
||||
MEMSET(destAddr := ADR(_sReceivedResponse), fillByte := 0, n := SIZEOF(_sReceivedResponse));
|
||||
MEMCPY(destAddr := ADR(_sReceivedResponse), srcAddr := ADR(_abyReceivedBuffer), n := _udiReceivedBytes);
|
||||
_udiResponseLength := _udiReceivedBytes;
|
||||
_udiReceivedBytes := 0;
|
||||
@@ -157,6 +169,14 @@ CASE _iStateReceive OF
|
||||
// Go back to polling wait state
|
||||
_iStateReceive := 15;
|
||||
|
||||
// Error
|
||||
90:
|
||||
_xError := TRUE;
|
||||
|
||||
IF xConfirmAlarms THEN
|
||||
_fbSocketReadError.xActive := FALSE;
|
||||
_iState := 0;
|
||||
END_IF
|
||||
ELSE
|
||||
;
|
||||
END_CASE
|
||||
@@ -179,6 +199,7 @@ _xRunSMAgain := FALSE;
|
||||
|
||||
IF _xSendCmd THEN
|
||||
_xSendCmd := FALSE;
|
||||
_xCmdReceived := FALSE;
|
||||
_xBusy := TRUE;
|
||||
_iState := 20;
|
||||
END_IF
|
||||
@@ -211,6 +232,7 @@ _xRunSMAgain := FALSE;
|
||||
|
||||
IF _fbSocketSend.bError THEN
|
||||
_fbSocketSend(bExecute := FALSE);
|
||||
_fbSocketWriteError.xActive := TRUE;
|
||||
_iState := 90;
|
||||
END_IF
|
||||
|
||||
@@ -245,13 +267,15 @@ _xRunSMAgain := FALSE;
|
||||
// Check for cmd id
|
||||
IF (_sReceivedResponse[0] <> UINT_TO_BYTE(_uiCmdId+16#30)) THEN
|
||||
// Wrong command id received
|
||||
_iState := 900;
|
||||
_fbWrongCmdIdAck.xActive := TRUE;
|
||||
_iState := 90;
|
||||
END_IF
|
||||
|
||||
// For for response indicator
|
||||
IF _sReceivedResponse[1] <> F_ToASC('<') THEN
|
||||
// Wrong response indicator
|
||||
_iState := 901;
|
||||
_fbResponseNotOk.xActive := TRUE;
|
||||
_iState := 90;
|
||||
END_IF
|
||||
|
||||
// Check for correct cmd
|
||||
@@ -267,11 +291,18 @@ _xRunSMAgain := FALSE;
|
||||
_xBusy := FALSE;
|
||||
_iState := 10;
|
||||
ELSE
|
||||
_iState := 902;
|
||||
_fbResponseNotOk.xActive := TRUE;
|
||||
_iState := 90;
|
||||
END_IF
|
||||
|
||||
// Got command from tray feeder which needs to be acknowledged
|
||||
50:
|
||||
IF _sReceivedResponse[1] <> F_ToASC('<') THEN
|
||||
xNewResponseReady := TRUE;
|
||||
MEMSET(ADR(_sResponse), 0, n := SIZEOF(_sResponse));
|
||||
MEMCPY(destAddr := ADR(_sResponse), srcAddr := ADR(_sReceivedResponse)+1, n := _udiResponseLength-1);
|
||||
END_IF
|
||||
|
||||
// Copy first 11 bytes
|
||||
FOR _diCounter := 0 TO 10 DO
|
||||
_sAck[_diCounter] := _sReceivedResponse[_diCounter];
|
||||
@@ -285,15 +316,14 @@ _xRunSMAgain := FALSE;
|
||||
// Get command id
|
||||
_uiReceivedCommandId := _sReceivedResponse[0] - 16#30;
|
||||
_xRunSMAgain := TRUE;
|
||||
_iState := 60;
|
||||
_iState := 70;
|
||||
ELSE
|
||||
_xRunSMAgain := TRUE;
|
||||
_iState := 10;
|
||||
END_IF
|
||||
|
||||
|
||||
// Send ack response
|
||||
60:
|
||||
70:
|
||||
// Ack is always 11 bytes long (11 characters)
|
||||
_fbSocketSend(
|
||||
sSrvNetId:= '',
|
||||
@@ -310,7 +340,7 @@ _xRunSMAgain := FALSE;
|
||||
_fbSocketSend(bExecute := FALSE);
|
||||
_xEnableReceiveTimeout := TRUE;
|
||||
_xBusy := FALSE;
|
||||
_iState := 10;
|
||||
_iState := 80;
|
||||
END_IF
|
||||
|
||||
IF _fbSocketSend.bError THEN
|
||||
@@ -318,6 +348,13 @@ _xRunSMAgain := FALSE;
|
||||
_iState := 90;
|
||||
END_IF
|
||||
|
||||
// Parse response
|
||||
80:
|
||||
_xRunSMAgain := TRUE;
|
||||
_fbParser.M_ParseCmd(_sResponse);
|
||||
stStatus := _fbParser.stStatus;
|
||||
_iState := 10;
|
||||
|
||||
// Error
|
||||
90:
|
||||
_xError := TRUE;
|
||||
@@ -326,6 +363,10 @@ _xRunSMAgain := FALSE;
|
||||
IF xConfirmAlarms THEN
|
||||
_xError := FALSE;
|
||||
_uiRetries := 0;
|
||||
_fbWrongCmdIdAck.xActive := FALSE;
|
||||
_fbResponseNotOk.xActive := FALSE;
|
||||
_fbWrongResponseIndicator.xActive := FALSE;
|
||||
_fbSocketWriteError.xActive := FALSE;
|
||||
_iState := 0;
|
||||
END_IF
|
||||
|
||||
@@ -335,11 +376,43 @@ _xRunSMAgain := FALSE;
|
||||
UNTIL (NOT _xRunSMAgain)
|
||||
END_REPEAT
|
||||
|
||||
// Handle alarms
|
||||
_fbWrongCmdIdAck(
|
||||
xRelease:= xReleaseAlarms,
|
||||
xAcknowledge:= xConfirmAlarms);
|
||||
|
||||
_fbResponseNotOk(
|
||||
xRelease:= xReleaseAlarms,
|
||||
xAcknowledge:= xConfirmAlarms);
|
||||
|
||||
_fbWrongResponseIndicator(
|
||||
xRelease:= xReleaseAlarms,
|
||||
xAcknowledge:= xConfirmAlarms);
|
||||
|
||||
_fbSocketReadError(
|
||||
xRelease:= xReleaseAlarms,
|
||||
xAcknowledge:= xConfirmAlarms);
|
||||
|
||||
_fbSocketWriteError(
|
||||
xRelease:= xReleaseAlarms,
|
||||
xAcknowledge:= xConfirmAlarms);
|
||||
|
||||
// Copy output buffers to outputs
|
||||
stStatus := _fbParser.stStatus;
|
||||
xConnected := _xConnected;
|
||||
xBusy := _xBusy;
|
||||
xError := _xError;]]></ST>
|
||||
</Implementation>
|
||||
<Method Name="M_GetResponse" Id="{7a67e859-37fc-4044-a956-f01ee59f215c}">
|
||||
<Declaration><![CDATA[METHOD M_GetResponse : STRING(255)
|
||||
VAR_INPUT
|
||||
END_VAR
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[M_GetResponse := _sResponse;
|
||||
xNewResponseReady := FALSE;]]></ST>
|
||||
</Implementation>
|
||||
</Method>
|
||||
<Method Name="M_SendCmd" Id="{d00a8c1a-c183-4659-9c9e-be5b30566b7c}">
|
||||
<Declaration><![CDATA[METHOD M_SendCmd : BOOL
|
||||
VAR_INPUT
|
||||
@@ -364,11 +437,12 @@ END_IF
|
||||
// Create command with id
|
||||
_sCmd := CONCAT(UINT_TO_STRING(_uiCmdId), '>');
|
||||
_sCmd := CONCAT(_sCmd, sCmd);
|
||||
_iCmdLength := LEN(sCmd);
|
||||
_iCmdLength := LEN(_sCmd);
|
||||
|
||||
// start sendind command state machine
|
||||
// start sending command state machine
|
||||
_xSendCmd := TRUE;
|
||||
_xBusy := TRUE;
|
||||
xNewResponseReady := FALSE;
|
||||
|
||||
M_SendCmd := TRUE;]]></ST>
|
||||
</Implementation>
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
<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
|
||||
@@ -11,7 +12,10 @@ VAR
|
||||
_sIpAddr : STRING(15);
|
||||
_udiPort : UDINT;
|
||||
|
||||
_sResponse : STRING(255);
|
||||
|
||||
_fbProtocolHandler : FB_TFProtocol;
|
||||
_xConnect : BOOL := TRUE;
|
||||
END_VAR
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
@@ -21,6 +25,8 @@ END_VAR
|
||||
_fbProtocolHandler(
|
||||
sIpAddr:= _sIpAddr,
|
||||
udiPort:= _udiPort,
|
||||
xConnect := _xConnect,
|
||||
xReleaseAlarms := xReleaseAlarms,
|
||||
xConfirmAlarms:= xConfirmAlarms,
|
||||
xConnected=> ,
|
||||
xNewResponseReady=> ,
|
||||
@@ -28,7 +34,7 @@ _fbProtocolHandler(
|
||||
xError=> );
|
||||
|
||||
// Call isa88 base state machine
|
||||
SUPER^();]]></ST>
|
||||
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.
|
||||
@@ -59,9 +65,59 @@ _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
|
||||
]]></Declaration>
|
||||
VAR_INST
|
||||
_tonReconnect : TON;
|
||||
END_VAR]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[CASE _iSSM OF
|
||||
// Check state of connection
|
||||
@@ -74,7 +130,7 @@ _stSMConfig.xAbortingDisabled := TRUE;]]></ST>
|
||||
|
||||
// Send reset command
|
||||
10:
|
||||
IF _fbProtocolHandler.M_SendCmd('SYST-RESE') THEN
|
||||
IF _fbProtocolHandler.M_SendCmd('SYST-RESE:') THEN
|
||||
_iSSM := 20;
|
||||
ELSE
|
||||
_eCmd := E_PackMLCmd.STOP;
|
||||
@@ -83,12 +139,32 @@ _stSMConfig.xAbortingDisabled := TRUE;]]></ST>
|
||||
// Wait for reset command to be finished
|
||||
20:
|
||||
IF (NOT _fbProtocolHandler.xBusy) AND (NOT _fbProtocolHandler.xError) THEN
|
||||
M_StateComplete();
|
||||
_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>
|
||||
|
||||
271
PLC/01_Stationen/TrayFeeder/FB_TrayFeederParser.TcPOU
Normal file
271
PLC/01_Stationen/TrayFeeder/FB_TrayFeederParser.TcPOU
Normal file
@@ -0,0 +1,271 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1">
|
||||
<POU Name="FB_TrayFeederParser" Id="{d60acdcf-8e59-48d2-93a2-171510b93e18}" SpecialFunc="None">
|
||||
<Declaration><![CDATA[FUNCTION_BLOCK FB_TrayFeederParser
|
||||
VAR_INPUT
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
stStatus : ST_TrayFeederStatus;
|
||||
END_VAR
|
||||
VAR
|
||||
_stStatus : ST_TrayFeederStatus;
|
||||
END_VAR
|
||||
VAR CONSTANT
|
||||
MAX_PARAMS : UINT := 10;
|
||||
|
||||
PARAMS_SEP : STRING(1) := ';';
|
||||
VALUE_SEP : STRING(1) := '=';
|
||||
END_VAR]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[]]></ST>
|
||||
</Implementation>
|
||||
<Method Name="M_EvenSystParams" Id="{29bd9922-3af8-4120-835a-1d02226f2809}">
|
||||
<Declaration><![CDATA[METHOD PRIVATE M_EvenSystParams
|
||||
VAR_INPUT
|
||||
sParam : STRING(30);
|
||||
END_VAR
|
||||
VAR
|
||||
_sParamName : STRING(15);
|
||||
_sParamValue : STRING(15);
|
||||
|
||||
_xSplitOk : BOOL;
|
||||
END_VAR
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[_xSplitOk := FindAndSplit(
|
||||
pSeparator := ADR(VALUE_SEP), pSrcString := ADR(sParam),
|
||||
pLeftString := ADR(_sParamName), nLeftSize := SIZEOF(_sParamName),
|
||||
pRightString := ADR(_sParamValue), nRightSize := SIZEOF(_sParamValue),
|
||||
bSearchFromRight := FALSE);
|
||||
|
||||
IF _xSplitOk THEN
|
||||
// Check for parameter names
|
||||
IF 'Door' = _sParamName THEN
|
||||
IF 'Opened' = _sParamValue THEN
|
||||
_stStatus.xDoorOpen := TRUE;
|
||||
ELSIF 'Closed' = _sParamValue THEN
|
||||
_stStatus.xDoorOpen := FALSE;
|
||||
END_IF
|
||||
END_IF
|
||||
END_IF]]></ST>
|
||||
</Implementation>
|
||||
</Method>
|
||||
<Method Name="M_NoteSystParams" Id="{d4055987-9814-4c22-8525-7aafb690c294}">
|
||||
<Declaration><![CDATA[METHOD PRIVATE M_NoteSystParams
|
||||
VAR_INPUT
|
||||
sParam : STRING(30);
|
||||
END_VAR
|
||||
VAR
|
||||
_sParamName : STRING(15);
|
||||
_sParamValue : STRING(15);
|
||||
|
||||
_xSplitOk : BOOL;
|
||||
END_VAR
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[_xSplitOk := FindAndSplit(
|
||||
pSeparator := ADR(VALUE_SEP), pSrcString := ADR(sParam),
|
||||
pLeftString := ADR(_sParamName), nLeftSize := SIZEOF(_sParamName),
|
||||
pRightString := ADR(_sParamValue), nRightSize := SIZEOF(_sParamValue),
|
||||
bSearchFromRight := FALSE);
|
||||
|
||||
IF _xSplitOk THEN
|
||||
// Check for parameter names
|
||||
IF 'InpStack' = _sParamName THEN
|
||||
IF 'Empty' = _sParamValue THEN
|
||||
_stStatus.eStateInputStack := E_TFInputStackState.EMTPY;
|
||||
ELSIF 'NoMaga' = _sParamValue THEN
|
||||
_stStatus.eStateInputStack := E_TFInputStackState.NO_MAGAZINE;
|
||||
ELSIF 'AlmEmpty' = _sParamValue THEN
|
||||
_stStatus.eStateInputStack := E_TFInputStackState.ALMOST_EMPTY;
|
||||
ELSE
|
||||
_stStatus.eStateInputStack := E_TFInputStackState.UNDEFINED;
|
||||
END_IF
|
||||
ELSIF 'Opera' = _sParamName THEN
|
||||
IF 'Busy' = _sParamValue THEN
|
||||
_stStatus.eState := E_TrayFeederState.BUSY;
|
||||
END_IF
|
||||
END_IF
|
||||
END_IF]]></ST>
|
||||
</Implementation>
|
||||
</Method>
|
||||
<Method Name="M_ParseCmd" Id="{093187fd-e820-430f-868b-5e3643bdddf4}">
|
||||
<Declaration><![CDATA[METHOD M_ParseCmd
|
||||
VAR_INPUT
|
||||
sResponse : STRING(255);
|
||||
END_VAR
|
||||
VAR
|
||||
_iLength : INT;
|
||||
_sGAF : STRING(9);
|
||||
_sParams : STRING(255);
|
||||
_sParam : STRING(20);
|
||||
_sParamName : STRING(10);
|
||||
_sValue : STRING(10);
|
||||
|
||||
_xSplitResult : BOOL;
|
||||
|
||||
_uiCounter : UINT;
|
||||
END_VAR
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[// Get group and function
|
||||
_sGAF := MID(sResponse, 9, 2);
|
||||
|
||||
// Get length
|
||||
_iLength := LEN(sResponse);
|
||||
|
||||
IF 'STAT-FEED' = _sGAF THEN
|
||||
// Get parameter string
|
||||
_sParams := MID(sResponse, LEN(sResponse) - 12, 12);
|
||||
|
||||
FOR _uiCounter := 0 TO MAX_PARAMS DO
|
||||
_xSplitResult := FindAndSplit(
|
||||
pSeparator := ADR(PARAMS_SEP), pSrcString := ADR(_sParams),
|
||||
pLeftString := ADR(_sParam), nLeftSize := SIZEOF(_sParam),
|
||||
pRightString := ADR(_sParams), nRightSize := SIZEOF(_sParams),
|
||||
bSearchFromRight := FALSE);
|
||||
|
||||
IF _xSplitResult THEN
|
||||
M_StatFeedParams(_sParam);
|
||||
END_IF
|
||||
END_FOR
|
||||
RETURN;
|
||||
END_IF
|
||||
|
||||
IF 'EVEN-SYST' = _sGAF THEN
|
||||
// Get parameter string
|
||||
_sParams := MID(sResponse, LEN(sResponse) - 11, 12);
|
||||
|
||||
FOR _uiCounter := 0 TO MAX_PARAMS DO
|
||||
_xSplitResult := FindAndSplit(
|
||||
pSeparator := ADR(PARAMS_SEP), pSrcString := ADR(_sParams),
|
||||
pLeftString := ADR(_sParam), nLeftSize := SIZEOF(_sParam),
|
||||
pRightString := ADR(_sParams), nRightSize := SIZEOF(_sParams),
|
||||
bSearchFromRight := FALSE);
|
||||
|
||||
IF _xSplitResult THEN
|
||||
M_EvenSystParams(_sParam);
|
||||
END_IF
|
||||
END_FOR
|
||||
RETURN;
|
||||
END_IF
|
||||
|
||||
IF 'EVEN-INIT' = _sGAF THEN
|
||||
RETURN;
|
||||
END_IF
|
||||
|
||||
IF 'EVEN-BUTT' = _sGAF THEN
|
||||
RETURN;
|
||||
END_IF
|
||||
|
||||
IF 'EVEN-CONV' = _sGAF THEN
|
||||
RETURN;
|
||||
END_IF
|
||||
|
||||
IF 'EVEN-ELEV' = _sGAF THEN
|
||||
RETURN;
|
||||
END_IF
|
||||
|
||||
IF 'NOTE-SYST' = _sGAF THEN
|
||||
RETURN;
|
||||
END_IF
|
||||
|
||||
IF 'NOTE-CONN' = _sGAF THEN
|
||||
RETURN;
|
||||
END_IF
|
||||
|
||||
IF 'NOTE-ELEV' = _sGAF THEN
|
||||
RETURN;
|
||||
END_IF
|
||||
|
||||
IF 'INVA-SYST' = _sGAF THEN
|
||||
RETURN;
|
||||
END_IF
|
||||
|
||||
IF 'INVA-CONV' = _sGAF THEN
|
||||
RETURN;
|
||||
END_IF
|
||||
|
||||
IF 'INVA-ELEV' = _sGAF THEN
|
||||
RETURN;
|
||||
END_IF
|
||||
|
||||
IF 'INVA-COMM' = _sGAF THEN
|
||||
RETURN;
|
||||
END_IF
|
||||
|
||||
IF 'ERRO-ELEV' = _sGAF THEN
|
||||
RETURN;
|
||||
END_IF
|
||||
|
||||
IF 'ERRO-CONV' = _sGAF THEN
|
||||
RETURN;
|
||||
END_IF
|
||||
|
||||
IF 'ERRO-STAC' = _sGAF THEN
|
||||
RETURN;
|
||||
END_IF
|
||||
|
||||
IF 'ERRO-SYST' = _sGAF THEN
|
||||
RETURN;
|
||||
END_IF
|
||||
|
||||
IF 'ERRO-INIT' = _sGAF THEN
|
||||
RETURN;
|
||||
END_IF
|
||||
|
||||
IF 'ERRO-FATA' = _sGAF THEN
|
||||
RETURN;
|
||||
END_IF
|
||||
|
||||
IF 'ERRO-DISP' = _sGAF THEN
|
||||
RETURN;
|
||||
END_IF
|
||||
|
||||
stStatus := _stStatus;]]></ST>
|
||||
</Implementation>
|
||||
</Method>
|
||||
<Method Name="M_StatFeedParams" Id="{0f709e96-deb5-41d4-a649-6a94f81e2861}">
|
||||
<Declaration><![CDATA[METHOD PRIVATE M_StatFeedParams
|
||||
VAR_INPUT
|
||||
sParam : STRING(30);
|
||||
END_VAR
|
||||
VAR
|
||||
_sParamName : STRING(15);
|
||||
_sParamValue : STRING(15);
|
||||
|
||||
_xSplitOk : BOOL;
|
||||
END_VAR]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[_xSplitOk := FindAndSplit(
|
||||
pSeparator := ADR(VALUE_SEP), pSrcString := ADR(sParam),
|
||||
pLeftString := ADR(_sParamName), nLeftSize := SIZEOF(_sParamName),
|
||||
pRightString := ADR(_sParamValue), nRightSize := SIZEOF(_sParamValue),
|
||||
bSearchFromRight := FALSE);
|
||||
|
||||
IF _xSplitOk THEN
|
||||
// Check for parameter names
|
||||
IF 'Feeder' = _sParamName THEN
|
||||
IF 'LoadPos' = _sParamValue THEN
|
||||
_stStatus.eState := E_TrayFeederState.LOAD_POS;
|
||||
ELSIF 'FeedPos' = _sParamValue THEN
|
||||
_stStatus.eState := E_TrayFeederState.FEED_POS;
|
||||
ELSIF 'Busy' = _sParamValue THEN
|
||||
_stStatus.eState := E_TrayFeederState.BUSY;
|
||||
ELSIF 'Hold' = _sParamValue THEN
|
||||
_stStatus.eState := E_TrayFeederState.HOLD;
|
||||
END_IF
|
||||
ELSIF 'PickRdy' = _sParamName THEN
|
||||
IF 'True' = _sParamValue THEN
|
||||
_stStatus.xInPickPosition := TRUE;
|
||||
ELSIF 'False' = _sParamValue THEN
|
||||
_stStatus.xInPickPosition := FALSE;
|
||||
END_IF
|
||||
ELSIF 'TrayNbr' = _sParamName THEN
|
||||
_stStatus.uiActTray := STRING_TO_UINT(_sParamValue);
|
||||
END_IF
|
||||
END_IF]]></ST>
|
||||
</Implementation>
|
||||
</Method>
|
||||
</POU>
|
||||
</TcPlcObject>
|
||||
15
PLC/01_Stationen/TrayFeeder/ST_TrayFeederStatus.TcDUT
Normal file
15
PLC/01_Stationen/TrayFeeder/ST_TrayFeederStatus.TcDUT
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1">
|
||||
<DUT Name="ST_TrayFeederStatus" Id="{749afe59-cdec-4f20-a088-f36d2372ce96}">
|
||||
<Declaration><![CDATA[TYPE ST_TrayFeederStatus :
|
||||
STRUCT
|
||||
eState : E_TrayFeederState;
|
||||
xInPickPosition : BOOL;
|
||||
uiActTray : UINT;
|
||||
xDoorOpen : BOOL;
|
||||
eStateInputStack : E_TFInputStackState;
|
||||
END_STRUCT
|
||||
END_TYPE
|
||||
]]></Declaration>
|
||||
</DUT>
|
||||
</TcPlcObject>
|
||||
@@ -17,6 +17,9 @@ VAR_GLOBAL
|
||||
|
||||
// HMI Interface
|
||||
stHCPlatesHMIInterface : ST_HCStationHMIInterface;
|
||||
|
||||
// Machine HMI interface
|
||||
stMachine : ST_HMI_Machine;
|
||||
END_VAR]]></Declaration>
|
||||
</GVL>
|
||||
</TcPlcObject>
|
||||
@@ -1,20 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1">
|
||||
<DUT Name="ST_PackMLGenericHMIInterface" Id="{54cdd4b1-e09e-436e-9737-cc31548609eb}">
|
||||
<Declaration><![CDATA[TYPE ST_PackMLGenericHMIInterface :
|
||||
<DUT Name="ST_HMI_PackML" Id="{63a68e73-cb52-413d-804c-40ed071625f9}">
|
||||
<Declaration><![CDATA[TYPE ST_HMI_PackML :
|
||||
STRUCT
|
||||
stBtnAbort : ST_HMI_CONTROL_BUTTON;
|
||||
stBtnClear : ST_HMI_CONTROL_BUTTON;
|
||||
stBtnHold : ST_HMI_CONTROL_BUTTON;
|
||||
stBtnReset : ST_HMI_CONTROL_BUTTON;
|
||||
stBtnStart : ST_HMI_CONTROL_BUTTON;
|
||||
stBtnAbort : ST_HMI_CONTROL_BUTTON;
|
||||
stBtnHold : ST_HMI_CONTROL_BUTTON;
|
||||
stBtnStop : ST_HMI_CONTROL_BUTTON;
|
||||
stBtnSuspend : ST_HMI_CONTROL_BUTTON;
|
||||
stBtnUnhold : ST_HMI_CONTROL_BUTTON;
|
||||
stBtnUnsuspend : ST_HMI_CONTROL_BUTTON;
|
||||
|
||||
eCurrentMode : E_PackMLUnitMode;
|
||||
eCurrentState : E_PackMLState;
|
||||
eCurrentMode : E_PackMLUnitMode;
|
||||
END_STRUCT
|
||||
END_TYPE
|
||||
]]></Declaration>
|
||||
@@ -13,7 +13,7 @@ VAR_OUTPUT
|
||||
stAdmin : ST_PMLa;
|
||||
END_VAR
|
||||
VAR_IN_OUT
|
||||
//stHMIInterface : ST_PackMLGenericHMIInterface;
|
||||
stPackMLHMIInterface : ST_HMI_PackML;
|
||||
END_VAR
|
||||
VAR
|
||||
// State machine handler
|
||||
@@ -48,7 +48,9 @@ VAR
|
||||
END_VAR
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[// Handle command change request
|
||||
<ST><![CDATA[A_HandleHMIInput();
|
||||
|
||||
// Handle command change request
|
||||
_rtChangeCmdRequest(CLK:= stCommand.xCmdChangeRequest);
|
||||
|
||||
IF _rtChangeCmdRequest.Q THEN
|
||||
@@ -141,13 +143,178 @@ CASE stStatus.eStateCurrent OF
|
||||
ELSE
|
||||
|
||||
;
|
||||
END_CASE]]></ST>
|
||||
END_CASE
|
||||
|
||||
A_HandleHMIOutput();]]></ST>
|
||||
</Implementation>
|
||||
<Folder Name="Commands" Id="{11740802-7551-418d-83f3-5b2d5c93c299}" />
|
||||
<Folder Name="States" Id="{2cf25144-1e5c-4db8-ba57-9d98461c53ce}" />
|
||||
<Action Name="A_HandleHMIInput" Id="{723844ed-d531-4820-b577-cf5a7662c8f5}">
|
||||
<Implementation>
|
||||
<ST><![CDATA[// Handle clear button
|
||||
IF stPackMLHMIInterface.stBtnClear.xRequest THEN
|
||||
stPackMLHMIInterface.stBtnClear.xRequest := FALSE;
|
||||
|
||||
IF stPackMLHMIInterface.stBtnClear.xRelease THEN
|
||||
M_Clear();
|
||||
END_IF
|
||||
END_IF
|
||||
|
||||
// Handle reset button
|
||||
IF stPackMLHMIInterface.stBtnReset.xRequest THEN
|
||||
stPackMLHMIInterface.stBtnReset.xRequest := FALSE;
|
||||
|
||||
IF stPackMLHMIInterface.stBtnReset.xRelease THEN
|
||||
M_Reset();
|
||||
END_IF
|
||||
END_IF
|
||||
|
||||
// Handle start button
|
||||
IF stPackMLHMIInterface.stBtnStart.xRequest THEN
|
||||
stPackMLHMIInterface.stBtnStart.xRequest := FALSE;
|
||||
|
||||
IF stPackMLHMIInterface.stBtnStart.xRelease THEN
|
||||
M_Start();
|
||||
END_IF
|
||||
END_IF
|
||||
|
||||
// Handle abort button
|
||||
IF stPackMLHMIInterface.stBtnAbort.xRequest THEN
|
||||
stPackMLHMIInterface.stBtnAbort.xRequest := FALSE;
|
||||
|
||||
IF stPackMLHMIInterface.stBtnAbort.xRelease THEN
|
||||
M_Abort();
|
||||
END_IF
|
||||
END_IF
|
||||
|
||||
// Handle hold button
|
||||
IF stPackMLHMIInterface.stBtnHold.xRequest THEN
|
||||
stPackMLHMIInterface.stBtnHold.xRequest := FALSE;
|
||||
|
||||
IF stPackMLHMIInterface.stBtnHold.xRelease THEN
|
||||
M_Hold();
|
||||
END_IF
|
||||
END_IF
|
||||
|
||||
// Handle stop button
|
||||
IF stPackMLHMIInterface.stBtnStop.xRequest THEN
|
||||
stPackMLHMIInterface.stBtnStop.xRequest := FALSE;
|
||||
|
||||
IF stPackMLHMIInterface.stBtnStop.xRelease THEN
|
||||
M_Stop();
|
||||
END_IF
|
||||
END_IF
|
||||
|
||||
// Handle suspend button
|
||||
IF stPackMLHMIInterface.stBtnSuspend.xRequest THEN
|
||||
stPackMLHMIInterface.stBtnSuspend.xRequest := FALSE;
|
||||
|
||||
IF stPackMLHMIInterface.stBtnSuspend.xRelease THEN
|
||||
M_Suspend();
|
||||
END_IF
|
||||
END_IF
|
||||
|
||||
// Handle unhold button
|
||||
IF stPackMLHMIInterface.stBtnUnhold.xRequest THEN
|
||||
stPackMLHMIInterface.stBtnUnhold.xRequest := FALSE;
|
||||
|
||||
IF stPackMLHMIInterface.stBtnUnhold.xRelease THEN
|
||||
M_Unhold();
|
||||
END_IF
|
||||
END_IF
|
||||
|
||||
// Handle unsuspend button
|
||||
IF stPackMLHMIInterface.stBtnUnsuspend.xRequest THEN
|
||||
stPackMLHMIInterface.stBtnUnsuspend.xRequest := FALSE;
|
||||
|
||||
IF stPackMLHMIInterface.stBtnUnsuspend.xRelease THEN
|
||||
M_Unsuspend();
|
||||
END_IF
|
||||
END_IF]]></ST>
|
||||
</Implementation>
|
||||
</Action>
|
||||
<Action Name="A_HandleHMIOutput" Id="{73c47dbe-0382-4e83-8c9e-e4744dd66394}">
|
||||
<Implementation>
|
||||
<ST><![CDATA[]]></ST>
|
||||
<ST><![CDATA[// Handle clear button
|
||||
stPackMLHMIInterface.stBtnClear.xRelease := (stStatus.eStateCurrent = E_PackMLState.ABORTED);
|
||||
IF stStatus.eStateCurrent = E_PackMLState.CLEARING THEN
|
||||
stPackMLHMIInterface.stBtnClear.eFeedback := E_HMI_BUTTON_FEEDBACK.ACTIVE;
|
||||
ELSE
|
||||
stPackMLHMIInterface.stBtnClear.eFeedback := E_HMI_BUTTON_FEEDBACK.NONE;
|
||||
END_IF
|
||||
|
||||
// Handle reset button
|
||||
stPackMLHMIInterface.stBtnReset.xRelease := (stStatus.eStateCurrent = E_PackMLState.STOPPED) OR (stStatus.eStateCurrent = E_PackMLState.COMPLETED);
|
||||
IF stStatus.eStateCurrent = E_PackMLState.RESETTING THEN
|
||||
stPackMLHMIInterface.stBtnReset.eFeedback := E_HMI_BUTTON_FEEDBACK.ACTIVE;
|
||||
ELSE
|
||||
stPackMLHMIInterface.stBtnReset.eFeedback := E_HMI_BUTTON_FEEDBACK.NONE;
|
||||
END_IF
|
||||
|
||||
// Handle start button
|
||||
stPackMLHMIInterface.stBtnStart.xRelease := (stStatus.eStateCurrent = E_PackMLState.IDLE);
|
||||
IF stStatus.eStateCurrent = E_PackMLState.STARTING THEN
|
||||
stPackMLHMIInterface.stBtnStart.eFeedback := E_HMI_BUTTON_FEEDBACK.ACTIVE;
|
||||
ELSE
|
||||
stPackMLHMIInterface.stBtnStart.eFeedback := E_HMI_BUTTON_FEEDBACK.NONE;
|
||||
END_IF
|
||||
|
||||
// Handle abort button
|
||||
stPackMLHMIInterface.stBtnAbort.xRelease := (stStatus.eStateCurrent <> E_PackMLState.ABORTED) AND (stStatus.eStateCurrent <> E_PackMLState.ABORTING);
|
||||
IF stStatus.eStateCurrent = E_PackMLState.ABORTING THEN
|
||||
stPackMLHMIInterface.stBtnAbort.eFeedback := E_HMI_BUTTON_FEEDBACK.ACTIVE;
|
||||
ELSE
|
||||
stPackMLHMIInterface.stBtnAbort.eFeedback := E_HMI_BUTTON_FEEDBACK.NONE;
|
||||
END_IF
|
||||
|
||||
// Handle hold button
|
||||
stPackMLHMIInterface.stBtnHold.xRelease := (stStatus.eStateCurrent = E_PackMLState.EXECUTE) OR (stStatus.eStateCurrent = E_PackMLState.SUSPENDED);
|
||||
IF stStatus.eStateCurrent = E_PackMLState.HOLDING THEN
|
||||
stPackMLHMIInterface.stBtnHold.eFeedback := E_HMI_BUTTON_FEEDBACK.ACTIVE;
|
||||
ELSE
|
||||
stPackMLHMIInterface.stBtnHold.eFeedback := E_HMI_BUTTON_FEEDBACK.NONE;
|
||||
END_IF
|
||||
|
||||
// Handle stop button
|
||||
stPackMLHMIInterface.stBtnStop.xRelease := (stStatus.eStateCurrent <> E_PackMLState.ABORTED)
|
||||
AND (stStatus.eStateCurrent <> E_PackMLState.ABORTING)
|
||||
AND (stStatus.eStateCurrent <> E_PackMLState.CLEARING)
|
||||
AND (stStatus.eStateCurrent <> E_PackMLState.STOPPING)
|
||||
AND (stStatus.eStateCurrent <> E_PackMLState.STOPPED);
|
||||
|
||||
IF stStatus.eStateCurrent = E_PackMLState.STOPPING THEN
|
||||
stPackMLHMIInterface.stBtnStop.eFeedback := E_HMI_BUTTON_FEEDBACK.ACTIVE;
|
||||
ELSE
|
||||
stPackMLHMIInterface.stBtnStop.eFeedback := E_HMI_BUTTON_FEEDBACK.NONE;
|
||||
END_IF
|
||||
|
||||
// Handle suspend button
|
||||
stPackMLHMIInterface.stBtnSuspend.xRelease := (stStatus.eStateCurrent = E_PackMLState.EXECUTE);
|
||||
IF stStatus.eStateCurrent = E_PackMLState.SUSPENDING THEN
|
||||
stPackMLHMIInterface.stBtnSuspend.eFeedback := E_HMI_BUTTON_FEEDBACK.ACTIVE;
|
||||
ELSE
|
||||
stPackMLHMIInterface.stBtnSuspend.eFeedback := E_HMI_BUTTON_FEEDBACK.NONE;
|
||||
END_IF
|
||||
|
||||
// Handle unhold button
|
||||
stPackMLHMIInterface.stBtnUnhold.xRelease := (stStatus.eStateCurrent = E_PackMLState.HELD);
|
||||
IF stStatus.eStateCurrent = E_PackMLState.UNHOLDING THEN
|
||||
stPackMLHMIInterface.stBtnUnhold.eFeedback := E_HMI_BUTTON_FEEDBACK.ACTIVE;
|
||||
ELSE
|
||||
stPackMLHMIInterface.stBtnUnhold.eFeedback := E_HMI_BUTTON_FEEDBACK.NONE;
|
||||
END_IF
|
||||
|
||||
// Handle unsuspend button
|
||||
stPackMLHMIInterface.stBtnUnsuspend.xRelease := (stStatus.eStateCurrent = E_PackMLState.SUSPENDED);
|
||||
IF stStatus.eStateCurrent = E_PackMLState.UNSUSPENDING THEN
|
||||
stPackMLHMIInterface.stBtnUnsuspend.eFeedback := E_HMI_BUTTON_FEEDBACK.ACTIVE;
|
||||
ELSE
|
||||
stPackMLHMIInterface.stBtnUnsuspend.eFeedback := E_HMI_BUTTON_FEEDBACK.NONE;
|
||||
END_IF
|
||||
|
||||
// Copy mode and state
|
||||
stPackMLHMIInterface.eCurrentMode := _eMode;
|
||||
stPackMLHMIInterface.eCurrentState := stStatus.eStateCurrent;]]></ST>
|
||||
</Implementation>
|
||||
</Action>
|
||||
<Method Name="M_Abort" Id="{a8ac7d94-0639-4bcc-b083-994135ce6951}" FolderPath="Commands\">
|
||||
@@ -260,7 +427,7 @@ VAR_INPUT
|
||||
END_VAR
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[IF stStatus.eStateCurrent = E_PackMLState.STOPPED THEN
|
||||
<ST><![CDATA[IF (stStatus.eStateCurrent = E_PackMLState.STOPPED) OR (stStatus.eStateCurrent = E_PackMLState.COMPLETED) THEN
|
||||
_eCmd := E_PackMLCmd.RESET;
|
||||
M_Reset := TRUE;
|
||||
ELSE
|
||||
|
||||
@@ -28,6 +28,9 @@
|
||||
<SubType>Code</SubType>
|
||||
<ExcludeFromBuild>false</ExcludeFromBuild>
|
||||
</Compile>
|
||||
<Compile Include="00_Main\ST_HMI_Machine.TcDUT">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="00_Main\ST_PosData.TcDUT">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
@@ -110,12 +113,27 @@
|
||||
<Compile Include="01_Stationen\Kuka_Robot\ST_KukaRobot_UnitFeedbacks.TcDUT">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="01_Stationen\TrayFeeder\E_TFInputStackState.TcDUT">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="01_Stationen\TrayFeeder\E_TrayFeederState.TcDUT">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="01_Stationen\TrayFeeder\FB_StringRingbufferOwn.TcPOU">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="01_Stationen\TrayFeeder\FB_TFProtocol.TcPOU">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="01_Stationen\TrayFeeder\FB_TrayFeeder.TcPOU">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="01_Stationen\TrayFeeder\FB_TrayFeederParser.TcPOU">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="01_Stationen\TrayFeeder\ST_TrayFeederStatus.TcDUT">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="GVLs\GVL_SCADA.TcGVL">
|
||||
<SubType>Code</SubType>
|
||||
<LinkAlways>true</LinkAlways>
|
||||
@@ -159,7 +177,7 @@
|
||||
<Compile Include="LibraryCandidates\PackML\DUTs\PackTags\ST_PMLs.TcDUT">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="LibraryCandidates\PackML\DUTs\ST_PackMLGenericHMIInterface.TcDUT">
|
||||
<Compile Include="LibraryCandidates\PackML\DUTs\ST_HMI_PackML.TcDUT">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="LibraryCandidates\PackML\DUTs\ST_PackMLStateMachineConfig.TcDUT">
|
||||
@@ -296,8 +314,8 @@
|
||||
<ProjectExtensions>
|
||||
<PlcProjectOptions>
|
||||
<XmlArchive>
|
||||
<Data>
|
||||
<o xml:space="preserve" t="OptionKey">
|
||||
<Data>
|
||||
<o xml:space="preserve" t="OptionKey">
|
||||
<v n="Name">"<ProjectRoot>"</v>
|
||||
<d n="SubKeys" t="Hashtable" ckt="String" cvt="OptionKey">
|
||||
<v>{192FAD59-8248-4824-A8DE-9177C94C195A}</v>
|
||||
@@ -2945,16 +2963,16 @@
|
||||
</d>
|
||||
<d n="Values" t="Hashtable" />
|
||||
</o>
|
||||
</Data>
|
||||
<TypeList>
|
||||
<Type n="Boolean">System.Boolean</Type>
|
||||
<Type n="Hashtable">System.Collections.Hashtable</Type>
|
||||
<Type n="Int32">System.Int32</Type>
|
||||
<Type n="OptionKey">{54dd0eac-a6d8-46f2-8c27-2f43c7e49861}</Type>
|
||||
<Type n="String">System.String</Type>
|
||||
<Type n="UInt32">System.UInt32</Type>
|
||||
</TypeList>
|
||||
</XmlArchive>
|
||||
</Data>
|
||||
<TypeList>
|
||||
<Type n="Boolean">System.Boolean</Type>
|
||||
<Type n="Hashtable">System.Collections.Hashtable</Type>
|
||||
<Type n="Int32">System.Int32</Type>
|
||||
<Type n="OptionKey">{54dd0eac-a6d8-46f2-8c27-2f43c7e49861}</Type>
|
||||
<Type n="String">System.String</Type>
|
||||
<Type n="UInt32">System.UInt32</Type>
|
||||
</TypeList>
|
||||
</XmlArchive>
|
||||
</PlcProjectOptions>
|
||||
</ProjectExtensions>
|
||||
</Project>
|
||||
274
PLC/PLC.tmc
274
PLC/PLC.tmc
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user