LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

CLFNs and subVIs in the same loop

Solved!
Go to solution

In my main VI, there are a few parallel while loops.

 

In one loop, I use several CLFNs configured to "Run in Any Thread". In that same loop is a subVI that simply writes the resulting data array to a buffer; i.e., no CLFNs in that VI.

 

What settings should I use in the Buffer VI's Properties to minimize delays (or other problems) with the function calls and other thread issues?

 

Thanks,

 

Jeffrey Bledsoe
Electrical Engineer
0 Kudos
Message 1 of 5
(2,692 Views)

If you need multiple calls of the VI to run in parallel, you can use reentracy.  Otherwise the VI will follower the rules of data flow.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 5
(2,635 Views)

As a side note; depending on the actual amount of CLFN nodes you have, and your CPU, they may not all run in parallel if the quantity exceeds the maximum allotted number of threads in the execution system of their hosting VI. You can confirm this by looking over this (http://digital.ni.com/public.nsf/allkb/37675EB478666A5E862565BC006BDCDB, and some background here though it is older: http://digital.ni.com/public.nsf/allkb/84ECA015AA496B23862565BC006C0F19) to see if you are going to hit any limit.

0 Kudos
Message 3 of 5
(2,598 Views)
Solution
Accepted by topic author MinerHokieRamp

Best bet is to configure the Buffer VIs to run in the caller's execution system (ie, set to "Same as caller" which is the default). The DLL call itself will run in the caller's thread when you configure it to run in any thread. However, if there are any threading issues with your library call, even if you can minimize them with the right VI properties, it would still be safer to run in the library call in the user interface thread unless you can fix the library to be thread-safe.

0 Kudos
Message 4 of 5
(2,587 Views)

Sorry for the delayed reply. I'll try running the referenced VI tomorrow.

Thanks,

Jeffrey Bledsoe
Electrical Engineer
0 Kudos
Message 5 of 5
(2,530 Views)