MLCompInit

Pipe Network motion icon

 Function - Initializes a comparator Pipe Block with user-defined settings for use in a PLC Program.

Inputs

Input

Data Type

Range

Unit

Default

Description

BlockID

DINT

1 to 1024

N/A

No default

ID number of a created Comparator Pipe Block.

ModuloPosition

LREAL

0 to 1.0x10300

User units

No default

  • Value of the period of a cyclic system expressed in User units.
  • The parameter MODULO_POSITION is defined to correctly manage the periodicity (modulo) of the input values.
  • 0 (zero) indicates the input signal does not use the modulo operation.

ThroughZero

BOOL

FALSE, TRUE

N/A

No default

Through zero reference mode can be set or not:

  • TRUE: Used to properly detect a periodic threshold crossing of motions on periodic axis where the flow values are always greater than or equal to zero but lower than the Modulo Position.
    • In this mode, the flow values must first cross one period limit and then, as soon as a value is greater than or equal to the reference, the ready flag becomes true.
  • FALSE: Applies mainly to bounded motions.
    • The Comparator's ready flag is false as long as the flow value is less than the reference and becomes true as soon as the flow value is greater than or equal to the reference.

Reference

LREAL

No range

User units

No default

  • The reference position in the new Comparator object.
  • The Comparator checks if the input value of the Comparator is greater or equal to this reference value.

Outputs

Output

Data Type

Range

Unit

Description

Default (.Q)

BOOL

FALSE, TRUE

N/A

Remarks

  • Function block is automatically called if a Comparator Block is added to the Pipe Network.
    • User-defined settings are entered in the Pipe Blocks Properties screen.
  • The Transition Flag of a comparator object turns TRUE if the input position to the comparator is greater or equal to the reference.
  • The Comparator Transition Flag stays TRUE until it is reset.
  • If the input ThroughZero is set to TRUE, the system must cross zero and then the reference position before the Transition Flag is set.
  • If ThroughZero is FALSE, the Transition Flag is set immediately if the input pipe position is greater or equal to the Reference value.

  • Comparator objects are normally created in the Pipe Network using the graphical engine.
    You do not have to add MLCompInit function blocks to their programs.
    Parameters are entered directly in windows, and the code is then automatically added to the current project.

FBD Language Example

FFLD Language Example

IL Language Example

Not available.

ST Language Example

      //Initiate a created Comparator Block named “MyComp” to:
// Modulo of 360
// Require the input position to first cross 0 before the
// MLCompCheck output is triggered
// Input compared position to 45

MyComp := MLBlkCreate( 'MyComp', 'COMPARATOR' );
MLCompInit( MyComp, 360.0, TRUE, 45.0 );

See Also