LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

is it possible to use if else if condition in labview

In one of applications i am in need of 3 conditions and they all dependent.IF first condition is true then it has to do some subroutine and return to the first condition until it is false.If first condition is false , then second condition ( true ) another subroutine till 2nd one becomes true.
similarly for 3 conditions.
 
I tried using case structures but didnot get correct results.
can anyone help me out with this regard.
 
Thanks & regards
radhika venkataraman

Message Edited by radhika on 12-13-2006 06:51 PM

0 Kudos
Message 1 of 20
(20,987 Views)
What is your LabVIEW version?
 
From your description, it seems that a stack of three case structures should do the trick just fine.
 
(Maybe you can attach your VI so we can fix it. ;))
0 Kudos
Message 2 of 20
(20,979 Views)

Hi

I am using Labview 7.1.

I also tried using case structures , but my difficulty is from one case structure the control should go out to the main and again return to the other case structure.

I  will send simplified form of my VI later.

thanks for your help.

radhika venkataraman

 

0 Kudos
Message 3 of 20
(20,974 Views)

Hi

Here is my sample vi which explains my difficulty.

thanks & regards,

radhika

 

 

Message Edited by radhika on 12-13-2006 08:42 PM

0 Kudos
Message 4 of 20
(20,972 Views)

Hi radhika, Christian,

      Please forgive me for barging-in - saw a pattern radhika's original description and thought the attached VI might give him an idea.  I looked at your VI, radhika, and noticed the comment about changing Control 1 after checking Control 3?  You original description implies that Control 1 and Control 2 are in range before checking Control 3(?)

Also, arrays (data 1 and data 3) are wired into the for-loop (auto-indexed), but "N" is also wired (=10.)  The number of iterations will be the smaller of: N, length(Data 1), or length(Data 3.)

Cheers!

 

Message Edited by tbd on 12-13-2006 10:55 PM

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 5 of 20
(20,954 Views)
Hiii Radhika,
 
                I have tried to execute your VI, but the main thing is the counts of your for loop were not running first of all i dont know why? attaching the jpeg of that here.
 
                  Even i added the while loop around to yuor code, but still it wasnt executing, tell me why? n pls try to explain in detail your example, may be we ll be able to sort out your problem.
0 Kudos
Message 6 of 20
(20,948 Views)


@Nishant wrote:
                I have tried to execute your VI, but the main thing is the counts of your for loop were not running first of all i dont know why?


Simple explanation:
The number of iterations depend on whatever is smallest: (1) the number wires to N or (2) the array size of the smallest autoindexing array input. Arrays data1 and data3 have size zero and are autoindexing, thus the FOR loop does not iterate at all.

radhika:
I don't quite understand your VI. Why are data1 and data3 arrays? You should populate them with reasonable inputs, then make the current values default before attaching so we can play with real data. Also your FOR loop (even if it would do 10 iteration) would be over in a few nanoseconds and you would not be able to see what's happening. Can yo explain in a few more words what it should do?

0 Kudos
Message 7 of 20
(20,941 Views)

Christian:            

             Good one Christian, i really dont know this n just came to know, thanks very much.

Radhika:

              As Christian also told you, you should put atleast some delay in your VI, to see whats happening? otherwise you '' always see the last iteration result generated by the For Loop, and tell what are your exact requirements?

Thanks,

Nishant

0 Kudos
Message 8 of 20
(20,934 Views)

Hi all,

Thanks for all your suggestions.

i have attached my algorithm .I hope that explains my requirement.

i have edited the program also.added some time delay and given some data values.Now the program runs .

currently i am trying my algorithm by using nested cases example.hope it works.

thanks

radhika venkataraman.

0 Kudos
Message 9 of 20
(20,887 Views)

Hi altenbach,

I didnt quite understand what you have said , populate the data and give current values default before attaching so that i can get real values.

can u explain me that in detail.

0 Kudos
Message 10 of 20
(20,853 Views)