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

Motion control
Table of Contents

Advertisement

LabVIEW Code

1
3
2
4
1 Load Velocity
2 Load Acceleration/Deceleration
3 Load Acceleration/Deceleration
4 Load S-Curve Time

C/C++ Code

© National Instruments Corporation
6
7
5
5 Set Operation Mode
6 Start Motion
7 Read per Axis Status
8 Load Velocity
Figure 5-6. Velocity-Based Straight-Line 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
u16 csr = 0;// Communication status register
u16 axisStatus;// Axis status
i32 moveTime1;// Time for the 1st segment
i32 moveTime2;// Time for the 2nd segment
i32 initialTime;
i32 currentTime;
//Variables for modal error handling
u16 commandID;// The commandID of the function
u16 resourceID;// The resource ID
9
10
8
9 Start Motion
10 Read per Axis Status
11 Stop Motion
12 Motion Error Handler
examples
5-13
Chapter 5
Straight-Line Moves
11 12
folder on the
NI-Motion User Manual

Advertisement

Table of Contents
loading

Table of Contents