"Paul F. Sullivan" <[EMAIL PROTECTED]> wrote:

>"Subramanian, Shankar, K" <[EMAIL PROTECTED]> wrote:
>
>>... Can a subVI say "Filter.vi" be called simultaneously with 
>>different input values?
>
>Unless a subVI is reentrant, it will finish operating on one set of 
>inputs before starting on another. You can call multiple copies 
>simultaneously but they will execute sequentially.
>
>If you wire your three channels of acquired data to three parallel 
>copies of Filter.vi and wire the filtered outputs all to the same 
>graph, data flow will prevent the instances of Filter.vi from running 
>until their respective data are ready and require then all to 
>complete before the graph is plotted. If all the channel data are 
>available at the same time, the channels will be processed one after 
>the other, but with no predetermined order. From the point of view of 
>the graph or the data acquisition, the filters will appear to run in 
>parallel, but the fine details will show the channels being processed 
>in series.

One thing to watch out here is if your subVI uses uninitialized
shift-registers for local storage. If you let them run in pseudo-
parallel without the subVI being reentrant you will see wrong
calculations as each instance will use the local storage of the
previous execution as starting point for whatever calculation it
does. To avoid this make the subVI reentrant and they will each
maintain their own local storage data as well as execute in real
parallel too, at least as far as the number of CPUs allows.

Why not set any VI always reentrant? Well, reentrant VIs do not
support single step and other debug operations anymore and use
more system resources as you drop them multiple times in your
application.

Rolf Kalbermatter
CIT Engineering Nederland BV    tel: +31 (070) 415 9190
Treubstraat 7H                           fax: +31 (070) 415 9191
2288 EG Rijswijk        http://www.citengineering.com
Netherlands             mailto:[EMAIL PROTECTED]
 


Reply via email to