LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

string random generation for length 3

Dear Sir,

 

How can i generate random generation of alphabets of length 3 in labview?

 

ex:adg,beg etc

 

Thanks in Advance

 

Regards,

Sai Chitra.

Message 1 of 4
(8,656 Views)

Hi chitrar,

 

Here is a way for caps only:

 

1) Use decimal to ASCII numbers for your letters 

2) Generate a random number from 0-25

3) Add the result to the first letter (A) position which is 65

4) Repeat 3 times

5) Convert to U8 and then use Byte Array to String to get your string

 

random alphas.png

 

Note if you want lower case also, change the 25 to 51 and then add 7 if the random number result is greater than 25.

 

 

steve

----------------------------------------------------------------------------------------------------------------
Founding (and only) member of AUITA - the Anti UI Thread Association.
----------------------------------------------------------------------------------------------------------------
Message 2 of 4
(8,648 Views)
Homework?
0 Kudos
Message 3 of 4
(8,625 Views)
Picture the ASCII table as lookup table.


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 4 of 4
(8,619 Views)