09-06-2013 04:36 AM
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
Solved! Go to Solution.
09-06-2013 06:45 AM
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.
09-06-2013 12:10 PM
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.
Otherwise, you can use a Value Property node to set the visible tab based on the elapsed time.
09-08-2013 11:48 AM
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
09-08-2013 12:07 PM
sir , i have a tab control for one case.how will i make it work.here is my attachment.please help me out.
09-09-2013 09:40 AM
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.
09-10-2013 01:46 AM
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.
09-10-2013 10:34 AM
09-11-2013 01:34 AM
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.