I hope someone can answer me fast as I need to meet a deadline
I made the sample Sound Level Meter DAQmx for Sound and Vibration 2013.
My concern with this is that I need to save the Leq per second after we collect all data.
What I did is attached but I do not know where to attached the write measurement file express.
Please help me...
Some options: (1) you could stream the data to disk (very fast) using the TDMS blocks (.tdms format), or (2) you could prelocate an array for storing the data and after the loop is done save the array to a .txt, .bin or other format. So, do you need fast storing odf your data as it comes (considered (1)), or is the data of low dimension (maybe just one number every cycle) then (2) would do fine.
Poke the Data acquired into a Queue. (making this the producer loop)
De-Q the Data in another loop (consumer loop)
Update the file in the consumer loop - this means that File IO overhead will not affect your sampling rate.
Open the File reference before the Consumer Loop starts and close it when complete to minimise File Opening and closing as data is saved (or save the file every n samples/seconds if you are paranoid)
This will get you a faster more flexible architecture - File IO has a much larger overhead than DAQ normally so moving this to a seperate Q and thread allows parallel processing.