LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to display data at a slower rate than it is being acquired?

Hello,

 

I am acquiring data from a drive in a loop which has a wait of 30 ms. However, I don't want to display the data as fast as it is being acquired. For example, I want to display data of 5 sec in 50 sec. I thought of using queue for it having a different enqueue and dequeue time in loops. I am calling a subVI for queue in the main loop which acquires data. But, the control just gets stuck up in the subVI for queue. How do I decide the timing of the loops so that the control comes back to main VI?

 

Is there any better way to do this?

 

Thanks 

0 Kudos
Message 1 of 16
(3,672 Views)

Make another while loop separate from your other code. Put Wait till next MS Vi on there (metronome icon). Have this loop pull the current values from your data buffer and put it on the screen.

 

 

0 Kudos
Message 2 of 16
(3,669 Views)

Don't slow down your acquisition or processing the acquired data by adding additional delays.

 

Simply update the display (indicator) by placing it (indicator) within a Case Structure that meets your update frequency.

For instance, if you keep track of time by ms, then use thw Quotien / Remainder where you trigger when the remainder is 0. 

 

A code example will explain better... See image below.

 

R

The example above will update the display (indicator) "Numeric" every 1000 ms.  You can create a control instead of a constant and select any value that you wish.  I used a Tick Count (ms) just to illustrate.  The other Case is the default one. 
Message Edited by JoeLabView on 09-08-2008 01:11 PM
Message 3 of 16
(3,660 Views)

I've done something similar to Joe LabVIEW, but I've set things to display every N-th point (e.g. every other, every tenth, whatever you decide).  The basic idea is to bring each data point into a case statement, governed by a Quotient/Remainder function whose remainder is wired into the loop.  Wire a counter (either one you develop yourself as "This is point M" or an incrementing shift register built inside a Functional Global, or a Do-Once While loop) to the "dividend" side of the Remainder, and your N to the divisor.  In the Case statement, make Case 0 be "Pass the value to the display", while the Default case, or everything else, is "Don't pass the value along".

 

Bob Schor 

0 Kudos
Message 4 of 16
(3,645 Views)

Hello,

 

It seems that you are looking for a way to choose some samples and show them on the screen. I suggest that you use some kind of signal conditioning rather than choosing a different displaying rate, e.g. getting an average of every 10 samples instead of displaying 1 sample out of 10. In this way the displayed value is more stable ( because it is low pass filtered) and you have not ignored the data that is transferred from physical world right into your application with lots of effort!

 

0 Kudos
Message 5 of 16
(3,642 Views)

Hi,

 

I sometimes use queues for updating graphs without loading the cpu to much. It is a simple producer/consumer diagram.

I have added a short example (LV 7.1) demostrating the basic principle.

 

Was it this you were looking for?

 

VPS

LV7.1-8.5

0 Kudos
Message 6 of 16
(3,633 Views)

Even if I add a delay to the indicator, I would still need to use queue for storing the data, right? I am using queue example from NI.

 

I am very new to LabVIEW so I may be missing something very obvious.

 

I am not able to attach my code to this message. Will keep trying to attach it. 

Message Edited by Nidhi on 09-08-2008 05:07 PM
0 Kudos
Message 7 of 16
(3,602 Views)

What type of data are you obtaining?  Is it something that is stored into an array? 

 

Using the queue's buffer may not necessarily be a solution depending on acquisition speed and data size that you need to manipulate.

 

Can you provide more information on the data?

 

R

Message 8 of 16
(3,579 Views)

It's a double that I am getting about 30 samples per second. I may want to acquire data for about 10-15 min.

 

0 Kudos
Message 9 of 16
(3,554 Views)

Have a look at the attached example.  I thought it would be easier than to explain the whole thing.

 

Run it and see how it goes.  The Producer Loop simply creates random data (which you will replace with your own).  The Consumer Loop updates the display at regular intervals.  It only shows the last set of data... I didn't know what you wanted to show.  The example is for illustration only.

 

R

 

 

Message 10 of 16
(3,544 Views)