Enhanced Select (ESEL)
This information applies to the
CompactLogix
5370, ControlLogix
5570, Compact GuardLogix
5370, GuardLogix
5570, Compact GuardLogix
5380, CompactLogix
5380, CompactLogix
5480, ControlLogix
5580, and GuardLogix
5580 controllers.The Enhanced Select (ESEL) instruction lets you select one of as many as six inputs. Selection options include:
- Manual select (by operator or by program)
- High select
- Low select
- Median select
- Average (mean) select
Available Languages
Ladder Diagram
This instruction is not available in ladder diagram logic.
Function Block
Structured Text
ESEL(ESEL_tag);
Operands
Function Block
Operand | Type | Format | Description |
ESEL tag | SELECT_ENHANCED | Structure | ESEL structure |
SELECT_ENHANCED Structure
Input Parameter | Data Type | Description |
EnableIn | BOOL | Enable input. If false, the instruction does not execute and outputs are not updated.
Default is true. |
In1 | REAL | The first analog signal input to the instruction.
Valid = any float
Default = 0.0 |
In2 | REAL | The second analog signal input to the instruction.
Valid = any float
Default = 0.0 |
In3 | REAL | The third analog signal input to the instruction.
Valid = any float
Default = 0.0 |
In4 | REAL | The fourth analog signal input to the instruction.
Valid = any float
Default = 0.0 |
In5 | REAL | The fifth analog signal input to the instruction.
Valid = any float
Default = 0.0 |
In6 | REAL | The sixth analog signal input to the instruction.
Valid = any float
Default = 0.0 |
In1Fault | BOOL | Bad health indicator for In1. If In1 is read from an analog input, then In1Fault is normally controlled by the fault status on the analog input. If all the InnFault inputs are true, the instruction sets the appropriate bit in Status, the control algorithm is not executed, and Out is not updated.
Default = false |
In2Fault | BOOL | Bad health indicator for In2. If In2 is read from an analog input, then In2Fault is normally controlled by the fault status on the analog input. If all the InnFault inputs are true, the instruction sets the appropriate bit in Status, the control algorithm is not executed, and Out is not updated.
Default = false |
In3Fault | BOOL | Bad health indicator for In3. If In3 is read from an analog input, then In3Fault is normally controlled by the fault status on the analog input. If all the InnFault inputs are true, the instruction sets the appropriate bit in Status, the control algorithm is not executed, and Out is not updated.
Default = false |
In4Fault | BOOL | Bad health indicator for In4. If In4 is read from an analog input, then In4Fault is normally controlled by the fault status on the analog input. If all the InnFault inputs are true, the instruction sets the appropriate bit in Status, the control algorithm is not executed, and Out is not updated.
Default = false |
In5Fault | BOOL | Bad health indicator for In5. If In5 is read from an analog input, then In5Fault is normally controlled by the fault status on the analog input. If all the InnFault inputs are true, the instruction sets the appropriate bit in Status, the control algorithm is not executed, and Out is not updated.
Default = false |
In6Fault | BOOL | Bad health indicator for In6. If In6 is read from an analog input, then In6Fault is normally controlled by the fault status on the analog input. If all the InnFault inputs are true, the instruction sets the appropriate bit in Status, the control algorithm is not executed, and Out is not updated.
Default = false |
InsUsed | DINT | Number of inputs used. This defines the number of inputs the instruction uses. The instruction considers only In1 through In InsUsed in high select, low select, median select, and average select modes. If this value is invalid, the instruction sets the appropriate bit in status. The instruction does not update Out if InsUsed is invalid and if the instruction is not in manual select mode and if Override is cleared.
Valid =1 to 6
Default = 1 |
Selector Mode | DINT | Selector mode input. This value determines the action of the instruction. 0 = manual select 1 = High select 2 = Low select 3 = Median select 4 = Average select If this value is invalid, the instruction sets the appropriate bit in Status and does not update Out.
Valid = 0 to 4
Default = 0 |
ProgSelector | DINT | Program selector input. When the selector mode is manual select and the instruction is in Program control, ProgSelector determines which input (In1-In6) to move into Out. If ProgSelector = 0, the instruction does not update Out. If ProgSelector is invalid, the instruction sets the appropriate bit in Status. If invalid and the instruction is in Program control, and the selector mode is manual select or Override is set, the instruction does not update. Out.
Valid = 0 to 6
Default = 0 |
OperSelector | DINT | Operator selector input. When the selector mode is manual select and the instruction is in Operator control, OperSelector determines which input (In1-In6) to move into Out. If OperSelector = 0, the instruction does not update Out. If OperSelector is invalid, the instruction sets the appropriate bit in Status. If invalid and the instruction is in Operator control, and the selector mode is manual select or Override is set, the instruction does not update Out.
Valid = 0 to 6
Default = 0 |
ProgProgReq | BOOL | Program program request. Set to true by the user program to request Program control. Ignored if ProgOperReq is true. Holding this true and ProgOperReq false locks the instruction into Program control.
Default is false. |
ProgOperReq | BOOL | Program operator request. Set to true by the user program to request Operator control. Holding this true locks the instruction into Operator control.
Default is false. |
ProgOverrideReq | BOOL | Program override request. Set to true by the user program to request the device to enter Override mode. In Override mode, the instruction will act as a manual select.
Default is false. |
OperProgReq | BOOL | Operator program request. Set to true by the operator interface to request Program control. The instruction clears this input to false.
Default is false. |
OperOperReq | BOOL | Operator operator request. Set to true by the operator interface to request Operator control. The instruction clears this input to false.
Default is false. |
ProgValueReset | BOOL | Reset program control values. When true, all the program request inputs are cleared to false on each execution of the instruction.
Default is false. |
Output Parameter | Data Type | Description |
EnableOut | BOOL | Indicates if instruction is enabled. Cleared to false if Out overflows. |
Out | REAL | The calculated output of the algorithm. |
SelectedIn | DINT | Number of input selected. The instruction uses this value to display the number of the input currently being placed into the output. If the selector mode is average select, the instruction sets SelectedIn = 0. |
ProgOper | BOOL | Program/Operator control indicator. Set to true when in Program control. Cleared to false when in Operator control. |
Override | BOOL | Override mode. Set to true when the instruction is in Override mode. |
Status | DINT | Status of the function block. |
InstructFault (Status.0) | BOOL | The instruction detected one of the following execution errors. This is not a minor or major controller error. Check the remaining status bits to determine what occurred. |
InsFaulted (Status.1) | BOOL | InnFault inputs for all the used Inn inputs are true. |
InsUsedInv (Status.2) | BOOL | Invalid InsUsed value. |
SelectorModeInv (Status.3) | BOOL | Invalid SelectorMode value. |
ProgSelectorInv (Status.4) | BOOL | Invalid ProgSelector value. |
OperSelectorInv (Status.5) | BOOL | Invalid OperSelector value. |
Structured Text
Operand | Type | Format | Description |
ESEL tag | SELECT_ENHANCED | structure | ESEL structure |
See Structured Text Syntax for more information on the syntax of expressions within structured text.
Description
The ESEL instruction operates as follows
Condition | Action |
SelectorMode = 0 (manual select) or
Override is true, ProgOper is false and OperSelector is not equal to 0 | Out = In[OperSelector]
SelectedIn = OperSelector |
SelectorMode = 0 (manual select) or
Override is true, ProgOper is true and ProgSelector is not equal to 0 | Out = In[ProgSelector]
SelectedIn = ProgSelector |
SelectorMode = 1 (high select) and
Override is false | Out = maximum of In[InsUsed]
SelectedIn = index to the maximum input value |
SelectorMode = 2 (low select) and
Override is false | Out = minimum of In[InsUsed]
SelectedIn = index to the minimum input value |
SelectorMode = 3 (median select) and
Override is false | Out = median of In[InsUsed]
SelectedIn = index to the median input value |
SelectorMode = 4 (average select) and
Override is false | Out = average of In[InsUsed]
SelectedIn = 0 |
For SelectorMode 1 through 4, a bad health indication for any of the inputs causes that bad input to be disregarded in the selection. For example, if SelectorMode = 1 (high select) and if In6 had the highest value but had bad health, then the next highest input with good health is moved into the output.
For high or low select mode, if two inputs are equal and are high or low, the instruction outputs the first found input. For median select mode, the median value always represents a value selected from the available inputs. If more than one value could be the median, the instruction outputs the first found input.
Switch Between Program Control and Operator Control
The following diagram shows how the ESEL instruction changes between Program control and Operator control.
(1) You can lock the instruction in Operator control mode by leaving ProgOperReq true.
(2) You can lock the instruction in Program control mode by leaving ProgProgReq true while ProgOperReq is false.
Affects Math Status Flags
No
Major/Minor Faults
None specific to this instruction. See Common Attributes for operand-related faults.
Execution
Function Block
Condition/State | Action Taken |
Prescan | EnableIn and EnableOut bits are cleared to false. |
Tag.EnableIn is false | EnableIn and EnableOut bits are cleared to false. |
Tag.EnableIn is true | EnableIn and EnableOut bits are set to true. The instruction executes |
Instruction first run | The instruction is set to Operator control. |
Instruction first scan | N/A |
Postscan | EnableIn and EnableOut bits are cleared to false. |
Structured Text
Condition/State | Action Taken |
Prescan | See Prescan in the Function Block table. |
Normal Execution | See Tag.EnableIn is true in the Function Block table. |
Postscan | See Postscan in the Function Block table. |
Example
This ESEL instruction selects In1, In2, or In3, based on the SelectorMode. In this example, SelectorMode = 1, which means high select. The instruction determines which input value is the greatest and sets Out = greatest In.
Function Block
Structured Text
ESEL_01.In1 := analog_input1;
ESEL_01.In2 := analog_input2;
ESEL_01.In3 := analog_input3;
ESEL_01.SelectorMode := 1;
ESEL(ESEL_01);
selected_value := ESEL_01.Out;
Provide Feedback