First working implementation
- Currently only with one sided gripper
This commit is contained in:
@@ -1,16 +1,61 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1">
|
||||
<POU Name="FB_Etcher" Id="{b81a122a-e5f5-475c-8ee0-2d97c1df7eb4}" SpecialFunc="None">
|
||||
<Declaration><![CDATA[FUNCTION_BLOCK FB_Etcher EXTENDS FB_StationBase
|
||||
<Declaration><![CDATA[FUNCTION_BLOCK FB_Etcher EXTENDS FB_BaseStation
|
||||
VAR_INPUT
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
END_VAR
|
||||
VAR
|
||||
_iState : INT;
|
||||
|
||||
_tonProcessDuration : TON;
|
||||
END_VAR
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[]]></ST>
|
||||
<ST><![CDATA[CASE _iState OF
|
||||
// Wait for product
|
||||
0:
|
||||
IF _iFlowRecIdx <> -1 THEN
|
||||
_xDone := FALSE;
|
||||
_xBusy := TRUE;
|
||||
_iState := 10;
|
||||
END_IF
|
||||
|
||||
// Simulate process
|
||||
10:
|
||||
_tonProcessDuration(IN := TRUE, PT := T#10S);
|
||||
IF _tonProcessDuration.Q THEN
|
||||
_tonProcessDuration(IN := FALSE);
|
||||
fbFlowRecHandler.M_ReportResult(iIdx := _iFlowRecIdx, xResult := TRUE);
|
||||
_xProdAvail := TRUE;
|
||||
_xBusy := FALSE;
|
||||
_xDone := TRUE;
|
||||
_iState := 20;
|
||||
END_IF
|
||||
|
||||
// Wait for station to be empty again
|
||||
20:
|
||||
IF _iFlowRecIdx = -1 THEN
|
||||
_iState := 0;
|
||||
END_IF
|
||||
END_CASE]]></ST>
|
||||
</Implementation>
|
||||
<Method Name="FB_Init" Id="{0669fde2-f64d-4e8f-b76d-71a71bfb6cae}">
|
||||
<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[// Set station capabilities
|
||||
_dwCapabilities := 16#0001;]]></ST>
|
||||
</Implementation>
|
||||
</Method>
|
||||
</POU>
|
||||
</TcPlcObject>
|
||||
Reference in New Issue
Block a user