LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Original VI reference Vs 'Inserted VI' Ref

Hi everybody,

 

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 ?

CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
Download All
0 Kudos
Message 1 of 14
(3,367 Views)

Try doing the comparison without the Type Cast.  Equals? will return true if two references with different numeric values both reference the same object.

0 Kudos
Message 2 of 14
(3,356 Views)
My Vis are reentrant so Equals doesn't help in that case (always return true, see lv help on 'open vi ref')...
CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 3 of 14
(3,344 Views)

Ah, should have read that part.  Sometimes I am a picture person and skip text.

0 Kudos
Message 4 of 14
(3,339 Views)

My suggestion would be to track it yourself - just log which SP holds which VI and search that log to know.


___________________
Try to take over the world!
Message 5 of 14
(3,326 Views)

Yes at the end it be like that, I'll have to handle it like this...

But it doesn't answer the question : why is the 'inserted VI' ref is different from the original reference ?

CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 6 of 14
(3,324 Views)