Less Than (LT)
This table lists the controllers and applications that support this instruction.
Architecture | Standard applications | Safety applications |
---|---|---|
CompactLogix 5370, ControlLogix 5570, Compact GuardLogix 5370, and GuardLogix 5570 controllers | Yes | No |
CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, Compact GuardLogix 5380, and GuardLogix 5580 controllers | Yes | Yes |
When enabled, the Less Than (LT) instruction and the operator < tests Source A is less than Source B.
TIP:
In Logix Designer version 36, the mnemonic for this instruction changed from LES to LT.
Available Languages
Ladder Diagram
Function Block Diagram
Function Block Diagram supports these elements:
FBD Block
FBD Function
TIP:
FBD Function is applicable to CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, Compact GuardLogix 5380, and GuardLogix 5580 controllers only.
Structured Text
This instruction is not available in structured text.
TIP:
Use the operator < with an expression to achieve the same result. Refer to Structured Text Syntax for more information on the syntax of expressions and assignments within structured text.
Operands
There are data conversion rules for mixing numeric data types within an instruction. See Data Conversions.
Ladder Diagram
Numeric Comparison
Operand | Data Type CompactLogix 5370, ControlLogix 5570, Compact GuardLogix 5370, and GuardLogix 5570 controllers | Data Type CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, Compact GuardLogix 5380, and GuardLogix 5580 controllers | Format | Description |
---|---|---|---|---|
Source A | SINT INT DINT REAL | SINT INT DINT LINT USINT UINT UDINT ULINT REAL LREAL TIME TIME32 LTIME DT LDT | immediate tag | Value to test against Source B |
Source B | SINT INT DINT REAL | SINT INT DINT LINT USINT UINT UDINT ULINT REAL LREAL TIME TIME32 LTIME DT LDT | immediate tag | Value to test against Source A |
TIP:
See Time and date data types for a complete description of Relative Time (LTIME, TIME, and TIME32) and Absolute Time (LDT and DT) data types.
String Comparison
TIP:
Immediate string literals are applicable to the CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, Compact GuardLogix 5380, and GuardLogix 5580 controllers only.
Operand | Data Type | Format | Description |
---|---|---|---|
Source A | String type | immediate literal value tag | String to test against Source B |
Source B | String type | immediate literal value tag | String to test against Source A |
Function Block Diagram
FBD Block
Operand | Data Type | Format | Description |
---|---|---|---|
LT | FBD_COMPARE | tag | LT structure |
FBD_COMPARE Structure
Input Members | Data Type | Description |
---|---|---|
EnableIn | BOOL | Enable input. If false, the instruction does not execute and outputs are not updated.
Default is true. |
SourceA | REAL | Value to test against SourceB |
SourceB | REAL | Value to test against SourceA |
Output Members | Data Type | Description |
---|---|---|
EnableOut | BOOL | Indicates if the instruction is enabled. |
Dest | BOOL | Set to true when SourceA is less than SourceB. Cleared to false when SourceA is not less than SourceB. |
FBD Function
TIP:
FBD Function is applicable to CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, Compact GuardLogix 5380, and GuardLogix 5580 controllers only.
Input Operands (Left Pins) | Data Type CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, Compact GuardLogix 5380, and GuardLogix 5580 controllers | Description |
---|---|---|
SourceA (top) | SINT INT DINT LINT USINT UINT UDINT ULINT REAL LREAL | Value to test against SourceB. |
SourceB (bottom) | SINT INT DINT LINT USINT UINT UDINT ULINT REAL LREAL | Value to test against SourceA. |
Output Operand (Right Pin) | Data Type | Description |
---|---|---|
Dest | BOOL | Set to true when SourceA is less than SourceB. Cleared to false when SourceA is not less than SourceB. |
See FBD Functions.
Affects Math Status Flags
No
Major/Minor Faults
See LES String Compare Flow Chart below for faults.
See Index Through Arrays for array-indexing faults.
Execution
Ladder Diagram
Condition/State | Action Taken |
---|---|
Prescan | N/A |
Rung-condition-in is false | Set Rung-condition-out to Rung-condition-in |
Rung-condition-in is true | Numeric compare: If Source A and Source B are not NANs and Source A is less than Source B. Set Rung-condition-out to true else Clear Rung-condition-out to false. |
String compare: See LES String Compare Flow Chart. If output is false Clear Rung-condition-out to false else Set Rung-condition-out to true | |
Postscan | N/A |
Function Block Diagram
FBD Block
Condition/State | Action Taken |
---|---|
Prescan | N/A |
EnableIn is false | Set EnableOut to EnableIn |
EnableIn is true | Numeric compare: If SourceA and SourceB are not NANs and SourceA is less than SourceB. Set Dest to true else Clear Dest to false. |
Instruction first run | N/A |
Instruction first scan | N/A |
Postscan | N/A |
FBD Function
TIP:
FBD Function is applicable to CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, Compact GuardLogix 5380, and GuardLogix 5580 controllers only.
Condition/State | Action Taken |
---|---|
Prescan | N/A |
Normal Scan | Numeric compare: Set EnableOut to EnableIn If SourceA and SourceB are not NANs and SourceA is less than SourceB. Set Dest to true else Clear Dest to false. |
Instruction first run | N/A |
Instruction first scan | N/A |
Postscan | N/A |
LT String Compare Flow Chart
SourceA.LEN and SourceB.LEN are handled as unsigned values.
Example
Ladder Diagram
Function Block Diagram
FBD Block
FBD Function
Structured Text
if value_1 < value_2 then
light_3 := 1;
else
light_3 := 0;
end_if;
if value_3 < ’I am EQUAL’ then
light_4 := 1;
else
light_4 := 0;
end_if;
Provide Feedback