取消
显示结果 
搜索替代 
您的意思是: 

Losing data when saving it to a File?

已解决!
转到解答

Hello,

 

I'm having problems with saving my data. I acquire it at 2.5MHz for 5 seconds and when I visualize it I can only see 1,2s of data, if using only one channel, or less than that, like 0,4s of data, when getting 8 channels.

My vi is attached and also a picture of it. To analyze it I'm using "TDMS File Viewer" (TDMS - File Viewer.vi):

Attached is also a picture of the File Viewer. Check the number of samples (225000) and the time in which it was taken (11/19/2008 16:14:30.423) and (11/19/2008 16:14:31.362). With a 2.5MHz, there should be lot more samples than what is there...  The last sample (not showed on the picture) is from time (11/19/2008 16:14:30.513), only 0,1s after starting to acquire data.

 

Is the problem with the queue? If not, why is data not being recorded?

 

Thanks for the help,

Rafael

 

0 项奖励
1 条消息(共 6 条)
3,440 次查看
解答
接受人 Danigno
Your consumer (lower)) thread will be scuttled as soon the producer (upper) thread exits. Exiting the top loop kills the queue; dequeue element will return an error, and write to file won't do anything if there is an error on input. So any elements remaining in the queue when it was killed are lost. The easiest way to fix this is to add another loop to the upper thread; after your existing while loop quits, loop with a short (10 msec) delay until the queue is empty (per Get Queue Status). Kill the queue only after all of your results have been written to disk.
2 条消息(共 6 条)
3,421 次查看

Thanks for the sugestion Rob, I'll try that now...,

Rafael

0 项奖励
3 条消息(共 6 条)
3,387 次查看

It worked man! Thanks a lot!! 🙂

0 项奖励
4 条消息(共 6 条)
3,384 次查看

hey Rob

 

from what i can see from the forums, you're really good at labview. I need a hand with my program. I have a program that records audio from microphone and then creates a wav file and saves it in it except that my file size increases and the program doesn't stop and when I stop it manually and try to play the file saved..it doesn't have anything in it. just a wav file that likes 20mb. I don't know why.

 

Thanks a lot

0 项奖励
5 条消息(共 6 条)
3,271 次查看

Hi Oli,

 

first: you should create new threads instead of hijacking older (more or less) unrelated threads.

2nd: you should provide information oin what you have achieved so far, i.e. attach your vi or atleast a pic of it!

 

After doing so we will have a chance to provide more detailed help...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
6 条消息(共 6 条)
3,254 次查看