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

Motion control
Table of Contents

Advertisement

Chapter 14
Onboard Programs

LabVIEW Code

C/C++ Code

NI-Motion User Manual
1
2
1 Begin Program
Storage
2 Set Operation Mode
3 Load Velocity in RPM
Figure 14-7. Onboard Program Waiting for an I/O Line to Go Active
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
//Variables for modal error handling
u16 commandID;// The commandID of the function
u16 resourceID;// The resource ID
i32 errorCode;// Error code
///////////////////////////////
14-12
3
4
5
4 Load Target Position
5 Select MOMO
6 Wait on Condition
examples
6
7
8
9
7 Start Motion
8 End Program Storage
9 Motion Error Handler
folder on the
ni.com

Advertisement

Table of Contents
loading

Table of Contents