NE (Not Equal)
Returns TRUE when inputs are not equal to each other.
The NE (Not Equal) comparison function returns TRUE when the two inputs are not equal to each other. It is the logical complement of EQ. NE is used for detecting changes in value, error conditions, and any situation where inequality indicates a required action.
Parameters
Inputs
| Name | Type | Description |
|---|---|---|
| IN1 | ANY | First value |
| IN2 | ANY | Second value |
Outputs
| Name | Type | Description |
|---|---|---|
| OUT | BOOL | TRUE when IN1 <> IN2 |
Ladder Logic Example
// Ladder Logic - NE Comparison (Error Detection) // // |----[NE]---( Error_Detected )----| // | IN1: Actual_Position | // | IN2: Commanded_Position |
Structured Text Example
Error_Detected := (Actual_Position <> Commanded_Position);
20 Production-Ready Ladder Logic Templates
Stop writing the same rungs from scratch. Get copy-paste-ready templates for motor control, PID loops, safety interlocks, conveyors, and more.
Platform-Specific Implementation
Siemens (TIA Portal)
Use CMP <> instruction in TIA Portal.
Allen-Bradley (Studio 5000)
Use NEQ (Not Equal) instruction.
CODESYS
Use <> operator in ST or NE function block.
Common Applications
- Change detection
- Error/fault identification
- Position mismatch alarms
- Value deviation alerts
Frequently Asked Questions
What is NE (Not Equal) in PLC programming?
Returns TRUE when inputs are not equal to each other. The NE (Not Equal) comparison function returns TRUE when the two inputs are not equal to each other. It is the logical complement of EQ.
What are common applications of NE (Not Equal)?
NE (Not Equal) is commonly used for: Change detection, Error/fault identification, Position mismatch alarms, Value deviation alerts.
How do I use NE (Not Equal) in different PLC platforms?
Siemens: Use CMP <> instruction in TIA Portal. Allen-Bradley: Use NEQ (Not Equal) instruction. CODESYS: Use <> operator in ST or NE function block.
Related Function Blocks
EQ (Equal)
Returns TRUE when both inputs are exactly equal.
View Reference →GT (Greater Than)
Returns TRUE when first input is strictly greater than second input.
View Reference →LT (Less Than)
Returns TRUE when first input is strictly less than second input.
View Reference →GE (Greater Than or Equal)
Returns TRUE when first input is greater than or equal to second input.
View Reference →LE (Less Than or Equal)
Returns TRUE when first input is less than or equal to second input.
View Reference →Stop Writing Ladder Logic From Scratch
Get 20 production-ready ladder logic templates for $29 -- download instantly and use them on your next project today.
Instant download - 30-day money-back guarantee - Use on unlimited projects