LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Automatically running a vi after switching tabs

 

 

I am currently working with a multi-tabbed vi. After the Tab 3 vi is executed, the program automatically switches to Tab 4. I want this Tab 4 vi to automatically run at this point. I have tried the RunOnOpen tool but it doesn't seem to work for my application... perhaps I am not initializing it properly? 

 

How can I get an individual tab to run automatically after a tab control event?

0 Kudos
Message 1 of 13
(3,758 Views)
That does not make much sense. Tabs don't execute. They are primarily used for display. It is a subVI that executes and would write to specific indicators whether grouped on a tab or not. You really should post your code. It sounds like you just need a simple state machine.
0 Kudos
Message 2 of 13
(3,750 Views)

Alright, I have posted an example of what I want to do... I want tab 2 to "run" as soon as tab 1 is finished and flips to tab 2. I hope that I am making sense... 

0 Kudos
Message 3 of 13
(3,742 Views)
No, you still don't make any sense. You can set a tab to display by just writing to a local variable but talk of running a tab is just silly. Please post an image of your code as I am posting from my phone. Include an image of the front panel.
0 Kudos
Message 4 of 13
(3,736 Views)

This sounds like a good place for a State Machine.  Regardless, you need a loop that your case structure goes into.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 13
(3,729 Views)

Here are images of my vi. I don't know how else to describe that when I have Tab 1 active, and click run, Tab 1 is the only part that executes. If I have Tab 2 active, and click run, Tab 2 is the only part that executes... 

 

What I am trying to do, while preserving the tab structure, is to have Tab 1 active, press Run, Tab 1 executes (including setting Tab 2 as the new active tab), and running Tab 2 without the need to physically press the Run button. 

0 Kudos
Message 6 of 13
(3,726 Views)

 Front Panel - Page 2

0 Kudos
Message 7 of 13
(3,725 Views)

Your VI is inside out.  The while loop belongs on the outside.  The case structure belongs inside.

0 Kudos
Message 8 of 13
(3,716 Views)
Please look into taking one or more of the free LabVIEW tutorials.
0 Kudos
Message 9 of 13
(3,692 Views)

I don't think I can invert their order. You see, this is just an EXAMPLE vi of what I am trying to accomplish using a much more complex vi. In my complex vi I have four tabs which have portions of code that are reliant on a user pressing an "ok, execute" button, among other things. I want to be able to open Tab 1 and execute it when I am ready, then switch to Tab 2 when Tab 1 is done and execute Tab 2, etc. However, I wanted things to be different between Tabs 3 and 4. I wanted the switching tabs and "run" to be automatic, because the time it takes for Tab 3 to execute is about 6 hours and there will not be a user sitting there waiting to hit the "run" button on Tab 4 once Tab 3 is done executing. 

 

All I wanted to do, was be able to keep my code seperated using tabs. That may sound ridiculous, I don't know, I am fairly new to labview and I THOUGHT I had been using tabs the proper way. I guess not. 

 

At this point I am ready to just move my code on Tab 4 to Tab 3 and be done with it. 

0 Kudos
Message 10 of 13
(3,668 Views)