10-21-2021 12:23 PM
I have a subVI that scans the computer for any NI hardware that's plugged in, and if found gives me some basic info about it. This VI is usually called by a main VI, and I was noticing that it was running very slowly.
Opening up the subVI's front panel and running from there (instead of being called by a different VI) produces the same effect. It takes about 1.5-2s to run completely. However, once I open the block diagram for the subVI, suddenly it only takes a handful of miliseconds to run. This effect continues even if I close out of the block diagram and even out of the whole subVI, and only goes back to being slow if I completely restart LabVIEW.
So I guess I was wondering why this problem is happening and what I can do to stop it. I searched pretty heavily on these forums and couldn't find anyone with even a remotely similar issue.
Solved! Go to Solution.
10-21-2021 12:31 PM
Who wrote the VI? Can you show us some code?
Hard to tell what's going on but maybe the Vi is caching earlier results. Scanning for hardware is typically not instantaneous.
10-22-2021 08:29 AM
Well, I didn't figure outthe cause of the issue, but I circumvented it (and also just made my code a lot better) by using a DAQmx system property node instead of a more general system hardware property node (since I'm only interested in scanning for DAQmx hardware changes anyways.
Looks like updating the code with that change fixed my issue, so I suppose you were correct in that it was somehow caching hardware information from previous runs. All good now!