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.
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.
05-10-2009 08:04 PM
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?
Blog for (mostly LabVIEW) programmers: Tips And Tricks
05-10-2009 09:42 PM
I hope that you realize you aren't getting a true random distribution of numbers from 1 to 10.
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.
05-11-2009 07:47 AM
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
05-11-2009 07:59 AM
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.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
05-11-2009 02:12 PM - edited 05-11-2009 02:12 PM
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"
05-11-2009 02:28 PM