Reset Position

NI-Motion VI

Reset Position

Resets the axis position to the specified position, taking following error into account.

Note  If you are using this VI with an NI 7350 or NI 7390 device that you are reading positions on, it might take up to 5 ms for the application to display the most recently read position after you call this VI.

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
Primary Reset Position (0) is the reset value for the axis and its associated primary feedback resource, taking following error into account. You can reset position to any value in the total position range of –(231) to +(231–1). The value is in steps for stepper systems and counts for servo systems.
Secondary Reset Position (0) is the reset value for the optional secondary feedback resource. You can reset position to any value in the total position range of –(231) to +(231–1).
Note  For stepper closed-loop configurations, where the encoder counts per revolution is greater than the steps per revolution, the range of the position parameters is reduced by the ratio of counts/rev to steps/rev. For example, if the ratio is 4,000 counts per revolution to 2,000 steps per revolution (2:1 ratio), then the range of position parameters is divided by 2.
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.
Inp Vect indicates the source of the data for this VI. Available input vectors include immediate (0xFF), variable (0x01 through 0x78), or indirect variable (0x81 through 0xF8). Refer to Input and Return Vectors for more detailed information.
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

This function resets the axis position and the associated primary feedback position, taking following error into account, and resets the optional secondary feedback position. This means that if you reset the position to 0 and have a following error of 15, the feedback position is –15.

You can reset position to zero or any value in the 32-bit position range. You can reset the secondary feedback to the same value as the axis and primary feedback or you can reset it to a different value. If a secondary feedback resource is not in use, the corresponding reset value is ignored. If you use the same feedback device for both primary and secondary feedback, you must reset the positions to be the same value.

Note  Non-zero reset values are useful for defining a position reference offset.

Position can be reset at any time. However, it is recommended that you reset position only while the axis is stopped. An axis reset while the axis is moving does not have a repeatable reference position.

Note Note  For axes in p-command mode, ensure that the axis is not moving before calling Reset Position. Calling Reset Position when the axis is moving introduces position error into the system.

Typically, you execute the Reset Position VI one time after the Find Home and Find Index sequences of the Find Reference VI have completed successfully to set the zero position for the system and not again until the next power-up.

An ADC channel used as a primary feedback resources is reset by storing an offset value when this VI is executed. In this way, its zero reference is not lost and you can still read the actual ADC value with the Read ADCs VI.

Note  If you are doing onboard programming and are using Inp Vect to get the data this VI needs, remember that this VI reads the variables starting at the memory address pointed to by Inp Vect in the following order: Primary Reset Position, Secondary Reset Position.

Enabled breakpoints are also automatically disabled when you execute Reset Position on the corresponding axis.

Resetting position sets the value returned by steps/rev to the primary reset position.

Note  National Instruments recommends disabling gearing before resetting the position of the master axis or the slave axis. When the position of either the master axis or the slave axis is reset, the reset offset is treated as gearing offset, and the slave axis jumps to the new gear position in one PID period.

Remarks

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

NI SoftMotion Controller Considerations

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

  • The secondary reset position is ignored.
  • When you reset a slave position, gearing is not disabled.
    Note  National Instruments recommends that you do not reset the position when an axis is moving or gearing is enabled because doing so might cause the axis to jump and/or cause a following error.