06-12-2012 10:39 AM
I've been trying to integrate a Sub Panel into my UI. The reason is that for developers and debugging, we use the sequence editor, but the operator interface is a custom UI. For a parallel model, we have a custom UI to run the sockets. I want that UI to load into a sub panel on the operator UI but when running in sequence editor, just launch the VI.
My problem is with the sub panels. I thought I had this working but it turns out I was doing things in a certain order that allowed it to work within the sequence editor. What I was doing was launching the UI when in the sequence editor. I would then close it, open a separate VI (for test purposes) that had a subpanel that would open the UI and it ran fine. I ran into problems when trying to integrate this into the main UI (ie not using sequence editor at all). The main UI would start the parallel model. I found the path to the parallel UI using RunState.Engine.FindFile(). I then try to load that file into the subpanel. The front panel loads but the VI isn't running.
I started experimenting with just a basic VI and basic subpanel and noticed some things that are probably causing me problems. There are two images attached here. The No Path indicated shows that first time the sequence is run. The VI call to it's own path doesn't return anything. But the next time I call the sequence, the path is there. I also noticed that if the VI is already open, the VI path is there.
What I need is a reference to the VI that TestStand opens so that I can load that into a sub panel. Looks like just using the path doesn't work. Is there a way to get the actual VI reference for a step executed in TestStand so I can use that to load the VI into a sub panel?
06-13-2012 05:38 PM
06-14-2012 10:06 AM
Thanks for the response. I think these are similar to what I'm trying to do but not quite the same. Really, my main issue is getting a reference to the VI that is running. I want to launch a VI, get a reference to it (that is valid), send that to my UI via a UIMessage or perhaps telling the UI that the reference is available to retrieve, then have the UI load that VI into a subpanel. The reason I say "that is valid" is that it seems that if I just try to use the path to the VI, the subpanel loads the VI but it isn't the one the TestStand has running. So I need a reference to the VI that is running so I can load that into the subpanel. If I can get that, I shouldn't have any problem getting that to my UI to load the subpanel.
08-17-2012 08:47 AM
I still need a solution to gettinga subpanel in my Operator Interface. If running from the Sequence Editor and the user wants to run a parallel test, it will launch a LabVIEW OI specifically for parallel testing. But if running from the main Operator Interface, I want to launch the parallel GUI from TestStand and have it loaded as a sub panel in the main OI.
I can get a reference to the VI and load it into a sub panel, but the VI isn't running. It is like it loaded a separate instance. The parallel GUI is running somewhere in the background because when I try to exit things are still running and I end up crashing LabVIEW. I tried saving a reference to the parallel GUI to a TestStand variable as a type of Interface then getting that variable in the main GUI but when I convert the variant to a VI refnum type, it says it is an empty refnum, even though the variant has a value that looks valid.
Not sure if these are more LabVIEW questions??? Is there a way to cross link this post to that forum?
08-20-2012 07:57 PM
Hi Sir Mutt,
I'll see if I can replicate something to get what you're after. If you're sending a reference to the VI file through your UI message without giving it any reference to the instance, than I can see where you're running into this problem. Are you passing the sequence context at any part of your code?
I would probably leave this as a TestStand question, although the lines do blur from time to time.
08-21-2012 07:10 AM
The Main Operator Interface is where the sub panel is to load. I do not have the sequence context there. I've looked for ways to find it via the API but haven't found that, but I don't know if that would really help. The main problem is the sub panel.
08-22-2012 04:49 PM
Hi Sir Mutt,
While I was looking into this a bit more, I did happen to come across an example titled "Dynamic Subpanel in a TestStand User Interface" which seems to do what you're looking for. Specifically, you might want to look at Callback.vi in TestExec.llb which implements the sub panel. Let me know if this is helpful for you.
08-30-2012 08:40 AM
This certainly looks promising. It doesn't look much different from what I've been trying but there are some subtleties that may be the fix. Hopefully I'll get to a point where I can try this soon. Thanks.