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

Fixed_Image

LD Language

The comparison is performed only if EN is TRUE:

Fixed_Image

Fixed_Image See also

>  <  >=  <=  =  <>


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