Motion Library - Comparator

Name

Description

Return Type

MLCompCheck

Checks if the reference of a comparator Pipe Block has been crossed.

Returns TRUE if the reference has been crossed.

BOOL

MLCompInit

Initializes a comparator Pipe Block with user-defined settings.

BOOL

MLCompReadRef

Returns the reference position of a comparator block.

None

MLCompReset

Clears the Transition Flag of a comparator Pipe Block.

BOOL

MLCompWriteRef

Sets the reference position of a comparator block.

BOOL

Usage Example of Comparator Functions

When you call the MLCompWriteRef function, the output for MLCompCheck

becomes TRUE as soon as the input value reaches the reference.

Comparator Functions Usage

Comparator Functions Usage

The same function can also be called for a cyclic input value.

Comparator Functions Usage

Comparator Functions Usage

When the THROUGH_ZERO parameter is set to YES, the output for MLCompCheck becomes TRUE as soon as the input value reaches the reference, but not before it has passed through zero.

Comparator Functions Usage

Comparator Functions Usage

Figure 7-86: Comparator Functions Usage