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_NIO" Id="{2cf6f855-1738-40a7-bc96-4518cbb192c2}" SpecialFunc="None">
|
|
<Declaration><![CDATA[FUNCTION_BLOCK FB_NIO 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="{a2216f45-001c-4771-bc7d-1f63f2637a1e}">
|
|
<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#0008;]]></ST>
|
|
</Implementation>
|
|
</Method>
|
|
</POU>
|
|
</TcPlcObject> |