LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

LabVIEW tab control not working

Solved!
Go to solution

I am using LabVIEW to operate an ESPEC environmental chamber. In my front panel portion of the program I used multiple tabs due to the amount of graphs and input data the program has. When I run the program hooked up to the system it will not let me switch between tabs. The program runs and I can flip through the tabs to see the data recorded by the graphs once I hit stop. Does anyone know how to fix this? Do tabs not operate fully when a program is running? 

0 Kudos
Message 1 of 9
(1,492 Views)

Please share your code.  It sounds like you have a long running loop inside of an event structure.  And the event is locking out the front panel updates until you click stop and the loop exits.  If so, this is very bad design.

aputman
LabVIEW 2017
LabVIEW Programming
0 Kudos
Message 2 of 9
(1,491 Views)

The code is very long, do you know off-hand which type of long running loop would cause this? Or is this the case for all running loops inside an event structure

 

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

All long running loops inside of event structures is bad design.  Look for examples of state machines.  State machines use a very simple messaging system.  "When a button is clicked, go to the indicated state and execute the code there."  Depending on the code architecture, the long running code could either be in a loop separate from the one with the event structure or it can be in the same loop with the event structure (in which case, you have to be careful again to not lock out your front panel event structure).  

 

An example of the first option might be the template for a producer/consumer design pattern for events that ships with Labview.  An example of the second option is the JKI State Machine, a very good design that I use regularly.  This can be found on VIPM.

aputman
LabVIEW 2017
LabVIEW Programming
0 Kudos
Message 4 of 9
(1,471 Views)

Oh....and by "long running loops", I mean longer than 1sec.  The reason for it is because I like for my UI to respond quickly, meaning that when I press the button, I want it to do what it's supposed to do right when I tell it to do so.  If there is any sort of delay, the user starts randomly clicking buttons thinking the UI is locked when in fact all of those events are being queued and when they are allowed to execute, pandemonium sets in, windows start popping up, etc.  

aputman
LabVIEW 2017
LabVIEW Programming
0 Kudos
Message 5 of 9
(1,466 Views)
Solution
Accepted by topic author Vwilks14
06-02-2017 06:03 AM

Is it possible that your tabs are indicators instead of controls? Unless they are controls, you will not be able to operate them at run time. (you can switch mode by right-clicking).


LabVIEW Champion Do more with less code and in less time
Message 6 of 9
(1,433 Views)

@aputman wrote:

Oh....and by "long running loops", I mean longer than 1sec.  The reason for it is because I like for my UI to respond quickly, meaning that when I press the button, I want it to do what it's supposed to do right when I tell it to do so.  If there is any sort of delay, the user starts randomly clicking buttons thinking the UI is locked when in fact all of those events are being queued and when they are allowed to execute, pandemonium sets in, windows start popping up, etc.  


LOL - Call this syndrome the "Karen click-fest" after my wife, who is the impatient sort who will do exactly what you just described, then wonder what the heck just happened, when all those clicks come due.

Sometimes the UI gets ahead of the code.  By that, I mean that since the UI and the code are largely decoupled in my applications, the UI remains ultra-responsive, but stuff may still be happening under the hood.  If I feel that the execution time can take longer than the amount of time it would take a user to move the mouse and click a button, I will throw up a busy icon to prevent the user from clicking anything until the application is ready for input.  If the user might need to click on some kind of abort button, I have no choice but to disable all inputs individually for the duration of the long-running code, except for the "eject the warp core" button.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 7 of 9
(1,425 Views)

billko wrote: 

If the user might need to click on some kind of abort button, I have no choice but to disable all inputs individually for the duration of the long-running code, except for the "eject the warp core" button.


I saw someone describe some time ago the idea of placing a transparent decoration over your VI to block key-presses. Perhaps you could, by combination of multiple decorations if needed, mask your buttons to disable and leave the Abort button uncovered, allowing you to only use one (or a small number) of references to property nodes rather than having to iterate through all but one control?

0 Kudos
Message 8 of 9
(1,398 Views)

@cbutcher wrote:

billko wrote: 

If the user might need to click on some kind of abort button, I have no choice but to disable all inputs individually for the duration of the long-running code, except for the "eject the warp core" button.


I saw someone describe some time ago the idea of placing a transparent decoration over your VI to block key-presses. Perhaps you could, by combination of multiple decorations if needed, mask your buttons to disable and leave the Abort button uncovered, allowing you to only use one (or a small number) of references to property nodes rather than having to iterate through all but one control?


That would be okay for most applications.  Of course the caveat would be that overlapping controls and decorations put a strain on the computer, since I don't believe that LabVIEW features accelerated graphics (although I haven't looked into NXG, which I would assume probably does, because it's the only way I can see it doing certain tricks).

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 9 of 9
(1,357 Views)