Showing results for 
Search instead for 
Did you mean: 

Generate Random numbers

Go to solution

Hello All,


I have searched the forum and have realised, there are lot of random number generation ideas, however i have a different question, best explained by the attachment.


I want to have unique outputs.

your inputs are appreciated.

Download All
0 Kudos
Message 1 of 13

You need to compare the previous output with the new one; and skip it when the output is the same.

0 Kudos
Message 2 of 13

Instead of focussing on changing the output.. i would like to change the random input in such a way that it always picks a unique line.

My output in my program will be hundreds of line, and so i would not like to mess around.


Please let me know, if you need any more inputs


0 Kudos
Message 3 of 13

Yep better ways to do this


If I understand correctly (from your code) you want to shuffle the lines randomly See below



For improved randomness you ca generate a random seed to input to

"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 13
Accepted by topic author Rambo333

I haven't seen your code because i'm using LV2009 but I think the attached vi will do want you want.



0 Kudos
Message 5 of 13

I wanted to do something with the shift registers and converting my string to an array.... but my program was not very convenient to do so...

Thanks !!!

It works like a charm...


@ Jeff..


I will implement your style and see the results.


Thank you

0 Kudos
Message 6 of 13

I agree with Jeff that riffle is a cleaner solution:



Download All
0 Kudos
Message 7 of 13
Message 8 of 13

If you only have LabVIEW base (no riffle!), you could do as follows (taking advantage that clusters are sorted in element order):



Download All
0 Kudos
Message 9 of 13

I'm thinking Randomize 1D Array will sufficeSmiley Very Happy  Thanks for point it out- (guess what just hit my reuse library?)

"Should be" isn't "Is" -Jay
0 Kudos
Message 10 of 13