[IDLE] Calgary LabVIEW User Group Community

cancel
Showing results for 
Search instead for 
Did you mean: 

conditional structure

I realize my end of study I'm beginner in labview my defense June 8 please help me.

I have a the following programe.

  25 compared with a random number (in the example nome x)

   if 25 <x then

     dialoge box display "supperior x 25"

if 25 <x <30 alores

    box display dialog "is a good choice"

if x> 53 then

display dialog "x will be recorded"

how I develop this program with labview

  cvp help me it's urgent

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

this is exactly what I needed thank you for your ashbeigi Shamloo also help.

my problem I acquired I want to compare the temperature of VAL with other integer and I want to save the result into a text file but its not working

  watch

0 Kudos
Message 1 of 4
(11,856 Views)

Hi Pierre,

A case structure with a little bit of logic before it (using things from the comparison pallette for instance) will give you what you want:

See the video below for how to use them:

http://www.youtube.com/watch?v=cgS3u0nupfs

More info

http://www.ni.com/gettingstarted/labviewbasics/exestructures.htm#Case Structures

For multiple ranges you can nest case structures. Here is an example:

https://decibel.ni.com/content/docs/DOC-3507

Ash Beigi
Academic Technical Sales Representative
National Instruments - Electronics Workbench Group
Message 2 of 4
(7,649 Views)

Here is the LabVIEW code without random generator (it makes it easy to test the code):

ni forum - conditional statement.png

and the following is the code with random generator:

ni forum - conditional statement - random generator added.png

Pleaes try to explain you problem clearly. The question was vague and hard to understand. Is your psudo code correct? (check it again.) I wrote this code according to your psudo code. Consequently, the program shows two dialog boxes if the number is 26 as it satisfies the first two conditions.

Message 3 of 4
(7,649 Views)

I checked your VI. The problem is that you have put the "Open/Creat/Replace File" VI and "Close File" VI inside the loop. They should be out of the loop if you want to record all of the data produced through the loop iterations.

You don't need to use "Set File Position" VI.

You may use the following code which records some numbers on hard disk in a text format. You should replaced the random generated number VI with your temprature measurments:

writing to a text file.png

If you find this post useful, please click on the "like" button at the bottom of the post.

Message 4 of 4
(7,650 Views)