Compare Function Block

This function compares two inputs to each other.

Figure 1: Compare - Function Block

Figure 2: Compare - Property sheet

If no inputs are connected or "null", output returns to "false".

Figure 3: Compare - Logic Diagram 1

The following comparison calculations can be made using the Compare function block:

Inputs

Input Name

Description

In A

If In A = Null, then Out = False. But if In A = Null and In B = Null and Operation = Equal, then Out = True.

This is a 32-bit floating point value

In B

(In & Par)

If In B = Null, then Out = False. But if In A = Null and In B = Null and Operation = Equal, then Out = True.

These are 32-bit floating point input slot.

Hyst On

(In & Par)

This is a hysteresis value related to In B. See schematic.

Hyst Off

(In & Par)

This is a hysteresis value related to value B. See schematic.

Start Up

(In & Par)

If the value lies within the hysteresis at the first call after the start-up, value is used as the result of the hysteresis.

Table 1: Inputs of Compare Function

Output

Output Name

Description

Out

Comparison of inputs. Result is "false" or "true".

Table 2: Output of Compare Function

Parameters

Parameter Name

Description

In B par

(In & Par)

If In B is "null", In B Par is used as parameter.

Hyst On Par

(In & Par)

It is hysteresis analog input that is used to make compare calculations.

Hyst Off Par

(In & Par)

It is hysteresis analog input that is used to make compare calculations.

Start Up Par

(In & Par)

If Start Up is "null", Start Up Par is used as parameter.

Operation

There are four operations:

  • Equal
  • Less Than
  • Greater Than
  • Between

Out Save

Master Sync Enabled : If you set it to "true" the last output will be set as output for one cycle after the controller restarts. The application can use it to return to the same state before the controller restart.

Out: To enable or disable the Out feature.

Table 3: Parameters of Compare Function

Figure 4: Compare Schematic

Figure 5: Compare Parameters


 

Equal

If (In B-On Hyst) <= In A <= (Input B + Off Hyst), output is set to "true".

Less Than

Greater Than

Between

The output is set to true, if (In B-On Hyst) < In A < (Input B + Off Hyst)

Examples:

Figure 6: Example of Brightness with Greater than

Equal Function

If In A=In B output is set to "true". On or Off Hystersis may be defined.

Figure 7: Example of Equal Function

Greater Than Function ( + hysteresis)

If In A > In B output is set to "true". On or Off Hystersis may be defined.

Figure 8: Greater Than (+ hysteresis) Function Block

Figure 9: Greater Than (+ hysteresis)Property Sheet

Less Than Function ( + hysteresis)

If In A < In B output is set to "true". On or Off Hystersis may be defined.

 

 

 

 

 

 

 

Figure 10: Less Than Function block

 

Figure 11: Less than Property Sheet

Between Function ( + hysteresis)

If In A is between InB+Hystersis & InB-Hystersis then the output is "true". otherwise "false".

Figure 12: Between Function block

 

Figure 13: Between Property Sheet

Refer to General Description for general information about IRMN4 Function Blocks.