LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Xcontrol in Subpanel

Solved!
Go to solution

I have an Xcontrol that works great when I run my VI by clicking the run arrow; however, the Xcontrol does not seem to register events when the VI is dynamically run in a subpanel.  FYI, all other functionality of the dynamically run VI works fine (only the Xcontrol fails to work properly).  I need help understanding why and finding a good solution.

Thanks!

0 Kudos
Message 1 of 9
(3,052 Views)

FYI, I found that the Xcontrol (at least for LV2011) works if the dynamically called VI is open before the subpanel VI dynamically calls it.  Therefore, the Xcontrol does not work when docked inside the subpanel, but it does work if it is undocked.

0 Kudos
Message 2 of 9
(3,038 Views)

Sorry, I should have specified that I'm using LV2011SP1

0 Kudos
Message 3 of 9
(3,030 Views)

More specifically, it appears that I cannot use property nodes inside the Xcontrol, which is on a VI that is called dynamically to appear inside of a subpanel on the calling VI...

0 Kudos
Message 4 of 9
(3,021 Views)
Solution
Accepted by topic author Aaron_KZ

Found it.  The Display State cluster of references was not linked to the controls and indicators on the FP.  My guess is that the Exec State Change event within the event structure was not registered (this is where I would check if the references were good, and if not, then I would reinitialize the references.  As a work around, I used my references inside of a global variable instead of the display state shift register.  Now it works great even in the subpanel!

0 Kudos
Message 5 of 9
(2,993 Views)

pictures attached

Download All
0 Kudos
Message 6 of 9
(2,985 Views)

all functionality works when you use variables instead of the Display State shift register whether on VI or on dynamically called VI

Download All
0 Kudos
Message 7 of 9
(2,981 Views)

There is also a fundamental distinction that you need to understand. A subpanel does not call the VI that is in it - it's merely showing its front panel in a window. Consequently, the VI that is in the subpanel doesn't know that it is in a subpanel, as far as it can tell, its window is closed. So with that being the case, it is possible that the references in the xcontrol that allow it to access the VI that's calling it, are not fully initialized.

 

Also a VI in a subpanel doesn't have any direct access to the VI that is displaying it unless you explicitly pass it a reference when you open it.

 

You also said that the original problem went away if the VI with the xcontrol on it was already running before you tried to put it into the subpanel. This makes me wonder if there could be a timing issue. Loading a VI into memory with an xcontrol on it causes the xcontrol to start executing so there is a finite delay between when the vi is loaded and when it is ready to do something useful. What happens if you insert a delay of say a couple seconds between opening the reference to the VI and where you run it and put it into the subpanel - in fact for test purposes it might be interesting to put a longish delay between each of the step: opening the VI, running the VI and inserting it into the subpanel.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 8 of 9
(2,977 Views)

Actually, The symptom was the same if the Dynamically called VI was running continuously before it was shown in the subpanel.  The symptom seemed to go away if the dynamically called VI was open (running or not), therefore, the FP of the dynamically called VI did not display in the subpanel window, but the FP is open as a separate window ( I called it to run dynamically and saw the references worked fine).

 

But thank you very much for the explanations, I'm always trying to understand things better.  Thanks for replying!

0 Kudos
Message 9 of 9
(2,973 Views)