MLCompInit
Function - Initializes a comparator Pipe Block with user-defined settings for use in a PLC Program.
- 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 functions to their programs.
- Parameters are entered directly in pop-up windows; the code is automatically added to the current project.
Inputs
|
Input |
Data Type See Data Types. |
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 |
|
|
ThroughZero |
BOOL |
FALSE, TRUE |
N/A |
No default |
Through zero reference mode can be set or not:
|
|
Reference |
LREAL |
No range |
User units |
No default |
|
Outputs
|
Output |
Data Type See Data Types. |
Range |
Unit |
Description |
|---|---|---|---|---|
|
Default (.Q) |
BOOL |
FALSE, TRUE |
N/A |
|
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







