Chapter 14 Onboard Programs
NI-Motion User Manual 14-34 ni.com
Onboard Subroutines
You can create subroutines to run as onboard programs and execute them
from within an onboard program.
Algorithm
Figure 14-19 shows an onboard program algorithm that checks the I/O line
state to determine which onboard subroutine to execute.
Figure 14-19. Onboard Subroutine Algorithm
If the I/O line is active, the main onboard program calls an onboard
subroutine that rotates the motor clockwise. If the I/O line is inactive, the
main onboard program calls an onboard subroutine that rotates the motor
to counter clockwise.
Check I/O
line state Start program 2 Wait for program 2
to complete
Start program 3
Wait for program 3
to complete
Main onboard
program