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:
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>
|
||||
Reference in New Issue
Block a user