How to Measure the Acquisition Time of My Digitizer/Scope in LabVIEW

Updated Oct 28, 2020

Environment

Hardware

  • PXI Oscilloscope
  • PXI Chassis
  • Counter/Timer Device
  • PXI Digitizer

Software

  • LabVIEW

Driver

  • NI-DAQmx

  • I need to know the exact time it is taking to my scope to acquire data in my application.
  • The acquisition time of my Scope/Digitizer is not what I expect, and it is taking too much to acquire the data.
  • I need to improve the acquisition time or execution time of my LabVIEW code, which fetches data from a Scope/Digitizer to my computer.

To verify that the hardware (Scope / Digitizer) is working correctly and acquiring the data in the expected time, you can follow this steps:

1. Export the Start Trigger and End of Acquisition Event Trigger using the niScope Export Signal  (for example through PFI lines of the scope).

2. Read the time difference between those triggers:
a. To do this use a Data Acquisition (DAQ) device. Use the example "Counter - Count Edges .vi" as a reference to calculate it (in LabVIEW go to Help >> Find Examples >> Hardware Input and Output >> Counter Input) .
b. Configure the DAQmx Create Channel (CI-Count Edges).vi to CI Two Edge Separation and configure the DAQmx Channel property node to get both triggers as shown in the following image:



c. This will give you the Count Ticks and the Counter Timebase Rate of the Scope as shown in this image:
 

The acquisition time will be Count/Timebase Rate. In this example the time between the triggers received from PFI1 and PFI2 will be: 25000398 / 1E+8 = 0.25000398s. The ideal time for this application was 0.25s (5000 records sent every 50μms = 0.25s), which means that the hardware is handling the data very close to the expected time.

Additional Information

If you want to improve the acquisition / execution time of your LabVIEW application consider the following:
  • The acquisition time of the hardware is different from the time it takes to the computer to process the data fetched by the scope.
  • The execution time of the code depends on the computer and how the Operating System handles the data, which is difficult to control. With the example explained above we are verifying the time it takes to the Scope to acquire the data under a specific configuration, not the time it takes to this data to be processed by the computer.
Note: It is expected that the execution time of the code is much higher than the ideal value or the real acquisition time of the hardware.
  • To improve the performance of the LabVIEW application you can try using the property Horizontal:Enable Records > Memory Property from NI-SCOPE driver. This property is usually used when more samples than the capacity of the onboard memory are being fetched.
    • If the number of samples fetched exceeds the capacity of the onboard memory, the property will be helpful and improve the execution time. Here you can take a look at an example that uses the property with this purpose.
    • If you are not fetching more samples that the capacity of the memory, the property can still be useful to improve the execution time of your LabVIEW application, specially if you are sampling during long periods of time. By setting the attribute to True, the NI-SCOPE driver relies upon fetching while acquiring, reducing the execution and acquisition time of the code. Normally, when this property is False, the driver makes some calculations to make sure that the application does not overload the memory. Setting this to True, will assume that the user calculated that there will be an overload and start Fetching while Acquiring.