- Studio 5000 Logix Designer
- Tasks, programs, and routines
- Add-On Instructions
- Controller Organizer
- Logical Organizer
- Alarms
- Tag-based alarms
- Tag Editor and Data Monitor
- Configure settings for Tag Editor and Data Monitor
- Equipment phases
- Equipment Sequences
- Equipment Sequence Diagrams
- Ladder Editor
- Structured Text Editor
- Sequential Function Chart Editor
- Define the steps of an SFC process
- PlantPAx instruction properties
- Controller Properties
- Editing Controller Properties
- Controller Security
- Source Protection
- License Source Protection for Routines and Add-On Instructions
- Module Information
- 1756 ControlLogix I/O Modules
- Instruction Set
High/Low Limit (HLL)
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.Available Languages
Ladder Diagram
This instruction is not available in ladder diagram logic.
Function Block

Structured Text
HLL(HLL_tag);
Operands
Function Block
Operand | Type | Format | Description |
HLL tag | HL_LIMIT | structure | HLL structure |
HL_LIMIT 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. |
In | REAL | The analog signal input to the instruction.
Valid = any float
Default = 0.0 |
HighLimit | REAL | The high limit for the Input. If SelectLimit = 0 and HighLimit ![]() Valid = HighLimit > LowLimit
Default = 0.0 |
LowLimit | REAL | The low limit for the Input. If SelectLimit = 0 and LowLimit ![]() Valid = LowLimit < HighLimit
Default = 0.0 |
SelectLimit | DINT | Select limit input. This input has three settings: 0 = Use both limits 1= Use high limit 2 = Use low limit If SelectLimit is invalid, the instruction assumes SelectLimit = 0 and sets the appropriate bit in Status.
Valid = 0 to 2
Default = 0 |
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. |
HighAlarm | BOOL | The high alarm indicator. Set to true when In ![]() |
LowAlarm | BOOL | The low alarm indicator. Set to true when In ![]() |
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. |
LimitsInv (Status.1) | BOOL | HighLimit ![]() |
SelectLimitInv (Status.2) | BOOL | The value of SelectLimit is not a 0, 1, or 2. |
Structured Text
Operand | Type | Format | Description |
HLL tag | HL_LIMIT | structure | HLL structure |
See Structured Text Syntax for more information on the syntax of expressions within structured text.
Description
The HLL instruction determines the value of the Out using these rules:
Selection | Condition | Action |
SelectLimit = 0
(use high and low limits) | In < HighLimit and
In > LowLimit | Out = In |
In ![]() | Out = HighLimit | |
In ![]() | Out = LowLimit | |
HighLimit ![]() | Out = LowLimit | |
SelectLimit = 1
(use high limit only) | In < HighLimit | Out = In |
In ![]() | Out = HighLimit | |
SelectLimit = 2
(use low limit only) | In > LowLimit | Out = In |
In ![]() | Out = LowLimit |
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 | N/A |
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 HLL instruction limits In between two values and sets HighAlarm or LowAlarm, if needed when In is outside the limits. The instruction sets Out = limited value of In.
Function Block

Structured Text
HLL_01.In := value;
HLL_01.HighLimit := high_limit;
HLL_01.LowLimit := low_limit;
HLL(HLL_01);
limited_value := HLL_01.Out;
high_alarm := HLL_01.HighAlarm;
low_alarm := HLL_01.LowAlarm;
Provide Feedback