Overview
Trigger motion is a type of motion command that delays the execution of the motion command until the specified trigger condition is satisfied. This can eliminate the delays and jitters in the execution timing of API functions when called from a Windows application.
The following functions can be executed as trigger motion:
Trigger Type - Specifies the type of condition at which the trigger motion starts.
Trigger Axis - Specifies the axis that must satisfy the condition.
Trigger Value - Specifies an additional parameter (such as distance or time) depending on the Trigger Type.
Trigger Motion Example
For example, if the trigger type is RemainingTime, the trigger motion will execute when the motion that the trigger axis is executing has trigger value milliseconds remaining until completion.
The following code will execute a normal motion command for axis 0, and a trigger motion command for axis 1 immediately after. The trigger condition is satsified when the motion command for axis 0 finishes.
Motion::PosCommand pos;
Motion::TriggerPosCommand trigPos;
//Execute normal motion command for axis 0
pos.axis = 0;
pos.profile.type = ProfileType::Trapezoidal;
pos.profile.velocity = 10000;
pos.profile.acc = 10000;
pos.profile.dec = 10000;
pos.target = 10000;
wmxlib_CoreMotion->motion->StartMov(&pos);
//Execute trigger motion command for axis 1
trigPos.axis = 1;
trigPos.profile.type = ProfileType::Trapezoidal;
trigPos.profile.velocity = 10000;
trigPos.profile.acc = 10000;
trigPos.profile.dec = 10000;
trigPos.target = 10000;
trigPos.trigger.triggerType = TriggerType::RemainingTime;
trigPos.trigger.triggerAxis = 0;
trigPos.trigger.triggerValue = 0;
wmxlib_CoreMotion->motion->StartMov(&trigPos);
The following plots show the position and velocity of each axis when the above code is executed.

Commanded Axis is Trigger Axis Example
The trigger axis can be the same axis as the commanded axis. For example, an axis may execute a motion command, and then execute a trigger motion command that will trigger when the axis reaches a particular point in the motion command.
The following code will execute a normal motion command and a trigger motion command for the same axis. The trigger motion command will execute when the first motion command finishes.
Motion::PosCommand pos;
Motion::TriggerPosCommand trigPos;
//Execute normal motion command
pos.axis = 0;
pos.profile.type = ProfileType::Trapezoidal;
pos.profile.velocity = 10000;
pos.profile.acc = 10000;
pos.profile.dec = 10000;
pos.profile.endVelocity = 10000;
pos.target = 15000;
wmxlib_CoreMotion->motion->StartPos(&pos);
//Execute trigger motion command
trigPos.axis = 0;
trigPos.profile.type = ProfileType::Trapezoidal;
trigPos.profile.velocity = 20000;
trigPos.profile.acc = 10000;
trigPos.profile.dec = 10000;
trigPos.target = 70000;
trigPos.trigger.triggerType = TriggerType::RemainingTime;
trigPos.trigger.triggerAxis = 0;
trigPos.trigger.triggerValue = 0;
wmxlib_CoreMotion->motion->StartPos(&trigPos);
The following plots show the position and velocity of the axis when the above code is executed.
