From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

London LabVIEW User Group

cancel
Showing results for 
Search instead for 
Did you mean: 

Random number generation between 1 to 10000 and match with the input

Hi,

  This is Kalyan. I am new to Labview. I am doing my Msc in Electronics and Communications. I could not able to generate random numbers between 1 to 10000 and match the random number with the input which i provide and glow a led  light upon true. Please, guide me.

Kalyan

0 Kudos
Message 1 of 3
(6,264 Views)

Hi Kalyan

There a are a number of questions to this that will need answering.

The input you are providing. Is it an integer? (lets assume yes for now because matching a real or floating point exactly will take quite a few integrations.

Next, how do you want the function to perform? is it called once or do you input a number and let it loop until it finds a match in the random number generator?

The example below works not to bad as a start.

The dice generate a random number between 0 and 1, you multiply that by 10000, the first case statement forces the output to be at least "1" and the next function rounds to nearest integer value.

(note: there are two case blocks to illistrat both casses. )

Hope this helps

Chuck

Capture.PNG

0 Kudos
Message 2 of 3
(5,695 Views)

Hi,

Thank you for the help.

Regards,

Kalyan

0 Kudos
Message 3 of 3
(5,695 Views)