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

Motion control
Table of Contents

Advertisement

LabVIEW Code

1
1 Configure Gear Master
2 Load Gear Ratio
3 Enable Gearing
4 Wait
5 Load Velocity
6 Load Acceleration/Deceleration

C/C++ Code

© National Instruments Corporation
2
3
4
Figure 10-4. Tracking an Encoder Using Electronic Gearing with Superimposed Move
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 slaveAxis; // Slave axis number
u8 master; // Gear master
u16 csr = 0; // Communication status register
u16 moveComplete;
//Variables for modal error handling
u16 commandID;// The command ID of the function
u16 resourceID;// The resource ID of the function
i32 errorCode;// Error code
///////////////////////////////
Chapter 10
5
6
7
7 Set Operation Mode
8 Load Target Position
9 Start Motion
10 Wait for Move Complete
11 Enable Gearing Single Axis
12 Read per Axis Status
examples
10-5
Electronic Gearing and Camming
8
9
10
11
folder on the
NI-Motion User Manual
12

Advertisement

Table of Contents
loading

Table of Contents