LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Independant non-reentrant subvis?

Hi, I have a subvi which manages a circular buffer using unitialised shift registers. I want to manage multiple independant circular buffers. I can make the subvi reentrant, but then I need to place individual instances of the subvi to handle multiple buffers. Furthermore, read and write operations must be handled by the same instance on the diagram, in order to access the same buffer. The calling vi looks after a variable number of data sets, identified by an id - I want to select the circular buffer to access based on the id. One possibility is to place instances of a reentrant version of the subvi in the frames of a case structure - howevever these means the calling vi must know beforehand how many instances there will be, and ther
e is still the issue of read/write access having to occur at the same place.

Another alternative might be to pass the buffer (an array) and associated data (read/write positions etc) to the subvi, but I am wary of introducing copies of the arrays.

Is there an elegant way around this in labview (7)?

Ian
0 Kudos
Message 1 of 4
(2,831 Views)
Ian,

create the needed instances of the reentrant subVI using "Open VI Reference" and keep a table of (virefnum,id). That allows the caller VI to select the VI instance according to the dataset id and calling it by reference. You don't need to know in advance the number of required instance since you create them when needed. Don't forget to close VI references when you're done with it.


LabVIEW, C'est LabVIEW

Message 2 of 4
(2,831 Views)
Hi Jean-Pierre,

Your answer sounds like it does exactly what I want. I try it later today I hope. Thanks a lot.

Ian
0 Kudos
Message 3 of 4
(2,831 Views)
Thanks Jean-Pierre,

Your suggestion worked perfectly.

Ian
0 Kudos
Message 4 of 4
(2,831 Views)