LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unexpected Subpanel behavior

Solved!
Go to solution

Hello, Labview 2020 running a TestStand 2020 UI with a subpanel which displays all the vis in the test stand sequence that I want.  I would like to dynamically change the position of the vi in the subpanel, which I can do by opening a reference to the inserted vi and manipulating its location relative to the subpanel location.  Works fine first time through, but when I finish the current sequence and start another test, I'll get an error 

ET_0-1659122730185.png

So I looked at my subpanel vi and stripped out things until the error went away

Here is the culprit

ET_1-1659122836155.png

Just by creating the reference to the inserted vi it causes this error.  If I take away that reference, no error.  Can't close the reference or I don't get anything in the subpanel.  Thanks

0 Kudos
Message 1 of 5
(1,272 Views)

@ET wrote:

 

So I looked at my subpanel vi and stripped out things until the error went away

Here is the culprit

ET_1-1659122836155.png

Just by creating the reference to the inserted vi it causes this error.  If I take away that reference, no error.  Can't close the reference or I don't get anything in the subpanel.  Thanks


I found that the best way to handle these kind of issues with sub panels it to make a class that has a valid ref to the panel and the VI that is in it, that way the sub panel object is not responsible for having the ref to the VI, you manage that yourself. See the snippet as an idea. 

snip.png

______________________________________________________________
Have a pleasant day and be sure to learn Python for success and prosperity.
0 Kudos
Message 2 of 5
(1,259 Views)

OK thank you , I'll check that out

0 Kudos
Message 3 of 5
(1,235 Views)
Solution
Accepted by topic author ET

Turns out all I had to do is set the location of the sub vi within the subpanel before I called the insert VI method.  I guess the Insert VI method does some housekeeping behind the scenes.

0 Kudos
Message 4 of 5
(1,177 Views)

@ET wrote:

Turns out all I had to do is set the location of the sub vi within the subpanel before I called the insert VI method.  I guess the Insert VI method does some housekeeping behind the scenes.


Good to hear. In case it helps, I find that setting the 'Scroll panes to origin at run time' flag can help with getting sub-panels in the correct position when you call them. 

Jay14159265_0-1659452301092.png

 

 

______________________________________________________________
Have a pleasant day and be sure to learn Python for success and prosperity.
0 Kudos
Message 5 of 5
(1,162 Views)