07-29-2022 02:30 PM
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
So I looked at my subpanel vi and stripped out things until the error went away
Here is the culprit
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
Solved! Go to Solution.
07-29-2022 03:14 PM
@ET wrote:
So I looked at my subpanel vi and stripped out things until the error went away
Here is the culprit
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.
07-29-2022 04:57 PM
OK thank you , I'll check that out
08-02-2022 09:00 AM
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.
08-02-2022 10:01 AM
@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.