Using Inputs and Return Vectors with Onboard Variables

NI-Motion Functions

Using Inputs and Return Vectors with Onboard Variables

The following table provides additional information about how to use input and return vectors in conjunction with onboard variables. The table contains functions with more than one data parameter that require multiple variables when using vectors. The Maximum Variable Number column lists the highest variable number that a vector can point to and still have room for all the data without exceeding the total variable space. This table also contains notes that highlight a few special cases where the number of parameters does not equal the number of variables.




Function Name


Vector
Type


Number of
Parameters
Number of
Variables
Required
Maximum
Variable
Number
Comments
Load All PID Parameters Input 8 8 0x71
Load Velocity Filter Parameter Input  2 2 0x77
Load Velocity in RPM Input  1 2 (Note 1) 0x75 National Instruments recommends using Load Velocity for onboard variables.
Load Accel/Decel in RPS/sec Input  1 2 (Note 1) 0x75
Load Vector Space Position Input  3 3 0x76
Read Velocity in RPM Return  1 2 (Note 1) 0x75 National Instruments recommends using Read Velocity for onboard variables.
Read Vector Space Position Return  3 3 0x76
Reset Position Input  2 2 0x77
Load Circular Arc Input  3 5 (Note 2 and
Note 3)
0x74
Load Helical Arc Input  4 4 (Note 2) 0x75
Load Spherical Arc Input  5 5 (Note 2) 0x74
Load Gear Ratio Input  3 3 0x76
Load Velocity Threshold in RPM Input  1 2 (Note 1) 0x75
Load Torque Limit Input  4 4 0x75
Load Torque Offset Input  2 2 0x77
Read DAC Output Limit Status Return  2 1 (Note 4) 0x78
Read Trajectory Data Return  2 (per axis) 2 (Note 5) Note 5
Load Software Limit Positions Input  2 2 0x77
Read Axis Limit Status Return  2 1 (Note 4) 0x78
Wait on Event Return  2 2 (Note 6) 0x77

 

Note 1

RPM and RPSPS are double precision floating point values (f64). They are internally represented in IEEE floating point format in two 32-bit variables. The first variable is the least significant bit, and the second variable is the most significant bit. This format is also used in the communications packet between the host computer and the NI motion controller.

 

Note 2

While the three Arc functions take double precision floating point values (f64) for their angle parameters, these values are converted to 32 bit values (i32 and u32) before being sent to the controller. Therefore, unlike other NI-Motion functions that take floating-point values, the internal representation for each angle parameter requires only one variable.

 

Note 3

The Circular Arc and Spherical Arc functions are implemented identically on the NI motion controller. The function simply substitutes zeros for plane pitch and yaw when you call the Circular Arc function. When using variables and vectors, use the Spherical Arc function exclusively.

 

Note 4

The Read Limit Status and Read DAC Limit Status functions return the forward and reverse status bytes (u8) packed together as one 16-bit word (u16). Only one variable is required.

 

Note 5

The Read Trajectory Data function returns two values (position and velocity) per axis. The total number of variables required is therefore two times the number of axes selected with the Acquire Trajectory Data function.

 

Note 6

The Wait on Condition function can return two values, condition code and bitmapped status, to the variables specified with the return vector.