Algorithm; Synchronizing Host Applications With Onboard Programs - National Instruments NI-Motion User Manual

Motion control
Table of Contents

Advertisement

Chapter 14
Onboard Programs

Algorithm

Configure high-speed
on the motion controller
Loop checking for captured data array usage
Read captured position
Check the buffer on device
Check number of captured
positions available to read
Read buffer (optional)
Read captured positions to free the
buffer for more data to be written
Synchronizing Host Applications with
Onboard Programs
NI-Motion User Manual
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.
Figure 14-14 shows the algorithm for using onboard buffers to store data.
capture
Create a buffer
(optional)
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 Figure 14-15.
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
Figure 14-14. Onboard Buffer Algorithm
14-26
ni.com

Advertisement

Table of Contents
loading

Table of Contents