10-30-2008 01:40 PM
I have 2 questions.
1. I have a random number and a control. The value of my indicator should be equal to the value of my control, however, when the user pushes a boolean button, a random number should be generated, the random number generator should always have preference over the control.
2. If I want to choose random number [2 4 6 7] of these 4 numbers only, what will be the best approach, since the random number generator outputs values in the range 0 to 1.but I want random numbers of only these four numbers,i.e 2 or 4 or 6 or 7
Thank you.
Solved! Go to Solution.
10-30-2008 01:50 PM
See how far you get. 🙂
10-30-2008 02:18 PM - edited 10-30-2008 02:20 PM
Here's a quick example (LabVIEW 8.5)
(The control is in the other case, but you could easily als place it to the left of the case structure. Would make the code easier to read :))
10-30-2008 03:22 PM
Thank you Altenbach.
I run your VI , and it worked fine, but one issue is that when I changed to random, I want the random number to only generate once, until I pressed it again. I had already completed my vi before I saw your second post.
I have posted the vi, the way I envisioned it to be , but like what you posted, when I click on the rand button, it keeps on inputing values, instead of just one value, until pressed again.
10-30-2008 03:41 PM
ade77 wrote:I have posted the vi, the way I envisioned it to be , but like what you posted, when I click on the rand button, it keeps on inputing values, instead of just one value, until pressed again.
Then use an event structure, for example. 🙂
10-30-2008 04:17 PM