Equal To (EQ)

When enabled, the EQ instruction and the operator = test whether Source A is equal to Source B.
Available Languages
Ladder Diagram
EQ ladder instruction
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
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
EQ 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 equal to Source B.
Set Rung-condition-out to true
else
Clear Rung-condition-out to false.
Rung-condition-in is true
String compare:
See EQ String Compare Flow Chart.
If output is false
Clear Rung-condition-out to false
else
Set Rung-condition-out to true
Postscan
N/A
Examples
Ladder Diagram
EQ instruction ladder example
Structured Text
if value_1 = value_2 then light_a := 1; else light_a := 0; end_if; if value_3 = 'I am EQUAL' then light_b := 1; else light_b := 0; end_if;
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal