National Instruments NI-Motion Home Safety Product User Manual


 
Chapter 12 Synchronization
NI-Motion User Manual 12-18 ni.com
LabVIEW Code
Figure 12-10. Periodic Breakpoint Output
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)
{
u8 boardID; //Board Identification number
u8 axis; // Axis
u16 csr* 0; // Communication Status Register
u8 profileStatus; // Profile Complete Status
u8 bpStatus; // Breakpoint found Status
i32 bpPos; // Breakpoint Position
i32 bpPer; // Breakpoint Period
i32 targetPos; // Target Position
i32 currentPos; // Current Position
u16 axisStatus; // Status of the axis
1 Configure Breakpoint
2 Load Breakpoint Position
3 Load Breakpoint Modulus
4 Enable Breakpoint Output
5 Load Target Position
6 Start Motion
7 Read per Axis Status
8 Motion Error Handler
865
71 2 3 4