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

Motion control
Table of Contents

Advertisement

1 Select Signal
2 Configure High-Speed Capture
3 Enable High-Speed Capture

C/C++ Code

© National Instruments Corporation
1
2
3
Figure 12-20. High-Speed Capture with RTSI Using LabVIEW
The following section includes C/C++ code for executing a high-speed
capture, as well as using RTSI to execute a high-speed capture. The
following example code is not necessarily complete, and may not compile
if copied exactly. Refer to the
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 capturedPositions[6]; // Array to store the
captured positions
i32 i;
//Variables for modal error handling
u16 commandID;// The commandID of the function
u16 resourceID;// The resource ID
i32 errorCode;// Error code
///////////////////////////////
// Set the board ID
boardID = 1;
// Set the axis number
4
4 Read per Axis Status
5 Read Captured Position
folder on the NI-Motion CD for
examples
12-35
Chapter 12
Synchronization
5
NI-Motion User Manual

Advertisement

Table of Contents
loading

Table of Contents