This article describes the Keysight U2701 Oscilloscope's use in LabVIEW. The Keysight U2701 Oscilloscope is a low-cost, reliable USB Scope made by Keysight. The scope works great, but can be a little tricky for reasons described in this document. If your project needs a low-resolution, high-speed waveform capture with or without triggering, read on to discover how the Keysight 2701 can work for you.
The U2701 Scope has the following specifications:
1 GSample/s (1 billion samples/second) maximum acquisition rate (500MSample/s for 2 channels)
Up to 32 million points in the buffer
Analog or External Trigger
100 MHz (U2701A) or 200 MHz (U2702A) Bandwidth
Keysight Measurement Manager software
FFT and Math functions
8 bit resolution
5 V/division to 2mV/division
Because the U2701 is a USB Scope, it has no screen or manual buttons. All control of the scope occurs through the computer it is connected to. Keysight Measurement Manager software communicates with the U2701 Scope (and other Keysight USB instruments). It allows the features of the scope to be tested. If you are developing custom software (for example, a test system that uses the U2701 scope to test a product), the Keysight Measurement Manager can be used as a proof of concept for the test system.
LabVIEW is a powerful software development package that excels at controlling with a wide variety of hardware. This section describes how to control the U2701 using LabVIEW.
The U2701 Programmers Guide contains the API reference for programming the U2701. This article suppliments the programmers guide by describing a few tricks.
A software command will initialize the U2701. Initialization can take up to 45 seconds, which can add up during development time. To avoid repeated initializations, a LabVIEW global was used to store the initialized reference. Development code could then be tested by writing code in a separate VI that would read the initialized reference from the global.
If the above VI runs without errors, then the U2701 global is now initialized and may be used in other VIs within the LabVIEW project without waiting for the U2701 to initialize. If you wish to use Keysight Measurement Manager to control the instrument, you must stop the initialization VI above to allow access to the U2701 hardware.
For this example, we are assuming that we want to set up the U2701 for a triggered acquisition, send a command to another device that will ultimately generate the event to be triggered, and then read the captured waveform, as shown below:
The configuration of the trigger is not shown; we'll assume the trigger is set up correctly. The first try (which likely fails) is shown below:
The code above will likely fail because there is no synchronization between the Event and the Capture. Read Waveform above will both initiate the command and wait for the trigger to occur. If the DAQ Write command occurs before the the scope trigger is armed, then the event will be missed. The code above generates a timeline as shown below:
The next try will use the Initiate command, monitor for the trigger to occur, and then read the waveform. Additional code is added to show the timing of each step.
The above code works. However, the "Status" property always returns AcqComplete, as seen by the StatusIter and the Timing display. This approach can cause unexpected delays during "FetchWaveform" since the waveform has not actually been acquired:
The Status Iter shows that the loop only executed once, and the "Wait For Trigger" time was 0ms. The Read took the majority of the time since it was both waiting for the trigger and waiting for the data to be collected.
What finally worked as desired was to use the Service Request bits of the U2701. These bits have existed on stand alone instruments since the SCPI command days of GPIB. A device's inner-workings are exposed on a series of bits. As the device operates, it can set bits as things happen. For example, when a trigger occurs. The computer can query the status of these bits, which then clears them. The device has to be told to do this. Fortuneately, it is pretty simple with the U2701:
The Status reference of the U2701 provides a "ConfigureServiceRequest" method that takes 32 bits of on/off values. These bits specify which Service Requests to turn on. The example above shows bit 9 (decimal value 512) or AgilentU2701ASRQReasonStbTrg being turned on. This code only has to execute once after the U2701 is initialized. Then, to find if a waveform has been acquired, the following code is used:
This time, after Initiate is called, the for loop executes multiple times while waiting for the trigger to be seen. I couldn't find any documentation about bit 8 (decimal 256), but it turns on after the waveform acquisition is complete. Another benefit to this method is that the code may be written to allow the user to choose when to abort the acquisition if the trigger doesn't occur. Once "FetchWaveform" is called, the device is unresponsive until either the trigger occurs or the device timeout is reached. But with the get_Register method, the software can poll the status indefinietly or until the user (or another event) signals the stop.
The controls from the Front Panel above show that the For Loop executed 504 times before the acquisition was complete. The total time waiting for the trigger was 2.2s. However, once the service request indicated the acquisition was complete, it only took 29ms to retrieve the data.
The U2701 will output the InitialX value, which is a relative measurement of where the waveform began in relation to the trigger. If you don't change the "Delay" property, then the U2701 will put the same number of samples before the trigger as exist after the trigger. In the waveform graph used in this example, that is 1250 points spread over a full second of time, giving a sample period of 800us and a start time of -0.5s. To tell LabVIEW to show this information in the graph, you must turn off "Ignore Timestamp" and change the X Scale Format to a number display instead of a time display:
Setting the waveform graph display in this manner will always show the trigger at time = 0.
The Keysight U2701 Oscilloscope is a great low-cost device for acquiring high speed data. It can be used with NI LabVIEW to create custom Test software. Although I prefer NI hardware when working with LabVIEW, the Keysight U2701 offers exceptional quality at a great price.