MLCompWriteRef

Pipe Network motion icon

 FunctionClosed A function calculates a result according to the current value of its inputs. A function has no internal data and is not linked to declared instances. - Set the reference position of a comparator block.

Inputs

Input

Data Type

Range

Unit

Default

Description

BlockID

DINT

-2147483648 to 2147483648

N/A

No default

ID number of an initiated Comparator object.

ThroughZero

BOOL

0, 1

N/A

No default

  • When TRUE, the system must cross zero and then the reference position before the Transition Flag is set.
  • When FALSE, the Transition Flag is set immediately if the input pipe position is greater then or equal to the Reference value.

Reference

LREAL

No range

User units

No default

New reference position to set in the selected Comparator object.

Outputs

Output

Data Type

Range

Unit

Default

Description

Default (.Q)

BOOL

No range

N/A

No default

Returns TRUE when function starts to execute.

See Function - General Rules for more information.

Remarks

  • 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, system must cross zero and then the reference position before the Transition Flag is set.
  • If ThroughZero is FALSE, Transition Flag is set immediately if the input pipe position is greater then or equal to the Reference value.

MLCompWriteRef

Figure 7-88: MLCompWriteRef

FBD Language

MLCompWriteRef: FBD example

FFLD Language

MLCompWriteRef: LD example

ST Language

//Set the Comparator Reference value 
MLCompWriteRef( PipeNetwork.MyComp , TRUE , 45 );

See Also