LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TDMS refnums, not a refnum compare and feedback node

Solved!
Go to solution

Hey guys,

 

I have an issue with the refnum to an TDMS file. I've written a VI which generates a TDMS file, if it is not existing yet and is storing some data inside. Since this VI will be continuously recalled, I dont want to close the TDMS file, but pass the reference to the next call of the VI. To do so, I pass the reference to a feedback node.

 

grafik.png

 

When I first run the VI, the left refnum compare returns true and the right one false as expected (cf. probe watch).

 

grafik.png

 

However, if I run the VI again the feedback node seems to return the correct refnum (compare probe watch) but both the not a refnum compare functions return true! This behaviour is confusing me.

 

grafik.png

 

grafik.png

 

Maybe there is some misconception on my side. Can someone explain to me, whats going wrong here?

 

Thanks & Cheers,

Jens

 

PS: find the MWE attached

 

PPS: Edited due some text loss when posting

0 Kudos
Message 1 of 3
(1,272 Views)
Solution
Accepted by topic author Dr.Polz.Photonics

Hi Polz,

 

when the VI stops execution LabVIEW will automatically close all references for you.

So even when the feedback node gives a reference in the next run that reference is not valid anymore!

 

You can prevent the automatic reference cleanup (kind of garbage collection) when your VI is called in a context where the execution is not stopped, like when you call the VI as subVI in a loop of your mainVI…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 3
(1,241 Views)

Hey GerdW,

 

I am embaressed. Could have thought of that one myself...

The VI is going to be a subVI anyways, so no trouble at all. Just wanted to test it before deploying it to the main program. Thanks for the eye opener.

 

Cheers,

Jens

0 Kudos
Message 3 of 3
(1,234 Views)