02-25-2020 01:15 PM
HI,
I have a vi that will open the reference for all network shared variables and store that reference in the global variable.
other vi will perform read/write operation on that NSV using global reference,
Open Variable Connection in VI1 works as per expected and store the reference in a global variable,
But when I call VI2 with same global variable it gives an error "
Error -1950678961 occurred at Write Variable in NSV_ReadOrWriteMod7.vi
Possible reason(s):
LabVIEW: The connection to the variable has been closed.
"
Solved! Go to Solution.
02-25-2020 03:01 PM
I would expect the NSV is closing its connection after the first VI runs. Try making a third "master" VI with a button for "run VI 1" and "run VI 2". Run 1 first, then try 2. If you just run 1 once, it'll open the connection to the NSV, but after it closes there won't be any VI's accessing the NSV, so it'll probably auto-release the reference.
You need to make sure the reference remains in memory, otherwise it'll probably get auto-closed.