Trigger

Name

Description

MLTrigClearFlag

Clears the flag of an initiated Trigger block.

MLTrigInit

Initializes a Trigger object for use in a PLCClosed "Programmable Logic Controller" A Programmable Logic Controller, PLC, or Programmable Controller is a digital computer used for automation of industrial processes, such as control of machinery on factory assembly lines. Used to synchronize the flow of inputs from (physical) sensors and events with the flow of outputs to actuators and events program.

MLTrigIsTrigged

Checks if the selected block has been triggered.

MLTrigReadDelay

Returns the time the trigger block uses to compensate the delay of the sensorClosed A sensor is a type of transducer that converts one type of energy into another for various purposes including measurement or information transfer that captures the triggering signal.

MLTrigReadPos

Returns the position of the block at the moment when it was triggered.

MLTrigReadTime

Returns the time of the moment where the block was triggered in milliseconds.

MLTrigSetEdge

Sets the edge configuration for a trigger block (e.g., rising, falling, etc.)

MLTrigWriteDelay

Sets the time the trigger block uses to compensate for the delay introduced by the sensor that captures the triggering signal.

Example: Trigger Functions

When you call the MLTrigClearFlag function, the flag for trigger is reset to False.

When a Fast Input is set, the MLTrigIsTriggered function returns TRUE.

Then you can call the MLTrigReadPos and MLTrigReadTime functions to get more details.

Trigger Functions Usage

Figure 6-203: Trigger Functions Usage