National Instruments NI-Motion Home Safety Product User Manual


 
Chapter 10 Electronic Gearing and Camming
© National Instruments Corporation 10-19 NI-Motion User Manual
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
13121110954