03-19-2014 12:05 PM
Was hoping someone may have a suggestion...I mentioned previously I use VI scripting to create a bunch of controls and indicators from a text file. Along with that, it stores a reference number for each control in an array. I copy these controls/indicators to a separate VI, then register the contents of the refnum array with dynamic event registration, the goal being that a value change on any of the controls will trigger the event structure.
I started testing and found that the contents of the refnum array, although valid when I began testing, changed to "Refnum no longer valid" after I closed the VI. I guess this makes sense...I guess what I need in my case is effectively an "absolute refnum", basically a single reference that will be associated with a control at all times, and will persist regardless through program execution and shutdown. Do such references exist? The only other alternative I can think of right now would be to build the array of references at runtime each time, but I'm not sure how I would do that...things are put in the array in a specific order when I run the VI script, so right now I don't see any way that I could re-capture that order by building the array at runtime (i.e. through some use of Scan for GObjects VI that finds each control one by one and gets a reference to it).
Surely there's an easier way to make it persist?
03-20-2014
04:21 PM
- last edited on
12-20-2021
08:17 AM
by
NI_Community_Su
Hi bmishoe,
Please refer to this forum.
Refnum is No Longer Valid - Discussion Forums
https://forums.ni.com/t5/LabVIEW/Refnum-is-No-Longer-Valid/td-p/539259
Thank you