Discussion:
how to improve the buffer size when DAQ assistant is used
(too old to reply)
abc-123
2006-10-11 01:10:08 UTC
Permalink
Dear all:

Question is shown as the title, and the attachment is the error plot.


error3.JPG:
Loading Image...


error4.JPG:
Loading Image...
devchander
2006-10-11 05:10:08 UTC
Permalink
DAQmx has a feature called Automatic Output Buffer allocation.
It works in this manner: For generation, the amount of data you write before starting a generation will determine the size of the buffer.
And in DAQ assistant, you do not have a function/access to increase the size of buffer by overriding this Automatic output buffer allocation
But, instead of using DAQ assistant if you program/ build an application using DAQmx functions, a function called Output Buffer Config function/VI can be used to create an output buffer.
To start off, right click on your DAQ assistant, select 'open front Panel' and you will get to see how a AO generation VI is built
Hope this helps
Any doubts, do ask
Regards,
Dev
 
abc-123
2006-10-11 06:10:08 UTC
Permalink
Thanks,man,still, I have another question on the error introduction that is shown in the attached pic. it said, 'select buffer size:1, minimum buffer size required:2'. so, the number 1 and 2 mean the required buffer size should be in the double size of the default? and what is the value of the default buffer size?
 
Thx a lot!!
devchander
2006-10-11 06:40:09 UTC
Permalink
Like I said in previous post, The default value of the buffer size will be = Amount/ Number of samples of data that you have connected to the 'data terminal of the DAQ assistant.
In the pic you had attached, your error message is hiding the code of writing data into DAQ Assistant!
how many samples are you writing?
Also, what is the clock settings you have chosen?? (samples to write and rate) These are crucial for your DAQ assistant to execute without error
looks like you want to do a continuous generation.
So have you selected the generation mode to be continuous?
 
Message Edited by devchander on 10-11-2006 01:34 AMMessage Edited by devchander on 10-11-2006 01:35 AM
devchander
2006-10-13 07:40:09 UTC
Permalink
Sorry Pal, I have LabVIEW 7.1 installed on my system and hence cannot open your VI, which is in 8.0
can you post a pic of your block diagram??
In the meantime, let's see if someone else can take a look at your vi and suggest a solution
Jennifer O
2006-10-13 22:10:08 UTC
Permalink
Hi,
I'm not sure if you have decided to move to using DAQmx functions vs. using the DAQ assistant so I will provide advice for both. 
With the DAQ Assistant I am guessing you are using "N Samples with the "use timing from waveform data" option, and "samples to write" set to 1.  This can result in the error you posted. To resolve it, increase the number of samples to write or set the rate instead of using the waveform timing.
Similar advice applies to the application you posted.  I did not see any channels selected, you must select your device and output channel. It is not necessary to input a task. Also, it looks like you are wanting to output a square wave for a finite duration, however you are using a 1-sample write which will only write a single voltage out unless put in a loop.  Finally, the way you have set the rate in the DAQmx timing function will only work if you use the "Use Waveform" option in the polymorphic selector (the selection box below the function).
When starting out with LabVIEW programming, one of the best resources is the Example Finder (Help>>Find Examples).  There is an example called "Gen Mult Volt Updates-Int Clk.vi" which is very similar to what you are wanting to do.  I recommend taking a look at the example and experimenting with different inputs to see how the VI works.  Also the context help (CTRL+H) is very useful to learn about LabVIEW functions. Bring up the context help and simply place your cursor over a function to learn about it.
Hope this helps,
Jennifer O.Applications EngineerNational Instruments
abc-123
2006-10-14 13:10:11 UTC
Permalink
This post might be inappropriate. Click to display it.
Jennifer O
2006-10-16 16:40:16 UTC
Permalink
Hello,
I think the error you are getting with the application you posted is most likely error -200609 since you are specifying to write 100 samples, but only providing a single data point to your DAQ Assistant. 
Another possible error is -200279 which is a buffer overflow.  It is not saying that your buffer is incorrectly sized.  It is saying that you are not reading the data fast enough for the buffer size.  The two portions of your code will work separately, however when you put them together in a while loop and you read/write continuously, you need to make sure that both pieces will execute fast enough to prevent buffer underflow (data is not being written in time) or buffer overflow (data is not read in time).
Currently you are putting 1000 pieces of data into your PID VI but outputting a single point to the DAQ Assistant? I am not sure since I do not have the PID VI.  If you set both assistants to the same rate and request/provide equal data the error should be resolved. The DAQ Assistant settings look correct, however you must provide the correct amount of data to the data terminal.
If this does not help, please post the PID VI and the error code/message you receive.
Regards,
Jennifer O.Applications EngineerNational Instruments

Loading...