Chapter 14 Onboard Programs
NI-Motion User Manual 14-26 ni.com
Buffers are created from a dynamic pool of memory, so you must free the
memory when the buffer is not required. This same pool of memory is used
to store onboard programs in RAM. As the number or size of buffers
increases, the available memory for storing onboard programs decreases.
Algorithm
Figure 14-14 shows the algorithm for using onboard buffers to store data.
Figure 14-14. Onboard Buffer Algorithm
Synchronizing Host Applications with Onboard Programs
The host and the onboard program can write to the move complete status
(MCS) register using the Set Status MOMO function. This function
controls the upper three bits in the MCS register using the
MustOn/MustOff (MOMO) protocol.
Use these bits to synchronize an application running on the host computer
with an onboard program, as shown in Figure14-15.
Create a buffer
on the motion controller
Configure high-speed
capture
Read buffer (optional)
Read captured positions to free the
buffer for more data to be written
Check the buffer on device
(optional)
Check number of captured
positions available to read
Loop checking for captured data array usage
Set the buffer type to be high-speed
capture positions
Total Points is the total number of
high-speed capture positions you
want to load
Buffer Size is the size of the buffer you
want to create on the device
Set Old Data Stop to TRUE if you do not
want old data to be used
Requested Interval = 0
Read captured position