Showing results for 
Search instead for 
Did you mean: 

Detect and record a key stroke during data acquisition

To all:


I found several posts and one knowledge base help for this question, however I am not savvy with *.dll file manipulation and the explanation language is daunting me.  Hence, I was hoping to get a layman explanation of how to detect a particular key stroke (the "t" key) and then write the event, along with voltage data acquisition, to a file.  Data acquisition is occurring at 400 KHz.


The application is acquiring acoustic emission signals from a test part.  I want to press the "t" key when something interesting happens during testing so I can reference that noticed event to the acoustic data.  Hence, the key press needs to be embedded with the voltage data, or, it has to have the same time stamp as the voltage data when it occurred.


I think using an event structure case would be possible, I just need some advice to get started on how to implement.


using lab view 8.6


thank you



A. Lopez
0 Kudos
Message 1 of 5

You could try something similar to the "Producer/Consumer Design Pattern" (In LabVIEW, Click File... New...)


The bottom loop would be your DAQ loop.  You could have a very short timeout on the Queue so that when there is no data you do the normal DAQ.  When the user presses a button the queue passes that info and stores it with you DAQ data.  Since it is a queue, you don't have to process the data immediately if you embed some sort of timestamp.


If you want, post your code and we can give some more specific suggestions.





"There is a God shaped vacuum in the heart of every man which cannot be filled by any created thing, but only by God, the Creator, made known through Jesus." - Blaise Pascal
0 Kudos
Message 2 of 5

thank you for response VT92


attached is the plain vanilla VI.  It is modeled from the peak detection VI that was on another discussion board post (started 11-20-2008 by fliablera...)


I will investigate consumer producer loops for acquisition.  I am quite sure the method I am implementing now is not very effective for sampling at such a high rate or handling 4E6 data points.





A. Lopez
0 Kudos
Message 3 of 5

fogot to attache the vi. sorry...


A. Lopez
0 Kudos
Message 4 of 5

I found out the original VI I posted for peak detection analysis did not work well for large files ( 4M data points).  So I switched to a TDMS write and read style.  It improved the performance. I am using the VI from the write TDMS Lab View Example.


I started to build a producer consumer set up to capture a key stroke, letter "t",  but I can't quite get my head around how to use data queues. I will need to continue studying to implement this.


However, I have posted the most recent VI I have for this application, which is detection of acoustic emission signals in the 50 to 150 KHz range, then finding the peaks and RMS signal. Data acquisition taking place at 400 KHz.


thanks for any advice on recognizing key strokes during data acquisition without slowing it down.



A. Lopez
0 Kudos
Message 5 of 5