MeganWhite Posted October 7, 2004 Report Share Posted October 7, 2004 Hey guys I am trying to create a VI which reads 5 channels at a sample rate of 65536 hz using DAQ Assistant and when I try to write it to a file using Write LVM I get an error message "Possible reason(s): Attempted to read samples that are no longer available. The requested sample was previously available, but has since been overwritten. Increasing the buffer size, reading the data more frequently, or specifying a fixed number of samples to read instead of reading all available samples might correct the problem. Property: RelativeTo Corresponding Value: Current Read Position Property: Offset Corresponding Value: 0." I need continuous data acquisition so cannot read fixed samples. Also it works fine if the sample rate is 16384Hz. Any sujjestions how to overcome this ? Megan Quote Link to comment
JackHamilton Posted October 10, 2004 Report Share Posted October 10, 2004 Megan, Likely the problem is the file write is taking too long and delaying the analog read. You need to decouple the acquisition & file save into 2 seperate loops. I've done this and it will work great. Use a Queue to send the acquistion data to the save loop. This will allow the acquisition loop to output data to the queue - without getting backed up by the save time. This is known as a "Producer/Consumer loop" it looks likes this: Shown below:Let me know if you need to more help. Quote Link to comment
MeganWhite Posted October 11, 2004 Author Report Share Posted October 11, 2004 Thanks a lot Jack, this method does work. Also is there a way I can limit the file size to multiple 10mb binary files? Megan Quote Link to comment
didierj Posted October 12, 2004 Report Share Posted October 12, 2004 I don't know if in LV7.1 it's possible, otherwise, count the samples acquired and if needed create a new file: (10Megs) / (5channels x 4bytes per value) = 524288samples / 655536samples per second = 8 seconds Means: after 524288 (=2^9) samples or 8 seconds you'll have to create a new file. Best add an index to the file or it's extension (in windoze) and wire it to the Write LVM file.vi Didier Quote Link to comment
MeganWhite Posted October 13, 2004 Author Report Share Posted October 13, 2004 Didier thanks a lot for the sujjestion, I cannot wire it to write lvm file as it does not write at that high sample rate, so I am trying to write a file while appending continuous data to it using the write file vi. Yes I am writing a new file every 8 seconds. Is there a way I can name the file with a timestamp similar to the options in write LVM DAQ assistant? Quote Link to comment
didierj Posted October 14, 2004 Report Share Posted October 14, 2004 Is there a way I can name the file with a timestamp similar to the options in write LVM DAQ assistant? 2296[/snapback] In the "Time & Dialog" palette you will find a function that is named "Format Date/Time String". Use it to format the date/time the way it fits for your filename: Didier Quote Link to comment
MeganWhite Posted October 14, 2004 Author Report Share Posted October 14, 2004 I am using the Format time function but since I am using a continuous acquisition vi the file name keeps getting added with the new time stamp. For example if the initial filename is 20041013140422.dat the next file name comes out to be2004101314042220041013140430.dat and it keeps adding the timestampl. I tried using the functions replace string but it does not work as the very first file does not have a time stamp. I wish I could find a way to update the filename rather than adding new name. Megan Quote Link to comment
Michael Aivaliotis Posted October 14, 2004 Report Share Posted October 14, 2004 read this topic: http://forums.lavausergroup.org/index.php?showtopic=625 Quote Link to comment
MeganWhite Posted October 14, 2004 Author Report Share Posted October 14, 2004 I am getting a little confused here. I am attaching the sub vi I made for the new file format.I am trying to delete the old name and add new timestamp but somehow the old name does not get deleted completely and I see a "2" appended to the stamp everytime a new file is written. Please look into the block diagram and tell me what am doing wrong. PS I am not an expert so please sujjest some simple solutions. Megan Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.