I'm facing a small problem dealing with VI references and subpanels.
I made a 'Main VI' which contains 4 subpanels and a tree view. The idea is to to drag and drop 'items' from the treeview into any of the 4 subpanels. Each item correspond to a specific VI. This works perfectly fine.
The idea is also to keep the VIs loaded running until the 'Main VI' is executing. This allows to launch as many executions as needed ; when an item is droped in a subpanel if it's already running (droped before in any subpanel) it shows the current execution FP state. This work perfectly fine, each VI 'loadable' in a subpanel is reentrant and launched using VI Server w/option 0x08 and I keep track of each execution using a pool of opened VI references.
The problem occurs when trying to drop an 'item' which is already displayed in a subpanel. Error 1145 is thrown. In that case I would like to make the subpanel currently holding the already existing execution blinking.
So I had the idea to use 'Inserted VI' property on each of my subpanels (so 4 references) to detect which one is loaded with my VI. To do that I compare the reference coming from 'Inserted VI' property f each of my subpanels to the currently opened VI ref (see pics attached). But it appears that both references are different !! How is that possible ?
How to find the real reference of the VI loaded in the subpanel ?
Try doing the comparison without the Type Cast. Equals? will return true if two references with different numeric values both reference the same object.
My suggestion would be to track it yourself - just log which SP holds which VI and search that log to know.
I don't think it's such a strange behaviour. In fact, if you had the same refnum, it means that you are pointing to the same VI. As you have two instancies loaded, they must have a different refnum.
Mathieu P. | Certified LabVIEW Associate Developer
National Instruments France
Mathieu, this is the purpose of my problem : I want to point on the same VI ! I load a VI in a subpanel and I want to retrieve its reference using the property node 'Inserted VI'. So it should give me the same reference as the ref loaded...
Or, maybe, it means that this property node gives another reference on the same VI (like if there was an 'open VI ref' function hidden behinf this property node). THIS would be weired !
How do you get this VI clone name ?
Is this name unique to a VI reference even if this VI is set as reentrant and launched using 'open VI ref' with option 0x08 ?
Just to let you know, I found a way to the job by my self using an array of cluster to store all needed information.
But I really would be interested in knowing how this 'Inserted VI' (new in LV2012) property node works !