Configure Axis Resources

NI-Motion VI

Configure Axis Resources

Configures an axis by defining its feedback and output resources.

Details     Remarks

Device Compatibility

DeviceCompatibility
7330
Y
7340
Y
7344
Y
7350
Y
7390
Y
NI SoftMotion Controller for CANopen—Accelnet
N
NI SoftMotion Controller for CANopen—Xenus
N
Secondary Output is the number for an optional secondary output resource being mapped to the axis. This is an optional command output. Select None to configure no secondary output resource.
Secondary Feedback is the number for an optional secondary feedback resource being mapped to the axis. If a secondary feedback resource is mapped, it is used for velocity feedback (Kv). Select None to configure no secondary feedback resource. Refer to the Velocity Feedback Gain section of Load Single PID Parameter for more information about Kv.
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 is the axis for which to load PID parameters. Valid axis numbers are 1 through 15 for all NI motion controllers. On controllers with less than eight axes, configuring non-existent axes has no effect.
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.
Primary Feedback is the number for the primary feedback resource being mapped to the axis. The primary feedback resource is used for position feedback, derivative (Kd) damping, and velocity feedback (Kv) if a secondary resource is not configured. Select None to configure no primary feedback resource.
Primary output is the number for the primary output resource being mapped to the axis. This is the main command output. Select None to configure no primary output resource.
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 Configure Axis Resources VI defines the feedback and output devices for an axis. You can configure up to two feedback resources and two output resources for each axis. This flexible mapping of resources to axes allows for advanced servo and stepper configurations such as: independent velocity and position feedback devices (dual-loop control), dual DAC outputs with different offsets, and changing feedback on the fly.

The various feedback and output resources on the motion controller have different interface, performance, and functionality characteristics. This VI allows you to define the axis and tailor its performance.

The following table lists valid resources:

Resource Type 7330 7340 7350 7390
Primary Feedback Encoder/ADC Encoder/ADC Encoder/ADC Encoder
Secondary Feedback Encoder Encoder Encoder/ADC
Primary Output Stepper Stepper/DAC Stepper/DAC Stepper
Secondary Output DAC DAC
Tip  Refer to Motion Resources for more information about resource IDs.
Tip  For information about the resource IDs, refer to Motion Resources.

This VI must be called for each axis that is used by an application prior to enabling the axis. The factory default mapping of resources to axes is as follows:

Axis Primary Feedback Secondary Feedback Primary Output Secondary Output
1 0x21 (Enc 1) 0 0x31 (DAC 1) 0
2 0x22 (Enc 2) 0 0x32 (DAC 2) 0
3 0x23 (Enc 3) 0 0x33 (DAC 3) 0
4 0x24 (Enc 4) 0 0x34 (DAC 4) 0
5 0x25 (Enc 5) 0 0x35 (DAC 5) 0
6 0x26 (Enc 6) 0 0x36 (DAC 6) 0
7 0x27 (Enc 7) 0 0x37 (DAC 7) 0
8 0x28 (Enc 8) 0 0x38 (DAC 8) 0
9 0x29 (Enc 9) 0 0x39 (DAC 9) 0
10 0x3A (Enc 10) 0 0x4A (DAC 10) 0
11 0x3B (Enc 11) 0 0x4B (DAC 11) 0
12 0x3C (Enc 12) 0 0x4C (DAC 12) 0
13 0x3D (Enc 13) 0 0x4D (DAC 13) 0
14 0x3E (Enc 14) 0 0x4E (DAC 14) 0
15 0x3F (Enc 15) 0 0x4F (DAC 15) 0

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:

  • If you are using a 7330, 7340, or 7390 motion controller, you cannot configure an axis when any axes are enabled. You must first disable all axes using the Enable Axes VI.
  • To change feedback on the fly (NI 7350 controllers only), call this function when the axis is not moving (move complete).
Note Note  The feedback resources used for switching feedback on the fly must meet the following conditions:
  • The feedback device must be enabled.
  • The feedback device being switched to must not be used by another axis.
Refer to Switching Feedback on the Fly in the NI-Motion Help for detailed information about configuring your system to switch between two feedback devices.

Example 1

To change axis 3 to use the fourth encoder channel and the first DAC output, call the Configure Axis Resources VI with the following configuration:

Axis Primary Feedback Secondary Feedback Primary Output Secondary Output
3 0x24 (Enc 4) 0 0x31 (DAC 1) 0

To avoid potential contention for output resources, this VI always honors the configuration of the last time it is called. In this example, both axis 1 (by default) and axis 3 want to use DAC 1. Similarly, both axis 4 (by default) and axis 3 want to use encoder 4. To avoid contention, DAC 1 is assigned to axis 3 and removed from axis 1, and encoder 4 is assigned to axis 3 and removed from axis 4, resulting in the following configuration:

Axis Primary Feedback Secondary Feedback Primary Output Secondary Output
4 0 0 0x34 (DAC 4) 0
6 0x21 (Enc 1) 0 0 0

You must now call this VI again to configure axis 4 with a different feedback resource and axis 1 with a different output resource.

Example 2

To configure axis 2 for dual-loop control you can use the following parameters:

Axis Primary Feedback Secondary Feedback Primary Output Secondary Output
2 0x51 (ADC 1) 0x22 (Enc 2) 0x32 (DAC 2) 0

In this example, an ADC channel is used for the primary position feedback (kp, ki, kd) while an encoder is used for the secondary velocity feedback. This application typically uses velocity feedback (Kv) from the encoder for stability. Refer to Load Single PID Parameter for information about setting Kv.

NI SoftMotion Controller Considerations

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

  • When you are using the NI SoftMotion Controller, you cannot map an axis resource to another axis. For example, encoder 3 (0X23) cannot be mapped to axis 1.
  • To enable dual-loop feedback on the NI SoftMotion Controller, your motion control system must include a second encoder on the axis. Otherwise, an error is returned.

    Refer to Motion Resources for information about the secondary encoder and ADC resource IDs. For example, to configure the secondary encoder for axis 1, set Secondary Feedback to 0x71. To enable dual-loop feedback on axis 1, set Primary Feedback to 0x21 and set the Secondary Feedback to 0x71.