From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Place decoration/indicator/control over multiple panes

I previously had a VI which, on finding an error, would change the visibility of a decoration, string indicator and boolean control to true, with them placed on top of the rest of the front panel. This allowed something like

 

The VI has encountered an error: <Error message>.

Closing in {5,4,3,2,1...}

<Ok button, to close earlier>

 

to be placed over the VI, count down, and then disappear, closing the VI.

 

I had some problems resizing this VI, and so I placed a splitter bar to try and aid my resizing/moving controls and indicators.

 

The error message and decoration now can't seem to cover the whole front panel - they only cover the area within the pane that they are owned by.

 

Whilst this makes sense, it isn't what I want. What should I do to be able to have a decoration/string indicator/boolean control over the top of the entire front panel?

 

Possibilities seem to include (although I haven't tried any yet):

- Transparent subpanel window over the front panel, with a second VI holding the message. Insert or remove as needed. I expect this will also be limited by the size of a single pane on the main VI.

- Make a new VI which holds this VI, and switch the inserted VI between my current main VI and a new Error VI. I expect this would work, and since I'm already inserting the main VI in a subpanel, it isn't entirely ridiculous, but I'm trying to maintain consistency with previous implementations for an older project using this library, so I need to be careful not to change the outwards appearance of the VI from the point of the (topmost) subpanel owner. Layering subpanels might be a solution, but then I'm having more problems with boundaries of the subpanels and resizing etc.

- Fork this library such that I ignore the old project, and then do whatever I feel like to handle errors in future. This is reasonably easy now, but might be a pain when it comes to comparing output from different versions (this library handles some hardware, and I want to ensure that if I change it, it still handles the hardware the same way...)

- Try to keep the middle pane large enough to hold the message, and consider moving other components of the error message onto other panes, or creating parts of the decoration in each pane that needs to display something, then just acting like they're all one decoration. This is probably also possible, but I'm imagining a huge mess with many more references. Since this is the only decoration on the panel, even if I have multiple panes, I could still use a for loop to iterate over all decorations to toggle visibility, but resizing becomes more difficult.

- Drop the error message display, and just exit immediately. This is simple and straightforward, but my old application won't have any way to show what went wrong. I could collect errors some other way in my new application. (I could edit the old application too, but then I'm investing time in something I no longer use and am working to replace...)

Get rid of the splitter and then handle resizing even more manually (but what's 3 more controls when you're handling 10 already) and then, since I have a single-pane panel, conclude problem solved

- Some far more intelligent solution that I just haven't thought about.

 

Any ideas?

 

 


GCentral
0 Kudos
Message 1 of 3
(2,529 Views)

Hi cbutcher,

 

What should I do to be able to have a decoration/string indicator/boolean control over the top of the entire front panel?

In case of an error you simply call a dialog VI which gets resized to match the frontpanel size of your other VI. As a dialog it is automatically in front!

You might even play with opacity to have your other VI "shine trough"…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 3
(2,494 Views)

@GerdW wrote:

call a dialog VI


Oh. Yeah, that was obvious in hindsight.

 

I initially thought this was the obvious and perfect solution, but it gives potentially difficult behaviour if the subpanel in which the main VI is inserted is not visible - with a dialog VI, the error will always jump to the top (perhaps this is good, if I have an error, but it's different...).

In my earlier case, if the subpanel wasn't visible (it isn't on top, it doesn't contain the main VI at present, ...) then the error also wouldn't become visible. The main VI would 'silently' end.

 

I'll have to think about if I want it to end without me noticing, but I already have handling to notice that the VI ended, so I could catch those (and I do) to detect unexpected ending. Having a VI pop-up (without the ability to suppress this) in part of the screen where something else might now be appearing might not be what I want.

 

Hmm...


GCentral
0 Kudos
Message 3 of 3
(2,485 Views)