05-18-2023 09:50 AM
I have a functional global variable containing an array of references to system resources obtained from the nisyscfg\Find Hardware.vi
The first time it runs, the array is empty, then the "Find Devices.vi" subVI finds all system resources using a custom filter. This is working well. It then filters out the specific device specified by the "Product Name" input. Still ok.
The problem comes when I run the VI again. Since the shift register is uninitialized, the array should now contain the array of references from the previous call. But all references are closed. The values on the left of the probe watch window are still the addresses of the references, but on the right, they are 0!?
Probe [38] is on the shift register output, probe [39] is on the shift register input.
I want to store the references for later use and don't run the Find Devices.vi each time, as the nisyscfg\Find Hardware.vi takes a few seconds to run.
How can I make sure that the references are not closed when my VI finishes executing?
Solved! Go to Solution.
05-18-2023 10:03 AM
What happens if you keep the toplevel caller running (I assume it is a state machine or similar) and then call the VI again.
05-18-2023 10:11 AM
Yep that was the problem 😑. I was too focused on testing the VI itself that I didn't test it in the designed use case. Thank you.