Chapter 12
Synchronization
LabVIEW Code
1 Select Signal
2 Configure Breakpoint
C/C++ Code
NI-Motion User Manual
In this example, a breakpoint generates and then is re-enabled 5,000 counts
from where the move starts. The following code examples are designed to
illustrate the relative breakpoint algorithm only. These examples are not
complete.
4
1
2
3
3 Load Breakpoint Position
4 Enable Breakpoint Output
Figure 12-7. Relative Position Breakpoint with RTSI Using LabVIEW
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 axis;// Axis number
u16 csr = 0;// Communication status register
u16 axisStatus;// Axis status
i32 breakpointPosition = 5000;
//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;
12-14
5
5 Read per Axis Status
6 Motion Error Handler
folder on the
examples
6
ni.com