06-27-2016 10:23 AM
Hi!
I currently have a "main VI" running quick processes, and I have a subVI which is essentially a device collecting data. However, this subVI runs at 1 Hz, while my main VI runs much faster.
I have created an asynchronous call for this subVI, and set it such that the main does not expect any incoming data. I followed these very simple instructions: http://zone.ni.com/reference/en-XX/help/371361L-01/lvhowto/acbr_call_and_forget/
However, when I run this, my main VI is as slow as if I didn't use an asynchronous call. For your information, the only node inside my main while loop is the "Start Asynchronous Call" node.
Is there something I am missing on how running this subVI without slowing down my main VI?
Thank you very much!
Solved! Go to Solution.
06-27-2016 10:27 AM
06-27-2016 10:41 AM
Are you calling "start asynchronous call" once or with every iteration of the loop?
How fast is "much faster"? How do you measure the loop rate?
06-27-2016 10:43 AM
Sure!
See below. The "Start Asynchronous call" node is inside the loop since I believe it is needed to make calls to the subvi at every iteration, otherwise the subvi state shows as "subVI waiting to run" and doesn't do anything.
Thanks!
06-27-2016 10:46 AM
can you attach the subVI instead? Does it complete quickly?
06-27-2016 10:56 AM
See below for the subVI.
It is basically interfacing with a Thermocouple reader (Pico tc08). It works, but takes a second or so collecting the voltage of every thermocouple attached to it. Even when I get rid of the signal part and only replace it with indicators, there is no difference in the execution time.
For now I am just focusing on getting my main VI running without being slowed down by this subVI.
06-27-2016 11:04 AM - edited 06-27-2016 11:06 AM
The subVI seems to be running on it's own (unless there is an error or stop is pressed), so there is no need to call it over and over again.
(Are you aware that stacked sequences with sequence locals are an indication of poor coding skills? Do you know that index array is resizable? Do you know that you can chart without using dynamic data? Your "close&exit" button does not seem to work as you expect)
06-27-2016 11:11 AM
I would guess your main issue is the DLL calls are set to run in the UI thread. This could keep your main VI from updating until that DLL call is complete. Try setting them to "Run in any thread".
Also, you do not need to keep telling this VI to run over and over again. It just needs called once.
06-27-2016 11:26 AM
The subVI node was retrieved from another source and is a bit hard to work with, I agree. The previous VIs posted were just an illustration of the issue I am running into. The ones posted below are the actual VIs (main and subvi of concern) I am working with right now.
Hopefully you can see the asynchronous call in the main one, same format as the examples posted above. The subvi was modified (signals removed, while loop removed, stop signal managed by a functional global variable). I'm unfortunately not proficient enough in LabVIEW to modify this subVI properly to make the process faster, hence the need of an asynchronous call.
But that returns to the same initial problem: regardless of the subVI or how it is coded, why is my main VI slowed down by this subVI, despite of the asynchronous call? I thought an asynchronous call would make these two loops run independently from each other.
Thanks again!
06-27-2016 11:32 AM
@crossrulz wrote:I would guess your main issue is the DLL calls are set to run in the UI thread. This could keep your main VI from updating until that DLL call is complete. Try setting them to "Run in any thread".
Also, you do not need to keep telling this VI to run over and over again. It just needs called once.
Yep, it is very likely, I had also some trouble before with a DLL ( link ), after setting the dll call to "run in any thread" fixed the GUI speed issue...