LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

multiple control for case structure selector

Solved!
Go to solution

I have four processes going on ... my first process is supposed to work for 12 hrs and next three process for 1 hr each.Since i have many variables to display i am using tab control. Now my question is how do i use two controls for the case selector one based on tab control where the user can see individual process parameters and second one based on time where the process need to be automated according to the time that is when 12 hrs elapses the second process continues for next 1 hr similarly 3rd and 4th processes. can anyone please help me 

 

i am attaching my vi

0 Kudos
Message 1 of 9
(6,880 Views)

Put another case structure inside your case structure.

 

You could also try doing some math on your tab control value and the booleans to make a case for each combination.  I tend to avoid that just because it gets complecated unless you document really well.


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 2 of 9
(6,855 Views)

When I read this I wondered if the question was poorly formed.  You're asking how to make a decision based on the tab control AND elapsed time, but describe each tab as containing data pertinent to the current test, which is based on elapsed time.  Are you really asking how to control the dataflow based on which tab the user has selected?  I thought you might actually want the appropriate tab to be displayed.

 

If you want to decide based on elapsed time AND selected tab, you can use Boolean Array to Number and Number to Boolean Array to combine all possibilities into one Case structure.  Nested Case structures, as crossrulz suggested, may be easier to read.  Here's my implementation.  The visible case will execute if only y < time and the Process 1 tab is selected.

 

Example_VI_BD.png

 

Otherwise, you can use a Value Property node to set the visible tab based on the elapsed time.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 3 of 9
(6,832 Views)

Sir , the code you showed is not working..only the default case 0 is executing each time....  Sorry for making my question messy... the thing that i want is ... i want to have a case structure with four cases with four processes.i need my case selector to work based on time i.e. only when process 1 finishes it goes to process 2,3 and 4.As i mentioned earlier the first process will work for 12 hrs and remaing ones for 1 hr each.Since i have a lot of Variables i am using Tab control.Now ,Suppose at any instant i am in process 3 and my process 1 and 2 have already finished .. i want to view the results of process 1 and 2 . i should be able to select the tabs and see the corresponding case........

 

i have tried something.here the particular case is executing only when i select a tab.otherwise again the default case is executing.i am attaching the VI

0 Kudos
Message 4 of 9
(6,816 Views)

sir , i have a tab control for one case.how will i make it work.here is my attachment.please help me out.

0 Kudos
Message 5 of 9
(6,813 Views)

You can compare the elapsed time with an array of test end-times (you can modify this to use an array of test durations) and select which calculations to do.  I added in the Property node to display the current test values.

 

Example_VI_BD.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 6 of 9
(6,762 Views)

Thank you sir for your reply.I tried executing the VI for a difference of 1 minute in each case.But,Still only the first case is executing.Sir,in the suggested VI you have compared the array of values greater than elapsed time.but is the time format compatible.what i mean to say is ,in each case time indicator is used,whereas while comparsion double type is used,Don't we need to select the data format in time and date format for double type.Also,sir the time frame in each case should be within threshold limits i.e. (a>=t<=b) ,that is for case a (0-12) . if only greater than is used ,it is not solving the problem.I tried to modify your VI but still couldn't find a possible solution.Here,are the approches i tried.

Kindly see the attached VI.

0 Kudos
Message 7 of 9
(6,722 Views)
Solution
Accepted by topic author kausreloaded

This?

 

Example_VI_BD.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 8 of 9
(6,703 Views)

Thank you very much sir, I found a solution from your previous VI , I just Changed the double data type format to Relative time and did some manipulations.Actually the new VI you have given is tough for me , I am just a beginner. If you can just explain the logic of this new VI ,i will  be Thankful to you.

 

Here is the finally implemented VI that i tried.

0 Kudos
Message 9 of 9
(6,687 Views)