Set Operation Mode

NI-Motion VI

Set Operation Mode

Sets the operation mode for an axis or vector space.

Details      Remarks

Device Compatibility

Device Compatibility
7330
Y
7340
Y
7344
Y
7350
Y
7390
Y
NI SoftMotion Controller for CANopen—Accelnet
Y
NI SoftMotion Controller for CANopen—Xenus
Y
Position Mode (Absolute) selects the type of position or velocity mode for an axis or vector space.

Value Definition
0 Absolute Position
1 Relative Position
2 Velocity
3 Relative to Capture
4 Modulus Position
5 Absolute Contouring
6 Relative Contouring


These modes are described in the Using This VI section.
Board ID is a unique number assigned by Measurement & Automation Explorer (MAX) used to send and receive commands and data to or from a specific NI motion controller.
Axis or Vector Space is the axis or vector space to configure.
error in (no error) describes error conditions that occur before this VI runs. The default input of this cluster is no error. If an error already occurred, this VI returns the value of error in in error out. The VI runs normally only if no incoming error exists. Otherwise, the VI passes the error in value to error out. The error in cluster contains the following parameters:
status is TRUE if an error occurred before this VI was called, or FALSE if not. If status is TRUE, code is a nonzero error code. If status is FALSE, code is zero or a warning code.
code is a number identifying an error or warning. If status is TRUE, code is a nonzero error code. If status is FALSE, code is zero or a warning code. Use the error handler VIs to look up the meaning of this code and display the corresponding error message.
source is a string that indicates the origin of the error, if any. Typically, source is the name of the VI in which the error occurred.
Bd ID Out is provided for flow control. You can string together NI-Motion VIs by wiring the Bd ID Out terminal of one VI to the Board ID terminal of the next VI.
Resource Output is the Axis, Vector Space, ADC, or Encoder you wired into the VI. Use Resource Output to pass the resource to another VI and/or to display information about the device.
error out contains error information. If error in indicates an error, error out contains the same error information. Otherwise, it describes the error status that this VI produces.
status is TRUE if an error occurred, or FALSE if not. If status is TRUE, code is a nonzero error code. If status is FALSE, code is zero or a warning code.
code is a number identifying an error or warning. If status is TRUE, code is a nonzero error code. If status is FALSE, code is zero or a warning code. Use the error handler VIs to look up the meaning of this code and display the corresponding error message.
source is a string that indicates the origin of the error, if any. Typically, source is the name of the VI in which the error occurred.

Using This VI

The Set Operation Mode VI is used both during initialization and during normal motion control operation to configure the mode of operation for all trajectory commands to the axis or vector space specified.

Position modes are applied to all axes in a coordinate (vector) space. If you later want to operate an axis independently in a different mode from the other axes, call Set Operation Mode again on that axis.

Note  All axes in a coordinate (vector) space must have the same operation mode. If the operation modes are different on each Axis when a Start Motion or Blend Motion VI is executed, an error is generated.

The operation mode must be set or changed before any other trajectory parameters are loaded for the next move. The operation mode affects how the target position and velocity values are interpreted. Trajectory parameters loaded after a mode change are interpreted in the newly selected mode. Trajectory parameters loaded any time before a mode change do not reflect the new mode.

Note  Changing operation mode after the trajectory parameters are loaded can result in improper operation.

The five operation modes are described in the following sections:

Absolute Position

In absolute position mode, target positions are interpreted with respect to an origin, reference, or zero position. The origin is typically set at a home switch, end of travel limit switch, or encoder index position. An absolute position move uses the preprogrammed values of acceleration, deceleration, s-curve, and velocity to complete a trajectory profile with an ending position equal to the loaded absolute target position.

The length of an absolute move depends upon the loaded position and the current position when the move is started. If the target position is the same as the current position, no move occurs.

Relative Position

In relative position mode while motion is not in progress, loaded target positions are interpreted with respect to the current position at the time the value is loaded. A relative position move uses the preprogrammed values of acceleration, deceleration, s-curve, and velocity to complete a trajectory profile with an ending position equal to the sum of the loaded relative target position and the starting position.

If a relative move is started while motion is in progress, the new target position is calculated with respect to the target position of the move already in progress (considered to be the new starting position), as if that move had already completed successfully. Motion continues to the new relative position, independent of the actual position location when the new move is started.

In relative mode, the new target position is calculated and double-buffered when you execute either the Load Target Position or Load Vector Space Position VI. You must reload the relative target position each time before executing a Start or Blend Motion VI.

Velocity

In velocity mode, the axis moves at the loaded velocity until you execute a Stop Motion VI, a limit is encountered, or a new velocity is loaded and you execute a Start Motion VI. Load target positions have no effect in velocity mode. The direction of motion is determined by the sign of the loaded velocity.

You can update velocity at any time to accomplish velocity profiling. Changes in velocity while motion is in progress use the preprogrammed acceleration, deceleration, and s-curve values to control the change in velocity. You can reverse direction by changing the sign of the loaded velocity and executing a Start Motion VI.

Note  Executing a Blend Motion VI in velocity mode has no effect because the move in process never normally stops. Use the Start Motion VI to update velocity in velocity mode.

Relative-to-Capture Position

The relative-to-capture position mode is very similar to absolute position mode, except that the zero position reference (origin) is the last captured position for the axis or axes. A relative-to-capture position move uses the preprogrammed values of acceleration, deceleration, s-curve and velocity to complete a trajectory profile with an ending position equal to the sum of the loaded target position and the last captured position.

In relative-to-capture mode, the new target position is calculated and double-buffered when you execute either the Load Target Position or Load Vector Space Position VI. These VIs use existing values in the position capture register(s). You must load the target position after the capture event has occurred and before executing the Start or Blend Motion VI.

This mode is typically used in registration applications. Refer to the High-Speed Capture VIs for more information about the high-speed capture functionality of the encoder inputs. Refer to the Gearing section of the NI-Motion Help for information about using superimposed moves/registration applications. Also, refer to the Rotating Knife section of the NI-Motion Help for example code that includes superimposed moves.

Modulus Position

In modulus position mode, the loaded target position is interpreted within the boundaries of a modulus range and the direction of motion is automatically chosen to generate the shortest trajectory to the target. To load the modulus range, execute the Load Position Modulus VI.

Modulus position mode is typically used with rotary axes or for other similarly repetitive motion applications.

Example

A rotary tool changer has a modulus of 360°, such that 0°, 360°, 720°, and so on, are the same rotary position.

In modulus position mode, the present position and the target position are used to calculate the shortest trajectory to the target position. If the present position is 30° and the target position is 290°, there are two possible moves:

290–30 = 260° in the clockwise direction, or

290–360–30 = –100° in the counterclockwise direction.

Because 100° is the shortest trajectory, the tool changer moves counterclockwise to the target position of 290°.

Note  Multiple revolution moves cannot be accomplished by indicating target positions greater than the modulus value. All moves are resolved to one modulus range.

Absolute and Relative Contouring

The absolute and relative contouring modes allow you to provide the motion controller with a series of points to spline through. These modes allow you to specify arbitrary motion and velocity profiles. Velocity, acceleration, and deceleration are all determined implicitly by the contour points you provide.

Note  If you are running a contoured move with a stepper axis, it is possible that the contour velocity exceeds the maximum step rate of the controller. In this case, the controller kills the axis and sets the following error status to true. Refer to the Specifications section of your controller user manual for the maximum step rate of your controller.

In order to use contouring mode, you must also configure a buffer with the Configure Buffer VI, and fill the buffer with contouring data. Successive points in the buffer are fed to the NI motion controller automatically at the time interval, in milliseconds, that you specify. The NI motion controller then splines through the contour points. Refer to the Configure Buffer VI for more information.

All contour moves are relative, meaning that the move starts from the current position of the axis or axes. In absolute contouring mode, positions are interpreted with respect to the starting position of the contouring move. In relative contouring mode, positions are interpreted with respect to the previous position in the contouring data array.

Remarks

This section includes information about how the behavior of this VI differs among the controllers that support it.

NI 73xx Controller Considerations

The following list includes considerations you must make when you are using this VI with a 73xx motion controller:

  • NI 7330 and NI 7390 controllers do not support absolute or relative contouring.
  • NI 73xx controllers do not support the Velocity option of the Position Mode parameter for vector spaces.

NI SoftMotion Controller Considerations

The following list includes considerations you must make when you are using this VI with the NI SoftMotion Controller:

  • The NI SoftMotion Controller does not support the Modulus Position option for Position Mode.