flex_find_reference

NI-Motion Functions

flex_find_reference

Device Compatibility

Device Compatibility
7330
Y
7340
Y
7344
Y
7350
Y
7390
Y
NI SoftMotion Controller for CANopen—Xenus
Y
NI SoftMotion Controller for CANopen—Accelnet
Y

Find Reference

Usage

status = flex_find_reference(u8 boardID, u8 axisOrVectorSpace, u16 axisOrVSMap, u8 searchType);

Purpose

Executes a search operation to find a reference position: home, index, center, forward limit, reverse limit, or run sequence.

Tip  Refer to the Remarks section for information about how the behavior of this function differs between controllers.

Parameters

Name Type Description
boardID u8 assigned by Measurement & Automation Explorer (MAX)
axisOrVectorSpace u8 axis or vector space selector
axisOrVSMap u16 bitmap of axes or vector spaces to find references for
searchType u8 reference position to find

Parameter Discussion

axisOrVectorSpace can select an axis (NIMC_AXIS1 through NIMC_AXIS30), vector space (NIMC_VECTOR_SPACE1 through NIMC_VECTOR_SPACE15), multiple axes (NIMC_AXIS_CTRL), or multiple vector spaces (NIMC_VECTOR_SPACE_CTRL). When simultaneously searching on multiple axes or vector spaces, the axisOrVSMap parameter indicates which axes or vector spaces are involved. On motion controllers that support fewer than thirty axes, configuring non-existent axes or vector spaces returns error –70006 (NIMC_badResourceIDOrAxisError). Refer to Axes and Vector Spaces for axis and vector space resource IDs.

axisOrVSMap is the bitmap of axes or vector spaces to search on. It is only required when multiple axes or vector spaces are selected with the axisOrVectorSpace parameter. NI-Motion ignores additional axes and vector spaces if you select non-existent axes.

When starting axes (axisOrVectorSpace = NIMC_AXIS_CTRL):

D15 ...  D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0
Axis 15 ... Axis 10 Axis 9 Axis 8 Axis 7 Axis 6 Axis 5 Axis 4 Axis 3 Axis 2 Axis 1 0

For D1 through D15:
   1 = Start axis
   0 = Do not start axis

When starting vector spaces (axisOrVectorSpace = NIMC_VECTOR_SPACE_CTRL):

D15 ...  D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0
VS 15 ... VS 10 VS 9 VS 8 VS 7 VS 6 VS 5 VS 4 VS 3 VS 2 VS 1 0

For D1 through D15:
   1 = Start vector space
   0 = Do not start vector space

To start a find on a single axis or vector space, set axisOrVectorSpace to the specified axis or vector space. The axisOrVSMap bitmap is ignored.

To start a find on multiple axes, set axisOrVectorSpace to NIMC_AXIS_CTRL and the axisOrVSMap bitmap defines the axes to start. Similarly, to start a find on multiple vector spaces, set axisOrVectorSpace to NIMC_VECTOR_SPACE_CTRL and the axisOrVSMap bitmap defines the vector spaces to start.

Note  It is not possible to combine a Find Reference on an axis and a vector space in a single use of this function. To accomplish this, create a single axis vector space and then execute a multi-vector space Find Reference.

Search Type

Value Definition Description
0 Find Home Executes a Find Home on the given set of axes.
1 Find Index Executes a Find Index on the given set of axes.
2 Find Center Finds the center of travel on a given set of axes.
3 Find Forward Limit  Finds the forward limit on a given set of axes.
4 Find Reverse Limit Finds the reverse limit on a given set of axes.
5 Run Sequence Runs the loaded Find Sequence.

Using This Function

This function returns immediately after starting the given find operation. Use this function in conjunction with Wait Reference to determine when the find operation completes and if the find was successful.

You can manually stop a search operation using MAX or by calling the Stop Motion function. When encountering a limit or home input a search operation performs a halt stop and then continues based on the Search Type. An unexpected limit condition during a find stops the sequence and generates a modal error. Refer to Errors and Error Handling for information about errors.

Note  You must set unused limit and home inputs to their inactive state using MAX or with the Enable Limits and Enable Home Inputs  functions.
Note  Forward is defined as the direction of increasing position. The Forward and Reverse Limits must be located at the proper ends of travel for Find Reference to function properly.

You can access settings for Find Reference through MAX, Load Reference Parameter, Get Reference Parameter, Set u32 and Get u32. Refer to the section about each type for a detailed description on how these settings affect a given Search Type. Most of these settings are on a per-Search Type basis.

Note  If you start a coordinate (vector) space, Find Reference actually starts the axes in the coordinate space individually, so it is not considered a vector move.

Search Types

Remarks

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

NI 73xx Controller Considerations

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

  • If your application includes a high-speed capture that takes place after a Find Reference move that finds an index, you must enable the high-speed capture after the find reference move. If your application includes a buffered high-speed capture, you must also configure the buffer after the find reference move.
  • When performing a reset position as part of a Find Reference operation, add at least one of the following to the move complete criteria to ensure that the motor is not moving when the reset position executes:
    • Add a delay after the profile complete status is true to allow sufficient time between the output and reset position for the motor to stop. Use Configure Move Complete Criteria to configure a delay.
    • Use the in-position signal as a criteria for move complete. The NI PCI-7390 controller uses this signal by default. To add this signal to the move complete criteria for controllers other than the NI PCI-7390, use Configure Motion I/O Map to map the signal to a pin and then use Write Trajectory Data to add in-position to the move complete criteria. In addition, configure the in-position range on the drive to a small enough number to ensure that the target position is reached. Refer to your drive documentation for information about configuring the in-position range on the drive.

NI SoftMotion Controller Considerations

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

You cannot execute this function on multiple axes using the NIMC_AXIS_EX_CTRL resource parameter with axes sixteen through thirty.