LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Get VI Reference to Async Called Re-entrant VIs?

Hi All,

 

I am trying to make a resize-able UI. My current plan is to have a main sub-panel. I would like to spin up multiple copies of one VI that's stuffed into the sub-panel all with their own data space. This would allow me to switch between them in the sub panel and for each to show different data.

 

I have been successful in starting them using this code, however, how do I get VI references so I can place them into the sub-panel? I can't figure it out.

 

xkenneth86_0-1619842213392.png

 

0 Kudos
Message 1 of 3
(996 Views)

Use temporary one-element Queues to pass the "This VI" reference back from your VIs.  So in your FOR Loop, create a queue and pass it in as an input, them wait for one element on the Queue (then destroy the Queue).  Inside the VI your first action is to enqueue the "This VI" reference.

Message 2 of 3
(966 Views)

You can also simply call the OPEN in a loop (with option 0x80) once for each VI, and then you will have their references directly from there. This is easier than dealing with the clone pool, and since your VIs are probably running through the lifetime of the caller, the pool wouldn't really do anything anyway.

 

Note that depending on how your resizing works, having VIs in subpanels could be a pain. If you simply say "I want the VI to fit in the SP and the SP to fit in the pane", then that's easy enough, but if you have cases where you want different levels of the UI to determine the size (for instance, logic in subVI A should determine how big its containing subpanel should be), then that becomes more complicated.


___________________
Try to take over the world!
Message 3 of 3
(918 Views)