The first thing you have to understand is that, technically, there are no "variables" in LabVIEW. The wires carry the data, and in the sense of variables like you have in text-based languages, those are the variables. That said, it sounds like the vendor VI is working with creating references, and that is what is being "destroyed" in the closing frames. You don't destroy arrays.
As far as "time-to-live": When a VI, runs memory is allocated for data as needed. That data is available to that VI, and that VI alone, unless you use other mechanisms, like output terminals, queues, functional globals, etc. Once the VI finishes, that memory is released.
It sounds like you're trying to use the vendor VI in multiple instances, and it also sounds like the VI wasn't designed to work that way. If you have the vendor VI used in one instance with the "init" setup, then it will create the references, and not do anything. If you then try to call the vendor VI somewhere else in your code and skip the "init" setup, the vendor VI will have no spectrometers with which to run since the internal array of references was never created.
That said, you have a couple of options:
- Break up the vendor VI into the respective blocks: init, work, close. You will need to modify them so that the array of references are controls/indicators as needed. In other words, the "init" VI will output an array of references, and the "work" VI will take in a control of references with which to work.
- Wrap the vendor VI with a functional global/action engine. Basically you would need to use a shift register to store the array of references, and then use a case structure around the individual "init", "work" and "close" sections.