LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Generating a Random Number and writing it to Excel

I have to write a VI, that generates a Random number and copies it to an Excel Sheel everytime a Button is pressed.

In the end i should have two columns in the Excel Sheet, one with the Random number and the other with the time at which it was generated..

Can someone help me please

0 Kudos
Message 1 of 4
(2,837 Views)

I have attached the program that i have managed to complete till now...

 

The changes i have to be made now

 

1) The Program runs in a Loop, instead of a Loop a  button has to be placed and everytime the button is to be pressed only one random number should be generated and copied into the excel sheet.

 

and

 

2) In the current case where the program is running in a loop, i should be able to specify the time interval between two random number generation...

 

 

Thanks in advance

 

 

0 Kudos
Message 2 of 4
(2,831 Views)

This sounds like a learning exercise, so I will not provide you with some code.  I will give you some ideas and see what you can do.  If you have not looked at the online tutorials, they might be helpful.

 

For the button press: The program must still be in a loop.  The program needs to continue running, you just want it to do nothing while waiting for the button.  Hints: 1)a) Study the use of the event structure.  1)b) Poll the button with a case structure. 1)c) Shift registers are your friend.

 

For the Timed mode: How will the user provide the timing information?  As a control? If the interval is specified in seconds, how will you change that into into the units required by the delay functions?  Hint: In addition to the simple Wait (ms) function you are now using, there are some more advanced timing functions available (although you can do it quite easily with the Wait (ms)).

 

For extra credit add a switch to select the timed or button press modes and do both in one program.

 

Lynn

0 Kudos
Message 3 of 4
(2,816 Views)

You previously asked this question here and received quite a lot of help. What happened?

0 Kudos
Message 4 of 4
(2,805 Views)