Position Input Functions

Position input functions evaluate whether the position of the axis is at certain values.

For these input functions, the axis command mode can be Position, Velocity, or Torque. In Velocity mode and Torque mode, the command position is set equal to the feedback position every cycle, so the feedback position is used to evaluate the condition regardless of the value of the useFeedback option.

Input Function

Description

EqualPos

Evaluates to TRUE when the position of the specified axis equals the specified value, and FALSE otherwise.

The condition evaluates to TRUE when one of the following is true.

  • The axis position is between [trigger position + tolerance] and [trigger position - tolerance]. The axis position can be equal to [trigger position + tolerance] or [trigger position - tolerance].

  • The axis position from the last cycle is between [trigger position + tolerance] and [trigger position - tolerance]. The axis position from the last cycle can be equal to [trigger position + tolerance] or [trigger position - tolerance].

  • The axis position is greater than [trigger position + tolerance] and the axis position from the last cycle is less than [trigger position - tolerance]. This indicates that the axis moved past the trigger position between this cycle and the last cycle.

  • The axis position is less than [trigger position - tolerance] and the axis position from the last cycle is greater than [trigger position + tolerance]. This indicates that the axis moved past the trigger position between this cycle and the last cycle.

The tolerance is 0.5 user units by default, but can be changed by setting the enableTolerance option to 1 and setting the tolerance parameter to the desired value.

The following figure shows the movement of the axis position over several cycles. In the cycles for which the condition evaluates to TRUE, the position is shown as a red dot, and in the cycles for which the condition evaluates to FALSE, the position is shown as a black dot.

../_images/WMXDOC_FUNC_TRG_EVENTS_INPUTFUNC_image8.png

Wraparound is considered for Single Turn axes. For example, if the trigger position is 0 and the axis wraps around from position 1 to position Single Turn Encoder Count over one cycle, the condition will still evaluate to TRUE.

Parameters are specified with the EqualPos struct.

GreaterPos

Evaluates to TRUE when the position of the specified axis is greater than the specified value, and FALSE otherwise.

The condition evaluates to TRUE when one of the following is true.

  • The axis position is greater than the trigger position. The condition will not evaluate to TRUE if the axis position is equal to the trigger position.

The following figure shows the movement of the axis position over several cycles. In the cycles for which the condition evaluates to TRUE, the position is shown as a red dot, and in the cycles for which the condition evaluates to FALSE, the position is shown as a black dot.

../_images/WMXDOC_FUNC_TRG_EVENTS_INPUTFUNC_image11.png

Parameters are specified with the GreaterPos struct.

LessPos

Evaluates to TRUE when the position of the specified axis is less than the specified value, and FALSE otherwise.

The condition evaluates to TRUE when one of the following is true.

  • The axis position is less than the trigger position. The condition will not evaluate to TRUE if the axis position is equal to the trigger position.

The following figure shows the movement of the axis position over several cycles. In the cycles for which the condition evaluates to TRUE, the position is shown as a red dot, and in the cycles for which the condition evaluates to FALSE, the position is shown as a black dot.

../_images/WMXDOC_FUNC_TRG_EVENTS_INPUTFUNC_image14.png

Parameters are specified with the LessPos struct.