Discussion:
Array of instances ?
(too old to reply)
Andreas
2009-01-21 12:51:35 UTC
Permalink
Hi Labview Community

I've programmed a little vi (called rbuf) , which takes incoming array
data and appends it to a ringbuffer array. The vi is defined as
"reentrant", so that several instances can be used.

Everything works fine. I aquire data from 2 measurement channels,
which is given to two different rbuf-vis.

Now i want to extend my application to 16 channels. The acquisition of
data is done now in a loop, but how should i call the correct and
different instances ?

In IEC programming i could use something like that:
Declaration
Q : array [0..15] of rbuf;

Program

for k:=0 to 15 do
Q[k].data_in:=messkanal[k]; (* array data of a measurement
channel *)
Q[k](); (* execute instance for
ringbuffer *)
bufdata=Q(k).output;
end_for

I guess, in C# or C++ it is more a less the same principle.

How can i call in LabView (8.6) an instance of a vi by a proper index
number ?

Thanks in advance
Andreas
m***@gmail.com
2009-03-04 04:21:57 UTC
Permalink
Post by Andreas
Hi Labview Community
I've programmed a little vi (called rbuf) , which takes incoming array
data and appends it to a ringbuffer array. The vi is defined as
"reentrant", so that several instances can be used.
Everything works fine. I aquire data from 2 measurement channels,
which is given to two different rbuf-vis.
Now i want to extend my application to 16 channels. The acquisition of
data is done now in a loop, but how should i call the correct and
different instances ?
Declaration
Q : array [0..15] of rbuf;
Program
for k:=0 to 15 do
   Q[k].data_in:=messkanal[k];   (* array data of a measurement
channel *)
   Q[k]();                                   (* execute instance for
ringbuffer            *)
   bufdata=Q(k).output;
end_for
I guess, in C# or C++ it is more a less the same principle.
How can i call in LabView (8.6) an instance of a vi by a proper index
number ?
Thanks in advance
Andreas
Wouldnt it be just as easy to build a 2D array? You can continuously
append data in a loop to it. If your application is not too CPU
intensive using the "enable indexing" feature may be your best bet.
Loading...