04-19-2020 12:30 PM
Guys I need help from here (im stuck) and also using just this 3 function on the front panel without using any else.
04-19-2020 01:10 PM
Hi John,
have you done any basic tutorials?
What's the point of that OR function in your VI? Why did you wire a DBL indicator to a boolean OR input?
Why don't you use the +1 function? Why was the #iterations a DBL indicator?
04-19-2020 01:44 PM - edited 04-19-2020 01:48 PM
You are dealing with integers. It is extremely dangerous to have a loop stop on a comparison with DBLs. Except for the random number generator, most of the diagram must be blue!
It is also a poor choice to have the "number to match" default to zero, because zero can never happen in your code and the loop will never stop! Make sure to configure the data entry and default value of all controls before saving.
04-19-2020 01:57 PM
Here's one relatively safe possibility: (Make sure that the number to match is actually possible.)
04-20-2020 02:55 AM
If you need numbers in the range from 0 to n you have n+1 possible values 😉
From Help:
Produces a double-precision, floating-point number between 0 and 1. The number generated is greater than or equal to 0, but less than 1. The distribution is uniform.
So check how you coerce ...
04-20-2020 06:46 AM - edited 04-20-2020 06:47 AM
There is a Random Number (Range) VI in the numeric palette. Use that to make your life a little simpler.
04-20-2020 08:33 AM - edited 04-20-2020 08:35 AM
Although not mentioned, perhaps you want to pick each number only once?
0 is included (so technically, it's between -1 and 1000), but I hope you get the picture.
Here's a variation:
04-20-2020 09:27 AM
wiebe@CARYA wrote:
Although not mentioned, perhaps you want to pick each number only once?
0 is included (so technically, it's between -1 and 1000), but I hope you get the picture.
Here's a variation:
That loop 'only' create numbers from 0 to 999 😄
04-20-2020 09:44 AM
@Henrik_Volkers wrote:
wiebe@CARYA wrote:
Although not mentioned, perhaps you want to pick each number only once?
0 is included (so technically, it's between -1 and 1000), but I hope you get the picture.
Here's a variation:
That loop 'only' create numbers from 0 to 999 😄
AFAIC, The 999 is correct, I mentioned the 0.
"Between 0 and 1000" (mentioned in the title) is from 1 to and including 999, not including 1000, right?
Anyway, I'm sure that can be fixed to meet the demands.
04-20-2020 09:47 AM
So, how often do you have to generate a random number to match your selection?
guess how the histogram looks like...