06-24-2025 04:57 AM - edited 06-24-2025 05:52 AM
Hello,
I’m using LabVIEW for the first time to acquire waveform data from an Agilent MSO9104A oscilloscope via USB, using VISA communication and the official Agilent 90000 Series LabVIEW driver.
In my VI, I acquire waveform data with a time interval (dt
) of 5e-7 seconds and save the data to a TDMS file.
When I plot this acquired data (in Python), I notice that peaks appear flattened—they don’t match what I expect to see.
However, when I save the same waveform directly as a CSV file from the oscilloscope's front panel, the peaks look accurate and sharp.
If someone can check this attached VI and help me point out if this is happening due to some problem in VI or can advice me on this issue.
The VI SS is as follows:
06-25-2025 01:19 PM
We'll need more than that description to help. Here's some questions..
- Why not plot the data directly in your LabVIEW code? (You might spot your error earlier and easier.)
- Do the saved scope data files and LabVIEW data files have the magnitude x-values and y-values?
- Are you displaying the raw data in array that you can inspect and see if they match the scope values?
I imagine you did not apply a scaling factor to the data before saving it to file. But I can't tell if it's the time base (x-value) or the scale magnitude (y-value). Either one should be an easy fix. Just querry the scope, download the trace, multiply or divide the data and save the file. Save a CSV from the scope of the same data and compare.
Good luck.
Craig
06-25-2025 08:37 PM
Thanks for attaching a "static" picture that we can't "carefully" inspect. You did attach your LabVIEW code (thanks!), but since the annual releases of LabVIEW means that the majority of LabVIEW users of LabVIEW 2025 are students who can take advantage of their school's Academic License. Developer, on the other hand, need the "team" to all be using the same LabVIEW version (since a LabVIEW 2025 VI cannot be opened by any version of LabVIEW older than LabVIEW 2025) and thus tend to "stick with a Version for their team" and upgrade every other (or third, or fourth) year.
So when attaching code (which we like!), help us by clicking the File menu button and "Save for Previous Version", with LabVIEW 2019 and 2021 being frequently-requested versions on this Forum.
On the other hand, a question about the picture of your code --
It may be that you are trying to do two "sequential" tasks in your main loop -- acquire the data (which takes some time) and save those data to disk (which also takes time). However, when you are waiting for the data to be transmitted to you by VISA, and written to disk, all in the same loop, running sequentially (because even LabVIEW can't "predict" the data to be written until it reads it from VISA, you may run out of time.
But most of the time inside the While Loop you spend waiting -- for VISA to acquire the data, and TDMS to do the write. What if you could do them simultaneously, say "Read new data at the same time you are writing the previously-read data"? [Look up Producer/Consumer Design Pattern].
Bob Schor