Using the EnableIn and EnableOut Parameters

The EnableIn and EnableOut parameters that appear by default in every Add-On Instruction have behaviors that conform to the three language environments:
Ladder Diagram, Function Block Diagram, and Structured Text.

To execute the primary logic routine in any of the language environments, the EnableIn parameter must be True (1). In general, the EnableIn parameter should not be referenced by the primary logic routine within the instruction definition. The EnableOut parameter will, by default, follow the state of the EnableIn parameter but can be overridden by user logic to force the state of this Parameter.

If the EnableIn parameter of the instruction is False (0), the logic routine is not executed and the EnableOut parameter is set False (0). If an EnableInFalse routine is included in the instruction definition and it is enabled, the EnableInFalse routine will be executed.

EnableIn Parameter and Ladder Diagram

In the ladder diagram environment, the EnableIn parameter reflects the rung state on entry to the instruction. If the rung state preceding the instruction is True (1), the EnableIn parameter will be True and the primary logic routine of the instruction will be executed. Likewise, if the rung state preceding the instruction is False (0), the EnableIn parameter will be False and the primary logic routine will not be executed.

EnableIn Parameter and Function Blocks

In the function block environment, the EnableIn parameter can be manipulated by the user through its pin connection. If no connection is made, the EnableIn parameter is set True (1) when the instruction begins to execute and the primary logic routine of the instruction will be executed. If a wired connection to this parameter is False (0), the primary logic routine of the instruction will not execute. Another reference writing to the EnableIn parameter, such as a Ladder Diagram rung or a Structured Text assignment, will have no influence on the state of this parameter. Only a wired connection to this parameter’s input pin can force it to be False (0).

EnableIn Parameter and Structured Text

In the Structured Text environment, the EnableIn parameter is always set True (1) by default. The user cannot influence the state of the EnableIn parameter in a Structured Text call to the instruction. Because EnableIn is always True (1) in Structured Text, the EnableInFalse routine will never execute for an instruction call in Structured Text.


0 comments :