Less Than or Equal To (LE)

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 or Equal To (LE) instruction and the operator LEQ_less or equal sign tests whether Source A is less than or equal to Source B.
TIP: In Logix Designer version 36, the mnemonic for this instruction changed from LES to LE.
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.
LEQ_f_avail lang
Structured Text
This instruction is not available in structured text.
TIP:
Use the operator LEQ_less or equal sign 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 only applicable to the CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, Compact GuardLogix 5380, and GuardLogix 5580 controllers.
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
LE
FBD_COMPARE
tag
LE 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 or equal to SourceB. Cleared to false when SourceA is greater 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 or equal to SourceB. Cleared to false when SourceA is greater than SourceB.
Affects Math Status Flags
No
Major/Minor Faults
See
LE String Compare Flow Chart
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 or equal to Source B.
Set Rung-condition-out to true
else
Clear Rung-condition-out to false.
String compare:
See
LE 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:
Set EnableOut to EnableIn
If SourceA and SourceB are not NANs and SourceA is less than or equal to 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:
If SourceA and SourceB are not NANs and SourceA is less than or equal to SourceB.
Set Dest to true
else
Clear Dest to false.
Instruction first run
N/A
Instruction first scan
N/A
Postscan
N/A
LE String Compare Flow Chart
SourceA.LEN and SourceB.LEN are handled as unsigned values.
LE_stringcompareflowchart_v33
Example
Ladder Diagram
Function Block Diagram
FBD Block
FBD Function
LEQ_f_exa
Structured Text
if value_1 <= value_2 then
light_2 := 1;
else
light_2 := 0;
end_if;
if value_3 <= ’I am EQUAL’ then
light_3 := 1;
else
light_3 := 0;
end_if;
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.