LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Putting an array in memory and flush it afterwards

Hello,

I ' m busy making an EDF file viewer, and now I want to see the data on
different tabs, let's say tab 1 is a Time graph with al the channels,
tab 2 are different XY graphs etc..

I have made 3 buttons outside the tab control: Previous, Stepsize (in
seconds) and Next; if you push Next you see the number of second
selected in Stepsize of data on your screen. I want to use this data on
more tabs so i want to make some sort of buffer where put my data in
when i push next and refresh it when i push next or previous again.

I made a local variable of my data and put it in the contineous walking
while loop (the Next and Previous buttons are "Latch when released", so
they are doing one loop), but then my
program goes very slow, is there
any other possibility to store the data in a peace of memory and then
only read it when i need it?

Best regards,
Thijs
0 Kudos
Message 1 of 2
(2,543 Views)
....
> I made a local variable of my data and put it in the contineous walking
> while loop (the Next and Previous buttons are "Latch when released", so
> they are doing one loop), but then my program goes very slow, is there
> any other possibility to store the data in a peace of memory and then
> only read it when i need it?
>

The local variable is an easy solution, but it isn't efficient
when there is much data stored in the control. The easiest
edit to get back some of the time is to change your loop around
so that it reads from the terminal of the control and only
writes to the local when something has actually changed.
Control terminals are much more efficient to use than locals,
primarily because there is only one of them. If you are
reading from the locals
in multiple places in your diagram,
then move the terminal out to where you can wire to multiple
places getting rid of local variables.

An even better solution, but it will require more wiring
changes, is to get rid of the control that you are using to
store the data and share it between different diagrams within
the loop. The better way to share the data is to use a shift
register. The shift register only has one place to read the
data within the loop and only one place to write to within
the loop. These limitations on access to the data help LV
to optimize. Branch the wire from the left shift register
to the places that need it, and pass some value through the
diagram to the right shift register.

Greg McKaskle
0 Kudos
Message 2 of 2
(2,543 Views)