Labview Code; C/C++ Code - National Instruments NI-Motion User Manual

Motion control
Table of Contents

Advertisement

LabVIEW Code

1
2
1 Load Velocity
2 Load Acceleration/Deceleration
3 Load Acceleration/Deceleration

C/C++ Code

© National Instruments Corporation
3
4
5
4 Load S-Curve Time
5 Find Reference
6 Check Reference
Figure 8-2. Find Reference Move in LabVIEW
The following example code is not necessarily complete, and may
not compile if copied exactly. Refer to 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
6
7
7 Read per Axis Status
8 Check Reference
9 Motion Error Handler
examples
8-3
Chapter 8
Reference Moves
8
folder on the
NI-Motion User Manual

Advertisement

Table of Contents
loading

Table of Contents