Chapter 8 Reference Moves
© National Instruments Corporation 8-3 NI-Motion User Manual
LabVIEW Code
Figure 8-2. Find Reference Move in LabVIEW
C/C++ Code
The following example code is not necessarily complete, and may
notcompile if copied exactly. Refer to the examples folder on the
NI-Motion CD for files that are complete and compile as is.
// Main Function
void main(void){
u8 boardID;// Board identification number
u8 axis;// Axis number
f64 acceleration=100;// Acceleration value in RPS/s
f64 velocity=200;// Velocity value in RPM
u16 found, finding;// Check reference statuses
u16 axisStatus;// Axis status
u16 csr = 0;// Communication status register
i32 position;// Current position of axis
i32 scanVar;// Scan variable to read in values not
supported by
// the scanf function
1 Load Velocity
2 Load Acceleration/Deceleration
3 Load Acceleration/Deceleration
4 Load S-Curve Time
5 Find Reference
6 Check Reference
7 Read per Axis Status
8 Check Reference
9 Motion Error Handler
1 2 3 4 5 876