LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

closing references - when

Solved!
Go to solution

I am parsing XML files using the dotnet XML properties and methods.

The question is, whether I have to close each reference I open vie property nodes and invoke nodes, or is it enough to close the reference of the entire document at the end of the parsing?

If not, I have to close each and every reference to nodes, attributes, items etc...

 

Madottati

0 Kudos
Message 1 of 9
(1,841 Views)

Instead of trying to answer myself, I bring to your attention a much more experienced programmer, see this video from 29:25 -->

https://youtu.be/LcLyl3Xtp3Y?t=29m25s

 

Message 2 of 9
(1,837 Views)

@Blokk wrote:

Instead of trying to answer myself, I bring to your attention a much more experienced programmer, see this video from 29:25 -->

https://youtu.be/LcLyl3Xtp3Y?t=29m25s

 


Darren was referring to LabVIEW objects.  .NET references are a different story.  Yes, you should close the references when you are done with them.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 9
(1,794 Views)


@crossrulz wrote:

@Blokk wrote:

Instead of trying to answer myself, I bring to your attention a much more experienced programmer, see this video from 29:25 -->

https://youtu.be/LcLyl3Xtp3Y?t=29m25s

 


Darren was referring to LabVIEW objects.  .NET references are a different story.  Yes, you should close the references when you are done with them.



@crossrulz wrote:

@Blokk wrote:

Instead of trying to answer myself, I bring to your attention a much more experienced programmer, see this video from 29:25 -->

https://youtu.be/LcLyl3Xtp3Y?t=29m25s

 


Darren was referring to LabVIEW objects.  .NET references are a different story.  Yes, you should close the references when you are done with them.


Did you watch that part of the video until the end? Darren also mentions .Net references, and stating that you need to close this references. This is why i posted this video. It gives a nice overview about when and when not you need to close references...

0 Kudos
Message 4 of 9
(1,791 Views)

@Blokk wrote:


@crossrulz wrote:

@Blokk wrote:

Instead of trying to answer myself, I bring to your attention a much more experienced programmer, see this video from 29:25 -->

https://youtu.be/LcLyl3Xtp3Y?t=29m25s

 


Darren was referring to LabVIEW objects.  .NET references are a different story.  Yes, you should close the references when you are done with them.



@crossrulz wrote:

@Blokk wrote:

Instead of trying to answer myself, I bring to your attention a much more experienced programmer, see this video from 29:25 -->

https://youtu.be/LcLyl3Xtp3Y?t=29m25s

 


Darren was referring to LabVIEW objects.  .NET references are a different story.  Yes, you should close the references when you are done with them.


Did you watch that part of the video until the end? Darren also mentions .Net references, and stating that you need to close this references. This is why i posted this video. It gives a nice overview about when and when not you need to close references...


No, did not watch the video.  But I did not remember Darren mentioning .NET references when I saw the presentation.  So my apologies.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 9
(1,787 Views)

No need to apologize 🙂 I posted that video because I think an overview of a topic is even better than only confining the answer to a specific question (closing .NET nodes). I really enjoyed this video, I have learnt a lot from it! 🙂

 

edit: by the way, just for the "reference", see the pdf from here: http://forums.ni.com/t5/Community-Documents/An-End-to-Brainless-LabVIEW-Programming/ta-p/3548039

Slides 25-26-27...

Message 6 of 9
(1,780 Views)

And also for reference, there is this article.  It does not mention .NET, but still some good info.

Closing References in LabVIEW


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 7 of 9
(1,765 Views)
Solution
Accepted by Madottati

If that is the video of Daren that I watched I belive he left out the clue that will let us decide about references "of the future" that are not explicitly documented in white-papers and KB articles.

 

I posted the clue in this thread but failed to attribute that knowledge properly as originally being shared by Rolf.

 

In short, cast the ref num to an I32 and display the value on the FP. If the number changes each time to create the ref, it needs thanged. If it is staic, no need to close.

 

The other caveat that I should add is that every time a ref is created a small amount of memory is allocated that only get released when the application goes idle. So try to create refs only once and close only once to avoid a vert slow memory leak (ho small? repeatedly opening aclosing a VISA ref took a test program the entire week end to goble up memory). While trivial in applications that are intended to run for an extended perior of time, it can make a difference.

 

Done with my notes.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 8 of 9
(1,750 Views)

@Ben wrote:

...

 

In short, cast the ref num to an I32 and display the value on the FP. If the number changes each time to create the ref, it needs thanged. If it is staic, no need to close.

 


...

 

Well I certainly lived up to my typing rep with that post!

 

The previous should have read:

 

In short, cast the ref num to an I32 and display the value on the FP. If the number changes each time it is created the ref, it needs to be closed. If it is staic, no need to close.

 

Thank you for reading what I intended and not what I typed.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 9 of 9
(1,726 Views)