Data Acquisition using DAQ Assistant
Graphical Data Acquisition
Graphical Data Acquisition brings measurements from physical hardware into a LabVIEW program through a configured graphical interface. The DAQ Assistant lets you specify what to measure, which terminals to use, and when samples are taken. For a voltage acquisition, a sensor supplies an electrical signal, the DAQ hardware digitizes it, and the Assistant returns data your program can display or store.
Configure the measurement
A measurement task groups channels with their measurement settings and acquisition timing. A physical channel such as Dev1/ai0 identifies a device and an analog input; its name does not specify the sensor's calibration.
With compatible DAQ hardware and NI-DAQmx installed, place the DAQ Assistant Express VI on the block diagram. For a sensor that already supplies a conditioned voltage:
- Select Acquire Signals, Analog Input, then Voltage.
- Select the physical input channel or channels connected to the sensor.
- Set each channel's minimum and maximum input values.
- Match Terminal Configuration to the actual wiring and the device's connection instructions.
- Configure acquisition mode, rate, and samples to read, then test the task.
Choose a supported input range that contains the expected signal and appropriate headroom. A range that is too narrow can cause overrange readings or clipping; choosing a wider range does not amplify the signal. Input-range settings also do not replace the hardware's electrical limits. A voltage task returns volts unless you explicitly configure scaling into another unit.
Choose the acquisition mode
The acquisition mode determines whether you request individual readings, one fixed record, or ongoing sampling. Available modes depend on the device; labels can vary slightly between versions.
Mode | Timing and stopping behaviour | Typical purpose |
|---|---|---|
1 Sample (On Demand) | Software requests each reading; spacing depends on execution timing. | Occasional voltage checks. |
N Samples | A hardware clock acquires a specified number per channel, then acquisition stops. | One fixed measurement record. |
Continuous Samples | A hardware clock keeps acquiring until the task is stopped; software reads successive blocks. | Monitoring over an unspecified duration. |
Continuous mode does not make one Assistant call run forever. Your program must repeatedly read the ongoing task and stop it when finished. The required surrounding program structure is separate from these acquisition settings.
Relate rate, count, and time
The sample rate fs is the number of samples acquired per second per channel, measured in samples per second per channel, or S/s/channel. The Assistant commonly labels this setting Rate (Hz). Let N be samples per channel returned in a block and C the number of channels. For uniform sampling:
Here Δt is sample spacing, Tblock is the nominal amount of acquisition time represented by a block, and Ntotal counts individual measured values across all channels. These relations assume the stated rate is the actual rate.
For example, at 5000 S/s/channel, each channel has Δt=0.000200 s. Reading 1000 samples per channel returns blocks representing 0.200 s of acquisition. Increasing N while holding fs fixed makes each block longer; it does not increase sampling speed.
In continuous mode, N/fs is also the time needed to generate a fresh block. An individual read may return sooner if samples are already buffered, or later because of transfer and software overhead.
Check the returned data
Wire the Assistant's data output to a compatible indicator or downstream operation. Confirm channel count, units, plausible amplitudes, and timing before trusting a recording. Read continuous data fast enough on average to keep up with acquisition; otherwise unread samples accumulate and can eventually overflow the buffer. Increasing buffer capacity provides more tolerance for delays, but does not fix a sustained read-rate shortfall.
What to remember
- Match measurement type, physical channels, range, and wiring.
- Choose finite acquisition for one record and continuous acquisition for ongoing sampling.
- Rate and sample count are per channel; multiply by channel count only for total values.
- Distinguish sample spacing, nominal block duration, and endpoint span.
Example: Capturing a two-sensor voltage record
You are using Graphical Data Acquisition to record two conditioned pressure-sensor voltage outputs on a test bench. They are connected to Dev1/ai0 and Dev1/ai1 using the manufacturer's differential wiring instructions. Each output stays between 0.6 V and 4.4 V. The device supports differential acquisition on these channels and input ranges of 0 to 5 V and −10 to 10 V.
Capture one record with a nominal duration of 0.800 s at an actual hardware sample rate of 2000 S/s/channel. Both channels and this rate are supported together. Use nominal duration T=N/fs and ignore startup overhead.
a) Specify the measurement type, physical channels, terminal configuration, input range, and acquisition mode. Report the raw measurements in volts.
Both sensors already provide conditioned voltages, so select Acquire Signals, Analog Input, then Voltage. Select Dev1/ai0 and Dev1/ai1, and set Terminal Configuration to Differential to match the stated wiring.
Check the supported narrower range against both signal limits:
The 0 to 5 V range contains the complete expected signal, with 0.6 V of headroom at each end. Select this range for both channels. Leave custom scaling unapplied so the returned values remain in volts.
Choose N Samples because the task must capture one finite record, and set Rate (Hz) to 2000.
b) Calculate Samples to Read and the total number of individual voltage values returned.
The timing settings count ________. Rearrange the nominal-duration relation before substituting the requested duration and actual sample rate:
Set Samples to Read to 1600. There are ________ channels, so the total count is:
Do not enter 3200 as Samples to Read: that would request 3200 samples on each channel and double the nominal duration.
c) Find the interval between successive samples on one channel and the last sample's time relative to the first.
The reciprocal of the actual sample rate gives the interval between successive samples on the same channel:
Take the first sample on that channel as time zero. A record containing 1600 samples has 1599 gaps between its endpoints, so:
The endpoint span is 0.7995 s. Adding one sample interval gives the nominal record duration: 0.7995+0.0005=0.8000 s. The two time measures therefore agree with their respective definitions.
A DAQ Assistant voltage task uses three analog input channels in N Samples mode. Its actual rate is 1200 S/s/channel, and Samples to Read is 900. The device supports this configuration. Which pair gives the total number of individual voltage values returned across all channels and the nominal record duration N/fs? Ignore startup overhead.
A single-channel DAQ Assistant voltage task acquires exactly 800 uniformly spaced samples at an actual hardware rate of 2500 S/s. Set the first sample's timestamp to 0 s. What is the last sample's timestamp? Give your answer in seconds, to four decimal places.