LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

is it possible to use if else if condition in labview

Hey All,

I kind of getting interested in this. Why do you need arrays for data values?????

 

If you are comparing only one process value at a time..

 

Correct me if I am missing some part of the problem.

 

Regards

CLAD
Using Labview 5.1,6.1,7.1.8.0
0 Kudos
Message 11 of 20
(3,407 Views)
hi,
 
you are right i am going to check one process value only at a time.
I just wanted some values to be given to the program.(as real data).
 
Look at the attached image.when the 3rd case structure executes , power value is decreased and the loop keeps on continuing decreasing the power.and every time the process temperature value will be the same.Instead when power value is decreased , the temperature also drops down in the real  process and i wanted the temperature to decrease in the program also every time when the power is decreased .
 
thanks,
radhika
0 Kudos
Message 12 of 20
(3,400 Views)
So is your problem fibnally solved or  u r still having it........
CLAD
Using Labview 5.1,6.1,7.1.8.0
0 Kudos
Message 13 of 20
(3,391 Views)

hi

i am still in the process of fixing my code......

any help is highly appreciated...

thanks in advance

radhika

0 Kudos
Message 14 of 20
(3,389 Views)
hi Radhika...

As per the algorithm (provided by u)  solution provided by 'tbd'  shd run exactly the way you want it to do. To stop the loop you need to put a control near the conditional terminal...In every iteration the case structures check for each process value in the order you specified. ..If it is out of range appropriate action is taken...

I have attached the VI with a stop button...Can you attach the new code and problem u having with it...


CLAD
Using Labview 5.1,6.1,7.1.8.0
0 Kudos
Message 15 of 20
(3,380 Views)
Hi Radhika, LabVIEWmission,
      One of Radhika's recent posts implied that a "real" process is being simulated(?) - if so, maybe this VI will be useful.  It generates an output value (Temperature) based on input Power.  Two inputs scale Temperature response to a "real" range; another input provides a response-delay (because real systems don't respond instantly.)  There's a fixed %5 randomization - if that's too much, it can be edited/changed!


Cheers.
"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 16 of 20
(3,346 Views)

Hi all,

Thanks a lot for all your replies.My simulation worked successfully by following the steps you all have referred.

Thanks & regards

radhika.

 

 

0 Kudos
Message 17 of 20
(3,317 Views)

Hi buddies,

i would like to use 'if' condition in labview, like if i=1, 1st operation.... i=2, 2nd... i=3, 3rd operation... then when i=4, it should again go to loop 1.. i mean i=1..

 

How is it possible... help me out guys.. 

Thanks in advance 🙂

 

-Ranjita 

0 Kudos
Message 18 of 20
(2,491 Views)

The Case Structure is the LabVIEW equivalent of the if - else construct in text based languages.  Read in the manual how to set the cases to react correctly to your input variable. 

 

If you're not familiar with it you need to go through the LabVIEW Tutorials.  All types of program flow control are covered and there are some good examples: http://zone.ni.com/devzone/cda/tut/p/id/12302

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
0 Kudos
Message 19 of 20
(2,486 Views)

You could use the poor mans's sequence structure, e.g. as follows. Not very flexible, though.

 

0 Kudos
Message 20 of 20
(2,471 Views)