Showing results for 
Search instead for 
Did you mean: 

Reg. Queue Reference.

Go to solution

G Object pretty much means everything within the LabVIEW programming language.  So yes, nodes, structures, functions, terminals, subVI's.


There are a few things that might not be considered G Objects.  If you go to View >> Class Browser, you can see how all the different classes are organized within LabVIEW.  GObject is at a very high level.  If you go to the Class drop down and pick Generic, GObject is right under that.  As you dive into that drop down further, you can see the vast majority of LabVIEW Classes fall under GObject.

0 Kudos
Message 11 of 14

@Blokk wrote:

@LV_COder wrote:



Is this the case all find reference like file reference, controls reference, notifer and like this others. 



Yes, for most of them. You can find very useful info in this video too, about what kind of references should you close, and which are not (like the Close Ref is a no OP for those):

Watch the video from 29:25 for reference closing topic, but it is worth to watch the whole anyway...


By the way, do not forget another thing with Queues/Notifiers, etc: if you use a named Notifier for example, and you Obtain Notifier with the same name again to reference it at another place in your code, you must close this second Notifier Reference too (since a new Notifier Refnum will be spawned after the second Obtain Notifier. Or, just use the "force destroy?" option...

("force destroy? indicates whether to destroy the notifier. If FALSE (default) and you want to destroy the notifier, call the Release Notifier function a number of times equal to the number of times you obtained a reference to the notifier or stop all VIs using the notifier reference. If TRUE, the function destroys the notifier and you do not have to call the function multiple times or stop all VIs using the notifier reference.")





So No need to release the queue if obtain queue used unnamed queue. 

And no need to close the file reference. As these 2 also falls under the GOJECT right?

0 Kudos
Message 12 of 14

I am not really sure what is your point, but i always close queue references, file references. Those things are not like using a property node with a control reference. In this case, closing or not closing the control ref will not make any difference. However, not closing a queue or file reference might create serious problems! Always close them after finished using them! What about if you reuse/call that code part iteratively later many times as a subVI or in a loop? This will create a nice memory leak for you. Do not create bad programming habits. So either using named or not named queues, you need to close them. I only explained the difference between a named or not named queue/notifier, so you remember that in named cases you might want to release the whole ref pool with the "forced close" option set true. But this is explained in the help too...

Message 13 of 14

So No need to release the queue if obtain queue used unnamed queue. 

And no need to close the file reference. As these 2 also falls under the GOJECT right?

As long as the reference is open, it uses memory and in the case of a file reference windows considers it occupied, thus no other program can look at the file (usually). You might also lock yourself out from the file for the same reason. The fact that LV closes the references is just a safety net, not a way to good programming.



G# - Award winning reference based OOP for LV, for free! ADDQ VIPM Now on GitHub
"Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
0 Kudos
Message 14 of 14