LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

display data in real time

I am using Labview 8.2. I am using DAQ (50MHz) to acquire OCT signal. The frequency of the signal is 20000Hz. Each buffer contains 1000000 data points. I want to display 2500 data points at one time. So there should be 40 graphs displayed in each buffer. I used for loop to split the data in each buffer. The problem is that the for loop is so slow that the data can not display in real time. So I am wondering is there better way to display data in each buffer in real time like data displaying in oscilloscope. At the same time, I have to process every 2500 data points in each buffer. I added it in the for loop. It slows down the program. Is there better way to do that?
0 Kudos
Message 1 of 6
(3,799 Views)

I don't think it's possible to display data in "real time" as such, no.

 

The way you've described your setup (or, at least, the way I've understood it, which may be way off), each buffer is 5 seconds worth of 20kHz data, and you want to display 2500 data points at a time, which is 125ms worth of data. Correct?

 

It seems unusual that your program is slowed down by updating the display eight times per second - could you describe the loop you're using to display the data?

 

The simplest solution is probably just to update the display less frequently. You could just update it once per second, for example, and graph only the most recent 2500 data points. You'll only display one-eighth of the data that way, but will that be a problem? Alternatively, you could display fewer data points at a time - you could display every tenth data point, for example.

 

The question here is, what's the important information for an operator to look at on the display? It could be that you're trying to display more data than is actually necessary.

0 Kudos
Message 2 of 6
(3,785 Views)

Hi! Thank you for your advice. I want to explain more about my problem. Each buffer contains 1000000 data. Every 2500 data is a A scan. So each buffer contain 400 A scans. Every 200 A scan is a B scan. So there is 2 B scan. I want to display every A scan in a buffer and process each B scan in a buffer. Attached is my vi. The first loop is B scan and the inside loop is A scans in a B scan. Acquiring time for a buffer is just about 27ms. After adding the two loops, the program is acually not slowed down so much, the signal is still renewing in real time. The motion of the signal is moving very very fast. But I want it displaying like oscilloscope. The signal should not be moving but should flushes if there is any change between consecutive A scans. If there is not change of the A scans, the signal on the screen should remains like oscilloscope. Do you understand what I mean?

 

The second problem is that when I add processing part to the second loop. The display is not so real time because the processing takes some time. So the signal displayed can not renew. Does that mean I can only show first several A scans in a buffer? But anyway, I would like to realize to display the signal like oscilloscope. So I guess there should be other ways other than for loops to do that? Like Queue, I saw some other message talks about queue or Labview real time for real time display. I do not know the detail though. 

 

Attached is the displaying part of the vi. There are 2 channels in a buffer, so 5000 points in a A scan display.

 

 

0 Kudos
Message 3 of 6
(3,760 Views)

sophia2008,

 

I'm still having a bit of a difficult time understanding exactly what you're wanting to do, however I can help with your questions regarding LabVIEW Real-Time and Queues.

 

I think your best bet would be to use a Producer Consumer layout.  This will allow you to gather your data at a fast rate and process the data as fast as possible without slowing down your data acquisition.  This is the method which involved using a queue.

 

LabVIEW Real-Time will not help with what you are doing.  Just because it is an RT system does not mean that it is faster.  All Real-Time means is that it is deterministic and that certain events will happen when you expect them to depending upon priorities.  It will still take time to do the data processing.

Regards,

Jared Boothe
Staff Hardware Engineer
National Instruments
Message 4 of 6
(3,719 Views)

Hi! Jared_B.

 

Thank you for your response. I think that putting processing part and displaying graph in the same graph has slowed down the displaying. In order to make this two events run asynchronously, I think producer/consumer template (event) may work. But I never used that before and don't know how to do that. Attached is my code picture. Could you please give me some advice to separate displaying and processing? Thank you!

0 Kudos
Message 5 of 6
(3,697 Views)

sophia2008,

 

What I would recommend is looking at some example code for producer/consumer VIs and see what they do.  The idea behind it is that you'll have as fast as possible acquisition on the producer loop and you can display this.  But because the processing takes so much time, you will want that queued up in a separate loop and view that data after it has finished processing, without slowing down your acquisition rate.

Regards,

Jared Boothe
Staff Hardware Engineer
National Instruments
Message 6 of 6
(3,663 Views)