LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

excel and a stop and go program

Hello. I'm still very new to labview and I have a problem. I programmed a program calculate the time taken to match the user input number to the random number generator and once the program gets a hit (random number generated = input number) the program stops. The problem is, everytime I restart it, I get a new excel table (the results are written into the table). I want to be able to restart the program without generating a new excel table and get a continous reading. I have attacted the program as well.Any ideas? 
0 Kudos
Message 1 of 7
(3,023 Views)
I have another problem as well. The elapsed time doesnt seem to stop even after the loop stopped. I cant seem to reset the timer at all. Hope i get some help soon. Thank you in advance
0 Kudos
Message 2 of 7
(3,003 Views)
Leaving aside the issue with the incorrect implementation, your premise seems flawed, or at least incomplete. You say you want to calculate the time taken to match the user input number to a random number. You also say that when you get a match, the program should stop. This implies that you are giving a user a maximum amount of time with which to respond. OK. What exactly are you measuring then? A human's reaction time? A specific human's reaction time? Which reaction time? The reaction to see a change in an indicator, or the amount of time it takes a human to send a signal to the hand to move the mouse and perhaps move it so that it rests over the up/down arrows of a numeric control so they change the number, or the amount of time it takes a human to move a mouse to select the highlighted number and then move to the keyboard to enter a new number, or the amount of time it takes a human to double-click the control and highlight the whole number so they can then move to the keyboard and then enter the new number?

You should start by first clearly defining the objective. Once that's done you can move into programming it.
0 Kudos
Message 3 of 7
(2,997 Views)
sorry for the confusion and my poor language. overall, the random number generator generates a number every second.the program calculates the time since the input is given to the time the input = a random number tht is generated by the random number generator. thats the overall concept. hope it makes things clearer 
0 Kudos
Message 4 of 7
(2,994 Views)
Unfortunately, no. At least not to me. If you're generating a random number once a second, then by definition you are placing a maximum reaction time. I tried out your little sample after disabling the Excel stuff and I found that I just couldn't respond fast enough because of what I said before. It takes time for a person to notice a change and then actually perform the actions to enter the new input. It seems to me that all you'd ever be measuring is 1 second, which is the frequency of your random number generation.

I could be wrong though. Perhaps if I were high on amphetamines I might be able to do it. Smiley Wink
0 Kudos
Message 5 of 7
(2,975 Views)
your description of the program is not what the program is actually doing.
 
example
  • user input : 37
  • random number continously generate a number between 1 to 100 every second
  • random number generate a 37 as well
  • output: time taken since the user input to the time the random number generator generated a 37
hope that clarifies things n sorry for the massive confusion.
 
0 Kudos
Message 6 of 7
(2,951 Views)
OK. I understand now. So now I have a follow-up question: what are you testing? The random number generator? How long it takes a random number generator to match a user-specified value? Isn't that, by definition, random? Are you trying to verify the "randomness" of the random number generator?

For your reset problem all you need to do is wire in to the Reset input, but not the way you're doing it. You just need to check the iteration count and reset if i=0.

Unfortunately, I don't have the Office Toolkit, so I can't help with the Excel file issue.
0 Kudos
Message 7 of 7
(2,945 Views)