LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

UI thread for separate VIs

I'm using a set of VIs provided by the instrument manufacturer to pull data and set various instrument parameters.  These VIs use the call library function to call DLLs provided by the company.  The instrument records its own data file at 1 Hz, and everything looks fine in there, but when I try to access one of the datasets via the DLL, I occasionally don't see data at the correct frequency.  The VI (from the company) has a timeout period to wait for new data, and I've tried both long (2 seconds) and short timeout periods with the same result.  I made a simple VI that only grabs this particular dataset, and that works fine.  The CLFs are all configured to run in the UI thread, so I'm assuming that displaying all the data and the frequent calls to the DLL are clogging up the UI thread.

 

My question is if I have two independent VIs, one with no displays that uses the DLLs to get data and tosses it into a queue, and a second that does all the display, will that help unclog the UI thread, or is there only one UI thread for all of LabVIEW?  If that's the case, any suggestions for how to reduce UI calls?  I've made some changes so the plots are only updated if the tab they is on is active, but it will be a couple of days before I have access to the instrument again to test this.  I've also reached out to the company to see if the DLLs are threadsafe.

0 Kudos
Message 1 of 3
(274 Views)

There is only one UI thread for the whole OS, it is shared among everything running.

 

Wait to hear the response from the company, if their DLLs are thread safe then no issue calling from other threads. Otherwise try to minimize, if possible, your calls to the UI thread. 

Message 2 of 3
(234 Views)

I hope you're not using Property nodes to update your plots.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 3 of 3
(165 Views)