02-05-2006 07:40 AM - edited 02-05-2006 07:40 AM
Message Edited by John_B. on 02-05-2006 07:41 AM
02-05-2006 11:28 AM
Are you trying to generate a random number between 70 and 100? If so, take the Random Number (0-1) function in the Numeric palette, multiply it by 30, and add that result to 70. That should give you a random number between 70 and 100.
Good luck,
-D
02-05-2006 01:12 PM
02-05-2006 02:01 PM
If you're generating the numbers in a loop, use the "Wait" function in the loop. Search the palettes for "Wait" if you can't find it.
Good luck,
-D
02-06-2006 12:26 PM
02-06-2006 12:38 PM
Hi John,
You have a few options here. One option is to use the Simulate Signal Express VI (Express > Input palette) to generate a Sine wave with an amplitude of 15 and an offset of 85. You would have to convert this wave into an array and index a loop with its values. Another option is to use the Sine function (search the palettes, as its location varies depending on your LabVIEW version) and do some math on the iteration value of your loop to have it return values in the proper range. Still another option is to use the Waveform VIs...specifically, the Sine Waveform.vi (in the Waveform > Analog Waveform > Waveform Generation palette).
See which of these works the best for you. You'll probably get the best performance by using the Sine function and doing the math yourself, but the other options would probably be easier to program.
Hope this helps,
-D
02-06-2006 12:39 PM
02-06-2006 03:07 PM
02-06-2006 03:51 PM
Hi John,
The waveform output of Sine Waveform.vi will have a t0 value, a dt value, and a Y array that contains all the points in your sine wave. You can use the Get Waveform Components function (in the Waveform palette) to get the Y array, then you can index those elements in a loop and check them one at a time against a scalar value...alternatively, you can wire the Y array into the top input of the Greater Than function, and wire the comparison number into the bottom input, and the Greater Than function will output an array of booleans indicating which values were greater than the comparison number.
Hope this helps,
-D
02-07-2006 06:21 AM