Less Than or Equal To (LE)
When enabled, the LE instruction and the operator
tests whether Source A is less than or equal to Source B.
![](/content/dam/dita/en/factorytalk-design-studio/current/online-help/topics/graphics/rsl5k_leq_lessorequalsign_v32.png/_jcr_content/renditions/original)
Available Languages
Ladder Diagram
![LE ladder instruction](/content/dam/dita/en/factorytalk-design-studio/current/online-help/topics/graphics/ladder_LE.png/_jcr_content/renditions/original)
Operands
There are data conversion rules for mixing numeric data types within an instruction. See Data conversions.
Ladder Diagram
Numeric Comparison
Operand | Data Type | Format | Description |
---|---|---|---|
Source A | SINT INT DINT LINT USINT UINT UDINT ULINT REAL LREAL | immediate tag | Value to test against Source B |
Source B | SINT INT DINT LINT USINT UINT UDINT ULINT REAL LREAL | immediate tag | Value to test against Source A |
String Comparison
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 |
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 |
LE String Compare Flow Chart
SourceA.LEN and SourceB.LEN are handled as unsigned values.
![LEQ_stringcompareflowchart_v33](/content/dam/dita/en/factorytalk-design-studio/current/online-help/topics/graphics/leq_stringcompareflowchart_v33.png/_jcr_content/renditions/original)
Example
Ladder Diagram
![LE ladder example](/content/dam/dita/en/factorytalk-design-studio/current/online-help/topics/graphics/ladder_LE_example.png/_jcr_content/renditions/original)
Provide Feedback