Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Continuous measurement and data acquisition from TBS 1202B oscilloscope using LabVIEW

I am trying to make a vi that should be able to acquire continuous measurement and save data in a text file without losing a single data point. My code takes approx. 2 sec to execute while loop once and in that time it takes only one set of data that is of a given time base of 0.005s*10 (it saves 2500 points per set). This means it is losing all the data measured during the whole 2 sec. Please suggest a solution. Thanks in advance. 

0 Kudos
Message 1 of 4
(1,064 Views)

Definitely, it should be possible but we could only speculate where your implementation lacks. Please share your source code for review.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 2 of 4
(1,044 Views)

Dear Santhosh. thanks for the reply. Here I am attaching my code for Tektronix TBS 1202B model. Please check and suggest. Thanks for your guidance.

 

 

0 Kudos
Message 3 of 4
(995 Views)

There are some ways to speed up the code, but it's highly unlikely that you will be able to "stream" all data to the pc from the scope.  If that's your goal, then you should look at scope internal storage options.  Your code would trigger the measurement to run for N seconds, saving all data internally on the scope.  Once the measurement completes then you can download the data from the the scope and do post processing.

 

If you need real-time capture of one point on a trace then look at the "marker" functions.  You can usually get a single marker reading buffered to internal memory back from the scope

 

As it stands your code is trying to download and save two trace 22500 each.  Transferring 45000 pts takes time, saving that data to a file (which you open/write/close every loop) takes time, sending commands to scope to read data takes time.  During all those little delays the scope is capturing data which you will miss.

 

A few tips to speed up what you showed.

- use shift registers to save data and only write data after the loop ends  (faster, but could be memory limited)

OR

- open the file before the loop, close the file handle after the loop and only write data during the loop (slower but not saving big volume of data in memory)

- don't update a table in the loop, don't update the chart in the loop.

 

On another note..

- Saving a data file with an array of points from the Get Date/Time seconds doesn't seem like what you want to do.  If you want to save the trace data with a timestamp to be able to replot your signal versus time later, then you need to get the time base settings from the scope and calculate the time based on that increment between points.  Or just save the trace and rebuild the timestamp in what ever analysis software afterwards.

 

Give these suggestions a try and let us know how it goes.

Craig

0 Kudos
Message 4 of 4
(978 Views)