Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Continuous data acquisition

Dear all,

I have an oscilloscope (DPO4104B) and use the certified LabVIEW plug and play instrument driver. I want to do continuous data acquisition (1 kHz repetition rate) with a trigger signal and afterwards send all the acquired data (or just the mean value) to the computer via USB. Unfortunately I cannot get my program run with the help of the manual and the driver description. In my block diagram the following subvi's/commands are run sequentially;

1. initialize.vi

2. configure delay trigger.vi
3. configure continuos acquisition.vi
4. visa write; "ACQ:STATE ON";
5. program waits for 100 ms to acquire data
6. visa write; "ACQ:STATE OFF";
7. read waveform measurement in memory.vi
8. close.vi

I get the error that there is no waveform to measure.
I would be really grateful for some help since I'm stuck with this problem for a long time now.

Cheers, Greg

0 Kudos
Message 1 of 11
(8,284 Views)

Most likely, your scope has not even gotten a trigger in that time.  And the scope might not have even started to look for the trigger in the 100ms.  I have had to have 500ms for some operations on a different Tektronix scope.  So try a longer wait and/or the trigger status.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 11
(8,255 Views)

It's been a while since I tried acquiring data directly from the MDO3024 we have in the lab, but I'm pretty sure it's the same driver and I think I also had problems with the continuous acquisition - looking back at the code in the repository it looks like I had it just measure the waveform using Fetch Waveform and repeatedly queue the same state.

 

I can attach that section of the code if you want? It seems like I just called similar initialization functions to your code, but I didn't use any direct VISA Writes.

 

I had

  • Initialize
  • Configure Trigger, Timebase, Acquisition, Channel, Continuous Acquisition (but the typedef I have saved has a default false value)
  • Initiate
  • Fetch Waveform, in a loop with some processing.
  • Close, after I finished 'continuous' acquisition.

GCentral
0 Kudos
Message 3 of 11
(8,244 Views)

Hi Crossrulz,

 

thanks for your answer. Unfortunately, even though I tried up to 1000ms, I get the same error. My plan was actually to continously measure for 100ms, which corresponds to 100 datapoints. I think there is something wrong with my commands...

0 Kudos
Message 4 of 11
(8,241 Views)

Hi Cbutcher,

 

thanks for your answer. I would appreciate if you could attach this specific section of your code so I can try to do the same. Thanks!

0 Kudos
Message 5 of 11
(8,240 Views)

You can take a look at this - I apologise for any particularly ugly wire bends or missing typedefs - you might need to disconnect a couple. Hopefully it contains most of the section of code though.

 

 


GCentral
0 Kudos
Message 6 of 11
(8,237 Views)

Hi cbutcher,

 

thanks for the code. Unfortunately, I can not open it because I have LabVIEW version 2013 SP1. Can you send me a converted version? I'm sorry for the inconveniences.

0 Kudos
Message 7 of 11
(8,219 Views)

Try this one. Hopefully it works (although I'm not certain, and like I said last time, probably there will be a fair number of broken typedefs or missing support VIs)

 

Edit: I'm not quite sure how backsaving made it so much larger... weird.


GCentral
0 Kudos
Message 8 of 11
(8,217 Views)

Thanks, with your hints I was able to make the continous acquisition work. But there is still a problem;

I'm acquiring on all four channels a signal and therefore have to use four "fetch waveform.vi" tasks in a row (and in a loop - for continuous acquisition). This takes much longer than 1ms and I can not measure every signal (repetition rate @ 1kHz). How can I accumulate the data on the scope and only read out after 1000 measurements?

0 Kudos
Message 9 of 11
(8,191 Views)

Fetch Waveform should grab all of the data available. It repeatedly calls VISA Read until the amount of data received exceeds the amount it expects based on a record length.

 

I am having some peculiar issue though - it doesn't seem to block (and setting Continuous to false also doesn't seem to stop it rolling). I just wired a function generator to the MDO3024 here, and connected to it by ethernet. The waveform returned has the correct frequency, but it's adding 4 seconds (the waveform length) to my graph roughly once a second - it doesn't seem to care that some data is already fetched.

 

In the code I uploaded, you can see there's a Wait function in the acquisition loop to try and get around this, but that obviously isn't very accurate. I was trying to move towards a Timed loop, but I decided it was easier to use the DAQ board we have with the same inputs and forget the oscilloscope altogether, so I'm afraid I don't really have any good solution.

 

I'm looking at it now but I haven't managed to get anything good in the last hour or so. The "Wait for Operation Complete" node doesn't help (presumably because there's no operation going on) and although the oscilloscope stops moving with Continuous set to false, the VI keeps fetching the same data over and over. Since my period is a factor of the timebase*10, they join up, which originally had me puzzled as to how I had such nice output if it was misbehaving...

 

I guess that there isn't a good way around this - probably the oscilloscope can't know if I read the data, so it just throws out whatever it has on the screen.

 

Below is the snippet I used, backsaved to 2013, for '(non)-continuous' acquisition. Actually, the constant is false here...MDO_Test_BD.png


GCentral
0 Kudos
Message 10 of 11
(8,188 Views)