CMP
Function Block - Comparison with detailed outputs for integer inputs.
Inputs
|
Input |
Data type |
Description |
|
IN1 |
DINT |
First value. |
|
IN2 |
DINT |
Second value. |
Outputs
|
Output |
Data type |
Description |
|
LT |
BOOL |
TRUE if IN1 < IN2. |
|
EQ |
BOOL |
TRUE if IN1 = IN2. |
|
GT |
BOOL |
TRUE if IN1 > IN2. |
Remarks
In LD language, the rung input (EN) validates the operation. The rung output is the result of LT (lower than comparison).
ST Language
MyCmp is declared as an instance of CMP function block:
MyCMP (IN1, IN2);
bLT := MyCmp.LT;
bEQ := MyCmp.EQ;
bGT := MyCmp.GT;
FBD Language

LD Language
The comparison is performed only if EN is TRUE:

Created with the Personal Edition of HelpNDoc: Full-featured EPub generator

