LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

A general buffer block for Labview?

Has anybody made a function which stores acquired values and returns the contents when needed. In other words I need a buffer which is as simple and fast as possible and does not waste resources.

Of course, I can make a VI which has an uninitialized shift register and call it in the loop but it is not efficient enough in some demanding situations. And also, this kind of buffer will slow down the execution of the loop because the buffer increases all the time. (Clearing the buffer is possible by writing the contents to the file but it is a little bit complicated)

In many of my applications where the acquired data is needed to be plotted I have used waveform chart which has a history for the data. I have noticed th
at history feature can be effectively used as an buffer, it does not slow the execution like shift registers and you don't need to build any buffers by yourself.

In some cases I don't need to display the data but I just want to buffer it, therefore it could be very useful to have a general buffer block in the Labview which does not have any kind of appearance in the front panel, just a node in the block diagram.(of course one way is to use the history of the waveform chart and hide the chart)

I have been programming with LV over two years daily but making of efficient buffers has always been a question to me. I have noticed that other colleagues have same kind of problems.

Maybe this kind of buffer block could be made by c-language code and called it by the LV, but calling functions from dlls take also some time overhead which can be too much.
0 Kudos
Message 1 of 3
(2,610 Views)
Array handling is improved in lv6.
The shiftregister approach still is one of the best. But be careful not to have too many controls and functions inside.
It also helps to move the input and output array (in the diagram) to the borders of the vi (outside any case or loop). This helps the compiler to generate more efficient code and less extra buffer memory.
greetings from the Netherlands
0 Kudos
Message 2 of 3
(2,610 Views)
Hi Wirer,
see attached file.
Mike

Wirer wrote:

> Has anybody made a function which stores acquired values and returns
> the contents when needed. In other words I need a buffer which is as
> simple and fast as possible and does not waste resources.
>
> Of course, I can make a VI which has an uninitialized shift register
> and call it in the loop but it is not efficient enough in some
> demanding situations. And also, this kind of buffer will slow down the
> execution of the loop because the buffer increases all the time.
> (Clearing the buffer is possible by writing the contents to the file
> but it is a little bit complicated)
>
> In many of my applications where the acquired data is needed to be
> plotted I have used waveform chart which has a history for
the data. I
> have noticed that history feature can be effectively used as an
> buffer, it does not slow the execution like shift registers and you
> don't need to build any buffers by yourself.
>
> In some cases I don't need to display the data but I just want to
> buffer it, therefore it could be very useful to have a general buffer
> block in the Labview which does not have any kind of appearance in the
> front panel, just a node in the block diagram.(of course one way is to
> use the history of the waveform chart and hide the chart)
>
> I have been programming with LV over two years daily but making of
> efficient buffers has always been a question to me. I have noticed
> that other colleagues have same kind of problems.
>
> Maybe this kind of buffer block could be made by c-language code and
> called it by the LV, but calling functions from dlls take also some
> time overhead which can be too much.
0 Kudos
Message 3 of 3
(2,610 Views)