Hello, good people!
This is my first post on this site.
I'm using LabView 2015. I have a Pico USB TC-08 which I use in LabVIEW to get 4 thermocouple temperature readings that I use to control a system. I have provided a minimal working example (MWE) which only does the temperature reading, and a snippet of the slow part below (It is not working without a Pico USB TC-08, i guess, but i cannot make an example that runs without it without removing the relevant stuff). The code was provided by Pico but has been commented and tidied up by me. My problem is that the front panel is lagging such that when I scroll or enter values in controls, it takes about half a second before the action is registered / shown on my screen. This incidentally coincides with the time taken by one iteration of the temperature measurement loop.
From what I have found on the internet so far, my hypothesis is that the temperature reading, which is done through a Call Library Function Node and the function usbtc08.dll:usb_tc08_get_single, is using all the capacity of the UI thread. This node takes about half a second to get temperatures and then starts over, and in the transition between each acquisition, I think the UI thread is free to update the front panel (adding a 10 second wait inside the while loop makes the front panel lag for half a second every 10 seconds and responding nicely in between).
Some people online suggest changing the node properties to "Run in any thread", but then i only get 0's in all the temperature measurements. I need the temperature measurements to run as quickly as possible. My question(s) is(are) therefore:
Can I make the front panel update run in another thread?
Can I make the node work with "Run in any thread"? I have seen something about calling a VI with an "Invoke Node" vs calling a VI with a "Call by Reference Node" which might be worth checking out but I know nothing about these threads and the DLL-stuff.
Can anyone help - it would be much appreciated!
Magnus
![MWE.PNG MWE.PNG]()