Designing a Host VI to Read Data in DMA Applications
- Updated2023-12-13
- 3 minute(s) read
Designing a Host VI to Read Data in DMA Applications
Designing a host VI to read data from a DMA channel is an important part of implementing a DMA application.
Choosing a Design
The following table summarizes some useful designs:
Use Case | Design | Advantages | Disadvantages |
---|---|---|---|
An application in which one or more of the following situations occur:
|
Blocking |
|
|
A data logging application where the FPGA acquires data at a known rate but the host computer reads data at an unknown or irregular rate. | Polling a variable number of elements | The host VI can read any number of elements as soon as the data becomes available to read. | Compared with the blocking design:
|
An application that requires a fixed, known amount of data to be read before continuing but must complete other tasks while waiting for data to become available. For example, consider an application that processes 1024 elements as a single frame of data but also must send commands to another target. The fixed-polling design reads data from the buffer when data is available but sends the necessary commands when it is not. This design also is useful if the FPGA acquires data at an unknown or irregular rate. |
Polling a fixed number of elements | The host VI can execute other sequential tasks while waiting for data to become available. |
|
Programming the Host VI
Consider the following FPGA VI:
This VI represents data acquisition by measuring the temperature of an FPGA device at a pre-determined rate and writing this temperature value to an FPGA DMA buffer. The following sections show example host VIs that read this data.
Blocking
Polling a Variable Number of Elements
Notice how the Number of Elements this VI reads changes based on the number of Elements Remaining after the previous read.
Polling a Fixed Number of Elements