LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Pseudorandom number generation based upon an integer seed,to produce the same table given the same seed.

Does LabVIEW have a VI that produces Pseudorandom
Numbers based upon supplying a integer Seed Value? This way
you could generate a table of numbers that looked random, but
could be reproduced for test comparisons whenever you
supplied the same seed value. Do such algorhythms
already exist in the liabrary somewhere?

Larry
0 Kudos
Message 1 of 4
(3,598 Views)
Larry,

All noise generation VIs (Analyze..Signal processing..signal generation) have an optional terminal labeled "seed". Wire a constant to it and you have what you need.

Look e.g. for "Uniform White noise.vi" or "Gaussian White Noise.vi", etc.

(All LabVIEW versions excpet "base" should have these).
Message 2 of 4
(3,598 Views)
It may be that even these subVIs might not do quite the trick depending on what you want. If you want to get exactly the same random number (or array) from the Gaussian White Noise.vi for example, you may need to edit the VI and create a personalized copy.

In the existing VI, the seed value that you input as a parameter is actually 'randomized' on the first run of the program (open the VI and look at the case statement inside the loop). If you want the same seed to always kick off the same set of random numbers (for re-testing at a later time) you'll definitely want to take that code out. It is as easy as moving the two cluster constants outside the while loop (as initial values of the shift registers) and deleting the rest of the case (and re-attaching the
broken wires), so it's not too bad at all.

Cheers,

EMR
Cheers,
Elaine R.
www.bloomy.com
0 Kudos
Message 3 of 4
(3,598 Views)
Actually, if you hardwire a seed value that is >0, it will not initialize and will always return the exact same sequence.

Automatic re-seeding only happens if seed is zero, negative, or "unwired".
0 Kudos
Message 4 of 4
(3,598 Views)