ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why does data disapear between interations

I'm continuously acquiring data from a accelerometer and displaying the data in a waveform graph (0 - 100Hz). Why does the data disapear between averages (I'm assuming between each iteration of the while loop).

I would like my data to remain in display until the averaging is complete.

I seen mention of this however cannot find it. Does anyone have a solution/example?

R/Alv
0 Kudos
Message 1 of 11
(3,939 Views)
Let's have a look to your code : build a simplified version of your vi (for instance removing the whole DAQ stuff, just leaving the loop, the graph, and a piece of data with the averaging function); see if the problem persists ; then post the vi... somebody will find the flaw.

CC
Chilly Charly    (aka CC)
0 Kudos
Message 2 of 11
(3,937 Views)
Charly,
Thanks. I enclosed a bmp of the code rather than re-wiring it again. I'll explain whats going on, basically I'm acquiring data from 2 transducers (accels) and coverting the data to displacement. From the code you can see that I'm displaying the frequency content as well as displacement. Give me thoughts.
R/
0 Kudos
Message 3 of 11
(3,925 Views)
If you are using a graph like you say in your original post, then data disappears because a graph does not have a history buffer. That is what a chart is used for. If you want to use a graph, then you can create your own buffer by writing to a shift register.
0 Kudos
Message 4 of 11
(3,891 Views)
Sorry, may be I am tired after a busy Sunday, but I don't even see where the graph is on the bmp ! Don't know how I could help !!

CC
Chilly Charly    (aka CC)
0 Kudos
Message 5 of 11
(3,872 Views)
Dennis,
I'm using the shift registers on the while loop. I'm sure what your referencing to? I've included my code for reference.
0 Kudos
Message 6 of 11
(3,868 Views)
Charly,
Icluded my code. R/
0 Kudos
Message 7 of 11
(3,868 Views)
The only shift registers you have on the while loop are for the error cluster and the file reference. You need a shift register for each graph.
0 Kudos
Message 8 of 11
(3,862 Views)
Sorry Denis, but this has nothing to do with shift registers : a graph olds its data as long as you don't write anything else in it ! 😉

The flickering is due to the way the averaging is done, 2 subvi layers down. I don't have enough time to dig something out of there, but what can be done in the main vi is to add a case structure around the graph terminal, and wire the case input to a comparison node between the "magnitude" in the "power spectrum" cluster and an empty array.

See the attached vi, which is the simplified version I was asking for in my first answer.

CC
Chilly Charly    (aka CC)
0 Kudos
Message 9 of 11
(3,849 Views)
But he does a complete data acquisition every loop which would appear to write new data to the graph every time.
0 Kudos
Message 10 of 11
(3,843 Views)