FunctionMLTrigReadPosPipe Network motion icon

Description

Returns the modulo-applied position of the pipe at the moment it is triggered by the Trigger Block's selected Fast InputClosedThe inputs are taken into account at each cycle depending on the system periodicity (for example each millisecond). Under certain circumstances this can be insufficient when more accuracy is needed, or if a quick response is required from the system. To fill the gap, a drive may have some Fast Input connections (generally one or two). When an event happens that triggers a Fast Input (e.g. when a sensor sends a rising edge), the detection of a signal occurs faster (which can be 1000 times more accurate than the system periodicity). Then the timestamp associated with this input can be provided to the IPC to take corrective action. This value is only valid when TrigIsTrigged() returns TRUE. The Trigger block extrapolates the output value based on the timestampClosedA timestamp is a sequence of characters, denoting the date and/or time at which a certain event occurred of the Fast Input event to provide an accurate position even if the event occurs in the middle of a program cycle.

Once triggered, a block has to be reset before it can be triggered again. All events that are sent to a block while in a triggered state are ignored and the position and time information is lost.

MLTrigReadPos

Figure 7-118: MLTrigReadPos

Modulo Calculation: MLTrigReadPos uses the “Output Modulo Position” value of the previous block in the pipe, even if the previous pipe is configured for “No Modulo” mode. The previous block must specify a zero value for “Output Modulo Position” before setting the “Mode” to “No Modulo” to prevent a modulo operation for MLTrigReadPosPipe.

Arguments

Input

BlockID

Description

ID number of an initiated Trigger object

 

Data type

DINT

 

Range

[-2147483648, 2147483648]

 

Unit

N/A

 

Default

Output

Position

Description

Returns the position of the selected block's Axis at the moment when it was triggered

 

Data type

LREAL

 

Unit

User unit

Related Functions

MLTrigIsTrigged

MLTrigReadTime

MLTrigClearFlag

MLAxisRstFastIn

See Also

Previous Function Name

MLTrigGetPos

Example

Structured Text

//Save position of Axis when Fast Input event occurs
Trig_Position := MLTrigReadPos( PipeNetwork.TRIGGER );

Ladder Diagram

MLTrigReadPos: LD example

Function Block Diagram

MLTrigReadPos: FBD example