Labview code, Figure 10-19. axis to axis camming, C/c++ code – National Instruments NI-Motion User Manual
Page 141: Labview code -19 c/c++ code -19

Chapter 10
Electronic Gearing and Camming
© National Instruments Corporation
10-19
LabVIEW Code
Figure 10-19. Axis to Axis Camming
C/C++ Code
The following example code is not necessarily complete, and may
not compile if copied exactly. Refer to the
examples
folder on the
NI-Motion CD for files that are complete and compile as is.
///////////////
// Main Function
void main(void)
{
// Locals
u8 boardID = 1; // Board ID as assigned by MAX
f64 bufferInterval = 0; // Ignored
// Master axis information
u8 masterAxis = 2; // Master axis ID
f64 camCycle = 70000; // Position cycle to repeat
the camming process
// Slave axis information
1
Configure Camming Master
2
Configure Buffer
3
Write Buffer
4
Enable Camming Single Axis
5
Wait in a Sequence Structure
6
Set Operation Mode
7
Load Move Constraint
8
Load Target Position
9
Start Motion
10 Wait for Move Complete
11 Enable Camming Single Axis
12 Clear Buffer
13 Motion Error Handler
1
2
3
6
7
8
13
12
11
10
9
5
4