51 lines
1.6 KiB
XML
51 lines
1.6 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<TcPlcObject Version="1.1.0.1">
|
|
<POU Name="FB_Output" Id="{9711b552-d6a0-4f78-8a70-9ea977b18390}" SpecialFunc="None">
|
|
<Declaration><![CDATA[FUNCTION_BLOCK FB_Output EXTENDS FB_BaseStation
|
|
VAR_INPUT
|
|
END_VAR
|
|
VAR_OUTPUT
|
|
END_VAR
|
|
VAR
|
|
_iState : INT;
|
|
_tonAutoRemove : TON;
|
|
END_VAR
|
|
]]></Declaration>
|
|
<Implementation>
|
|
<ST><![CDATA[CASE _iState OF
|
|
// Wait for product
|
|
0:
|
|
IF _iFlowRecIdx <> -1 THEN
|
|
_iState := 10;
|
|
END_IF
|
|
|
|
// Remove product from line
|
|
10:
|
|
_tonAutoRemove(IN := TRUE, PT := T#5S);
|
|
IF _tonAutoRemove.Q THEN
|
|
_tonAutoRemove(IN := FALSE);
|
|
|
|
fbFlowRecHandler.M_RemFlowRec(iIdx := _iFlowRecIdx);
|
|
_iFlowRecIdx := -1;
|
|
_iState := 0;
|
|
END_IF
|
|
END_CASE]]></ST>
|
|
</Implementation>
|
|
<Method Name="FB_Init" Id="{ae701a9f-9b93-4e2d-8380-8e14731a8c09}">
|
|
<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#0004;]]></ST>
|
|
</Implementation>
|
|
</Method>
|
|
</POU>
|
|
</TcPlcObject> |