05-29-2017 06:11 AM
I'm still fairly new to LabVIEW so I would especially appreciate any guidance on this problem. I am trying to capture the waveform (ultimately on multiple channels but for the sake of simplicity I restricted it to one) resulting from a single shot capture on my oscilloscope. The oscilloscope triggers and captures perfectly in "Single" mode but I can't read the waveform. In particular, the "Read" occurs regardless of what the scope does (i.e. trigger or not) and in this case it exists the program nicely even thought the scope remains in "waiting". I'm just afraid I'm missing something fundamental here and would be thankful for any help!
Cheers!
05-29-2017 08:51 AM
We need to see all of the relevant VIs. Is this part of a LabVIEW Project, or are all of the relevant VIs in the same Folder? If so, compress the folder and attach the resulting .ZIP file.
Bob Schor
05-29-2017 09:42 AM - edited 05-29-2017 10:10 AM
Thanks Bob for the heads-up. I hope I didn't mess up too badly and got all the files. The one thing I noticed is that the waveform data only contains two points if the signal hasn't triggered yet:
time Y[0] Y[1]
1/1/1904 01:00:00.000000 3.080000E+0 3.080000E+0
1/1/1904 01:00:00.000010 4.600000E+0 4.600000E+0
Once it has triggered I get the correct full signal i.e. hundreds of points in the array. One way I could imagine is to constantly poll at small intervals until the waveform is "more complete" and use that as an indicator the scope has triggere and then use hat data. And then reset and await the next shot (not in this trial code). Just seems somewhat unreliable not knowing why I get those two lines and what features will always be there.
05-29-2017 01:36 PM
I didn't realize that the missing files were part of a Third-Party package, but it was helpful to see them!
In the situation where you get only two points (because the signal hasn't triggered yet), do you get an Error on the Error Line? According to the Help for Read (Single Waveform), a common source of Error is that the signal has not triggered yet. You can test for an Error and simply keep trying until you succeed. Here's one way to modify your code --
By inverting the Error logic, this loops until there is no Error, i.e. until the Waveform is triggered (if I understand the Scope functions properly).
Bob Schor
05-30-2017 02:40 AM
Thanks for the great feedback! Unfortunately, the even of reading the waveform doesn't trigger an error and indeed only reads in the same two lines of "empty" waveform. The only way I was able to make some headway was to check for the size of the waveform and use it to decide if it was an actual capture i.e. by replacing the "read waveform" with this sub vi:
While not pretty at least it works. I am still concerned about the source of the "junk" I am getting but I have to look for an alternative approach anyway as I can't seem to get the Frequency of captured shots above ~1Hz (probably due to the slow USB interface).
Thanks for your help and effort!
Best,
Cyrill