LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Tab control

Hey

 

I'm designing an automated productionline for vacuumforming plastic as my bachelor thesis, and I'm useing LabView to control it all. I need the program to have different modes, depending on what I want to create. To do that I have used the "Tab Control" to be able to have it all in one VI, but now I have ran into a problem. If I start one of the tabs, I have to stop the program to be able to go to a different mode. Is there a way to run one mode, and be able to go to another tab when that process is done without restarting the VI?

 

My current setup is as showed in the pictures.

 

Thanks

Download All
0 Kudos
Message 1 of 4
(3,142 Views)

It is hard to help when you post just a couple screenshots.  Post an actual VI so we can poke around, see how it runs, and see what happens in other cases of the code.

 

In general, tab controls don't actually control anything.  There terminal is very rarely wired to anything.  They primarily are meant to organize the front panel indicators into different groups.

0 Kudos
Message 2 of 4
(3,128 Views)

My bad.

Here is the VI

0 Kudos
Message 3 of 4
(3,124 Views)
The first problem is that the inside while loop never stops so once a particular mode starts running it can never stop. However, that is just the first of the problems.

The bigger issue of is that your application needs a way to do nothing when it starts and continue doing nothing until the user clicks a "Start" button. At that point it should run what ever process conforms to the mode they have selected. When the mode finishes, the application should go back to doing nothing until the user clicks "Start" again.

To begin, you should look at rewriting your application using events so it can respond directly to button clicks and can in essence put your application to sleep when it isn't doing anything useful.

Next, you are already using a state machine structure -- that is very good. It means you are already thinking in the right direction. What you need to do next is learn about the QSM or Queued State Machine. This variant of the state machine generates an array of states to be performed based on the inputs the user has selected, and then just starts stepping through them one by one when the user presses "Start".

Finally, you need to go through the individual state machines for all your modes and generate a list to unique things that all the machines do. Now create one big state machine with all those unique states in it.

Say you end up with an array with (for simplicity sake) has five states in it. You can start looking at the array of states that each mode needs to perform in order. For example, Mode 1 might need to do steps 1,5, and 3; Mode 2 might do 2, 3, and 4; and so on.

This may seem complex but take the process one step at a time and document everything and you'll be fine. Believe it or not you have the hard part done already: you have figured out how to make the modes work.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 4 of 4
(3,114 Views)