04-30-2017 11:10 PM
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,
Solved! Go to Solution.
05-01-2017 04:14 AM
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.
05-01-2017 01:45 PM - edited 05-01-2017 01:46 PM
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.
05-01-2017 04:29 PM - edited 05-01-2017 04:29 PM
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.
05-23-2017 10:16 PM
Sorry for the delayed reply. I'll try running the referenced VI tomorrow.
Thanks,