Load Counts/Steps per Revolution

NI-Motion VI

Load Counts/Steps per Revolution

Loads the quadrature counts or steps per revolution for an axis.

Details      Remarks

Device Compatibility

DeviceCompatibility
7330
Y
7340
Y
7344
Y
7350
Y
7390
Y
NI SoftMotion Controller for CANopen—Accelnet
Y
NI SoftMotion Controller for CANopen—Xenus
Y
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 to control.
Counts(Steps)/Rev is either the quadrature counts per revolution for the encoder mapped to the axis or the number of steps (full, half, or microstep) per motor revolution. The default is 2,000.
Unit Type is the type of information, counts or steps, to load. The default is counts.

Valid values are:

Counts—Use to define counts/revolution for a quadrature encoder.

Steps—Use to define steps/revolution for a stepper motor.

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

Use the Load Counts/Steps per Revolution VI to load any feedback value (counts or volts) per unit of measure or to load the number of steps per motor revolution. For encoders, this is typically in units of quadrature counts per motor revolution, but can be counts per inch, per cm, or per any unit of measure. For analog feedback, it can be in units of scaled voltage. Steps can be full steps, half steps, or microsteps depending upon how you have the external stepper driver and motor configured.

This parameter must be correctly loaded before you call the Load Velocity in RPM, Load Accel/Decel in RPS/sec, Load Velocity Threshold in RPM, Read Velocity in RPM, Load Move Constraints, or Find Reference VIs.

The Find Reference VI searches for the encoder index for one revolution as defined by this VI. Therefore, another useful unit of measure is counts per index period. Linear encoders often have indexes every inch or every centimeter.

Closed-loop stepper functionality relies on the ratio of counts to steps and not on the absolute values of counts or steps per revolution. For closed-loop operation, any unit of measure (UOM) that allows you to enter both counts per UOM and steps per UOM that are within their valid ranges work. Notice that this VI must be called twice: one time to set up the stepper motor steps/rev, and again to set up the quadrature encoder counts/rev.

Caution  For closed-loop stepper controllers, steps per revolution/counts per revolution must be in the range of 1/32,767 < steps/counts < 32,767.

The Load Counts/Steps per Revolution VI simply loads a scale factor that affects subsequently loaded and read back values of velocity and acceleration.

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 controller:

  • Counts(Steps)/Rev is interpreted as number of encoder counts per revolution for encoder feedback or number of ADC codes (LSBs) per revolution for analog feedback.
  • The range for the Counts(Steps)/Rev parameter is 2 to 228 – 1 with a default value of 2,000.

NI SoftMotion Controller Considerations

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

  • The range for the Counts(Steps)/Rev parameter is 1 to 231 – 1 with a default value of 1.
    Note  This parameter must be correctly loaded before you load target positions or write contour position information to the controller or camming table.
  • This VI determines the unit used when loading velocity. You must set the Counts(Steps)/Rev value to 1 to use this VI to load velocity values in counts/sec and load acceleration values in counts/sec2. If you set Counts(Steps)/Rev to any value other than 1, you must use the Load Move Constraints VI to load velocity and acceleration in counts.