Write Capture Compare Data

NI-Motion VI

Write Capture Compare Data

Loads position compare or position capture data for the selected axis.

Details

Device Compatibility

Device Compatibility
7330
N
7340
N
7344
N
7350
Y
7390
N
NI SoftMotion Controller for CANopen—Xenus
N
NI SoftMotion Controller for CANopen—Accelnet
N
attribute is the attribute to load. The following is the valid attribute:
  • position compare pulse width—Sets the pulse width of the position compare signal.
board in is a unique number assigned by Measurement & Automation Explorer used to send and receive commands and data to or from a specific NI motion controller.
axis in is the axis to configure with this VI.
index in is the encoder to configure. Valid value is 1 for the primary encoder.
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.
data in is a cluster of variables that contains the values for the selected attribute.
integer is 32-bit integer data.
double is 64-bit floating point data.
Boolean is Boolean data.
Based on the attribute, the correct member of data in must be set as follows:
  • For position compare pulse width set the double element of the data in cluster to the value of the desired position compare output pulse width, in seconds. For example, enter 0.00001 seconds for a 10 µs pulse width. Valid values are the default value of 0.0000002 s (200 ns) and between 0.000001 s (1 µs) and 0.065535 s (65,535 µs), in 1 µs intervals.
board out is provided for flow control. You can string together NI-Motion VIs by wiring the board out terminal of one VI to the board in terminal of the next VI.
axis out is provided for flow control. You can string together NI-Motion VIs by wiring the axis out terminal of one VI to the axis in terminal of the next VI.
index out is provided for flow control. You can string together NI-Motion VIs by wiring the index out terminal of one VI to the index in terminal of the next VI.
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 this VI to load configuration parameters for position capture and compare on the motion controller. This function allows you to set all attributes on a per axis basis.

Use the position compare pulse width attribute to configure the pulse width for position compare outputs that trigger devices with specific minimum active pulse requirements.

Note  A breakpoint across RTSI always generates an active high pulse of 200 ns duration.
Caution  The position compare (breakpoint) frequency depends on the velocity and distance between position compare outputs and is limited by the pulse width. The position compare output frequency must meet the requirements specified below for correct operation.

The position compare output pulse must not overlap with the next position compare event. If the position compare output pulse overlaps with the next position compare event, position compare generation is stopped and the position compare output is disabled. To recover from this situation change the pulse width, velocity, or distance between position compare outputs. In addition, the position compare output frequency cannot be greater than the maximum value allowed for the specified position compare type. Therefore, the position compare output frequency, in hertz, at the specified pulse width, in seconds, must conform to the following two conditions:

     AND     
Position Compare (Breakpoint) Output Type Maximum Frequency
Single 150 Hz
Buffered, PID rate of
62.5 µs to 250 µs
2 kHz
Buffered, PID rate greater
than 250 µs
1 kHz
Periodic 4 MHz