Jump to content

Increase buffer size?


Recommended Posts

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

Link to comment

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.

post-37-1097433149.jpg?width=400

Link to comment

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

Link to comment

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?

Link to comment

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

Link to comment

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

post-761-1097787477.jpg?width=400

post-761-1097787488.jpg?width=400

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.