LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I can't save 5 values of time in array

Hello,
I have a problem with save 5 values of meassured time in array. The concept of the project is to measure the response time to sound. After pressing play the sound starts with a random delay. The reaction time is measured by pressing the pauses. I want to write 5 values in the array and calculate the average response time. However, after pressing the Play button again, the value is reset. I am guessing that this is due to the poor spoiling of individual functions in structures. Will anyone help me understand what my mistake is?

LabView 2018 32bit

 

0 Kudos
Message 1 of 3
(1,929 Views)

1. What is up with that Feedback Node outside of your loop?  I don't see it doing anything useful.  And why are you appending that value to your array every iteration?

2. You need to wire your array data through all of your event cases.  In your current situation, this is clearing the array each time you press a button.  Linked Tunnels will make this a little easier (Right-click on an output tunnel, choose Linked Input Tunnel->Create And Wire Unwired Cases, and then choose the input tunnel to link to).

3. Your use of local variables concerns me.  Nearly all of those values should be stored in shift registers.

4. Work on cleaning up your diagram.  Avoid wire bends.  Line up related tunnels on your structures.

5.  You have so many waits in there that are not needed.  You have the timeout of your event structure to limit your loop rate.  No reason to add more delays.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 3
(1,905 Views)

Also, instead of a typedef'd ENUM that only has two states ("TRUE", "FALSE"), you might as well use a boolean. 😮

0 Kudos
Message 3 of 3
(1,893 Views)