LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to press "Enter" to log data

Attached is my .vi that I am trying to use to collect peak values for the instrument I am using. As you can see, I have set it up to log the values in a spreadsheet, but it is set to log values at a specified time interval. I would like to have it set up so that I can get the current max value and ONLY log that value (preferrably by pressing the "Enter" key, which is also being used to reset the max value). How can I do this? Also, would there be any problematic lag time between logging the max value and resetting the max value if I am using the same command key (i.e. having the value log AFTER reset and, therefore, not the max value I am looking for)? Any useful information here would be greatly appreciated.

0 Kudos
Message 1 of 3
(2,441 Views)
So what you're saying is that you want the code to start to accumulate data. Then when the enter key is pressed you want to take the max of all the accumulated data, save the max value to a spreadsheet and empty out the data to start accumulating a new dataset. Correct?

First thing is you don't want to actually accumulate any data since all you are wanting is the maximum value. Each time you acquire a data point, compare it to the last value you read if it is greater than the old vale, save it and use it as the comparison value for the next acquisition. If it's not greater, continue using the old value for comparison.

Are you familiar with using control events? How fast are you going to be acquiring data?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 2 of 3
(2,396 Views)

Hi Mike,

 

Thanks for the response. Yes, I do not want to accumulate any data except the max value and then empty the dataset and start again. I am using LabView solely for data acquisition from a load sensor that we have purchased to determine fruit firmness (in Lbs.) and I have no experience with LabView outside of developing my current application from an existing template. So I am unfamiliar with pretty much everything, including control events. Our goal is to speed up the process of taking firmness readings by cutting out the step of manually entering the data into a spreadsheet. Without the step of entering the data, we would be able to take a firmness reading every 1-2 seconds for as long as is necessary.

0 Kudos
Message 3 of 3
(2,355 Views)