From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

popup cntl-alt- del

I don't see your problem.

I run it (LabVIEW 8.6.1) and it does exactly what I would expect.

Namely, it shows either a "correct" message, or an "incorrect" message. 

You click OK, and the program stops.

 

(I would use the boolean to select either message and feed that to a single dialog box, but that's not the cause of your problem).

 

 

Is it possible you're clicking the RUN CONTINUOUSLY icon, instead of the RUN icon? 

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 11 of 16
(524 Views)

I hope that you realize you aren't getting a true random distribution of numbers from 1 to 10.Smiley Surprised

 

The random numbe generator puts out a number between 0 and 1.  Zero is included, one is not.  (Now it looks like you changed the default label of that function to be 0-0.5, but that doesn't change the function.)

You multiply by 10 and round to nearest.  Then you coerce to be between 1 and 5.  So about half the time, the value would be between 5 and 10 and get coerced to 5.  The other half of the time, 1 2 3 or 4 would be the result.

 

Using round to nearest would also give an uneven distribution because the result of random being from 0.05 times 10 would round down to zero.  0.95 times 10 would round up to 10.  All other numbers would get from x-.5 to x+.5.  So the chances of the intermediate numbers would be twice the chance of zero or ten.  If you want a number from 1 to 10, multiply the random by 10 and round up.  0 to 9, multiply by 10 and round down.

0 Kudos
Message 12 of 16
(514 Views)

Thanks,

 

Thats right , I am using run continuously.

 

How can I get out of the loop in that case.?

Do I need to use a different dialog box?

Do I wire it differently?

 

I will in the meantime check the logic & calculations.

 

Cheers

0 Kudos
Message 13 of 16
(488 Views)

Thats right , I am using run continuously.

 

Then everything is working exactly as it should.

 

The system is providing a loop for you, when you run continuously. The only way out is the STOP button (or C-A-D, as you've found).

 

You should provide your own WHILE loop in your program, and have a STOP button which stops it. 

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 14 of 16
(486 Views)

CoastalMaineBird wrote:

 

You should provide your own WHILE loop in your program, and have a STOP button which stops it. 


What is odd is that the Stop button was already there, but the original poster just wasn't doing anything with it.  This is where I add this link:

 

"I would recommend you learn more about LabVIEW from here. How to Learn LV"

Message Edited by Ravens Fan on 05-11-2009 03:12 PM
0 Kudos
Message 15 of 16
(465 Views)
Even with a while loop, the VI is fundamentaly flawed. There is popup for both the true and false cases and one or the other will be constantly shown. won't have a chance to hit the stop button. I would recomend having an event structure and only doing a test when the guess value changes.
0 Kudos
Message 16 of 16
(459 Views)