Contents
NI-Motion User Manual x ni.com
C/C++ Code....................................................................................................14-6
Running, Stopping, and Pausing Onboard Programs....................................................14-8
Running an Onboard Program........................................................................ 14-8
Stopping an Onboard Program........................................................................14-8
Pausing/Resuming an Onboard Program........................................................14-8
Automatic Pausing............................................................................14-9
Single-Stepping Using Pause............................................................14-9
Conditionally Executing Onboard Programs.................................................................14-9
Onboard Program Conditional Execution Algorithm..................................... 14-11
LabVIEW Code...............................................................................................14-12
C/C++ Code....................................................................................................14-12
Using Onboard Memory and Data................................................................................ 14-14
Algorithm........................................................................................................14-15
LabVIEW Code...............................................................................................14-16
C/C++ Code....................................................................................................14-17
Branching Onboard Programs.......................................................................................14-19
Onboard Program Algorithm..........................................................................14-20
LabVIEW Code...............................................................................................14-21
C/C++ Code....................................................................................................14-22
Math Operations............................................................................................................14-24
Indirect Variables..........................................................................................................14-24
Onboard Buffers............................................................................................................14-25
Algorithm........................................................................................................14-26
Synchronizing Host Applications with Onboard Programs .......................................... 14-26
LabVIEW Code...............................................................................................14-28
C/C++ Code....................................................................................................14-30
Onboard Subroutines.....................................................................................................14-34
Algorithm........................................................................................................14-34
LabVIEW Code...............................................................................................14-35
C/C++ Code....................................................................................................14-38
Automatically Starting Onboard Programs...................................................................14-42
Changing a Time Slice..................................................................................................14-42
PART IVCreating Applications Using NI-MotionChapter 15Scanning
Connecting Straight-Line Move Segments................................................................... 15-1
Raster Scanning Using Straight Lines Algorithm...........................................15-2
LabVIEW Code...............................................................................................15-3
C/C++ Code....................................................................................................15-4