09-29-2017 09:16 AM
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.
10-04-2017 11:25 AM
@Blokk wrote:
@LV_COder wrote:
Thanks.
Is this the case all find reference like file reference, controls reference, notifer and like this others.
Hemant
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): https://youtu.be/LcLyl3Xtp3Y?t=29m26s
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?
10-04-2017 11:37 AM
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...
10-04-2017 12:49 PM
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.
/Y