LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I would like to keep a true-false program running

Solved!
Go to solution

Hi!

I'm new to labview, and I started practicing. I'd like to create a little program which generates a random number from 0-100, and the user can enter a number by her/his choice, then the program tells if it's equal or not. I'm almost done with it, my problem is that I run the program, it generates a number, tells if the number in the Numeric Control equals to the random number, and it stops. So if I change the number in the control, nothing happens, but if choose to run the program continuously it generates numbers every moment.
So my questions is, how do I keep the program running, while not changing the random number, so the user has the time to enter her/his own number?
Thanks in advance!

I attached my program.

0 Kudos
Message 1 of 4
(2,873 Views)
Solution
Accepted by topic author Veckler

You need to enclose the code in a while loop. Add a stop button so the user can tell the program when to stop.  Also put a Wait (ms) function in the loop with about 100 to 200 ms delay so the loop is not spinning millions of times per second while waiting for the user to enter a number.

 

When you get more advanced with LabVIEW you will want to learn to use the event structure for programs like this.

 

Lynn

0 Kudos
Message 2 of 4
(2,870 Views)

Go to the LabVIEW Forum, and look at the upper left of the Main Page.  Do you see this?

GSW LabVIEW.png

Click on "Learn LabVIEW Basics", and watch the first few videos -- it should teach you a lot and allow you to answer your own question (the best way to learn is by "doing it yourself").

 

Bob Schor

0 Kudos
Message 3 of 4
(2,862 Views)

Thank you both!

0 Kudos
Message 4 of 4
(2,817 Views)