09-08-2008 10:01 PM
09-09-2008 12:00 AM
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.
09-09-2008 12:56 PM
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.
09-10-2008 06:53 PM
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.
09-11-2008 01:56 PM
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!
09-12-2008 07:59 PM
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.