Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Simultaneously AI and AO

Hey,

I have a multifunction DAQ card 6251. I use this card to generate MLS sequence and take the samples simultaneously. I wrote a vi in Labview, please see the vi file as attached. When I directly link the AO(channel 1) and AI(channel 1) and start the vi, I can see the MLS sequence and the samples(measurements) in the graphs of the front panel. I also monitor the AI and AO through a scope. The vi file seems working for what I am trying to do. It generates the MLS sequence and takes the samples. However, when I stoped the vi by clicking the 'stop' button on the front panel,  I found that the output of the DAQ card (AO channel 1) is not 0, but the last value the card sent out. For example, the sequence the card send out is in two levels (+0.1V or -0.1V), the output of the card will be +0.1V or -0.1V depends on when I stop the vil. It makes problems for my application. What I need is that the output of the DAQ card to be zero whenever I stop the vi file. What I should do to achieve this? Please kindly give me your advice.

Thank you very much,
Cathy
0 Kudos
Message 1 of 23
(5,548 Views)
Hi cynew !

Well, residual AO and DO values is common problem. I don't know NI boards enough to be sure there is no way to solve it directly. What I usually did with my previous boards was to define a "reset" VI executed at the end of the acquisition task. This reset VI should put all output channels to 0.

I'm sorry I couldn't update your VI since I'm using LV 7.0 and couldn't read your VI.

Perhaps somebody knows a direct solution.

Hope it helps

Boris Matrot
0 Kudos
Message 2 of 23
(5,534 Views)
Hi tibobo!

Thank you very much for your reply. What you suggested is helpful for me.

Have a good day,
cynew
0 Kudos
Message 3 of 23
(5,525 Views)
Never use the abort (stop sign) button on the task bar at anytime except during debug. This aborts LabVIEW. The correct way to stop a VI is the way you have it in your example. If there is the possiblity that a problem can occur if a user clicks the task bar stop button, it should be hidden when the VI is running. The visible property of the abort button can be set from VI Properties>Window Appearance>Customize.
0 Kudos
Message 4 of 23
(5,524 Views)
Hi, I also have such questions. When I use the examples 'Multi-Function-Synch AI-AO.vi', I turn on the Output frequency to 100 hz, and turn the read samples to 100, all others are not changed. There is always an error as follows:
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:

Task Name: _unnamedTask<38>
Please tell me how to increase the buffer size or how to solve this problem.
Thanks
 
Jason
0 Kudos
Message 5 of 23
(5,389 Views)
Hello Jason,

The buffer overwrite error (-200279) you are seeing is caused by the fact that the analog input task in your program is not reading data from the buffer fast enough to prevent the buffer from filling up with data and overwritting existing samples.  You can monitor the amount of data sitting in the buffer at any given time using the Available Samples Per Channel property of the DAQmx Read Property Node. 


As for the size of the buffer used, the DAQmx driver chooses this automatically depending on the sampling rate you specify.  You can manually override this and specify a larger buffer using the DAQmx Configure Input Buffer.vi.

In my experience, just increasing the buffer size only delays the time until an overwrite error occurs.  I find it better to decrease the sampling rate and/or increase the number of samples to read until you find a set of options where the number of available samples per channel stays fairly constant.

I hope this helps,

Travis G.
Applications Engineering
National Instruments
www.ni.com/support

Message Edited by Travis G. on 09-18-2006 11:49 AM

Download All
0 Kudos
Message 6 of 23
(5,368 Views)
Thank you.
I have another question:
In the example, the Data of output is generated by the waveform function. The waveform mainly depends on the signal info: Fs and #S. However, there is also a sample clock in the Ao chain. Could you please tell me the difference between the Fs and sample clock (Rate)?
0 Kudos
Message 7 of 23
(5,357 Views)
Hello Jason,

The sampling info input to the Basic Function Generator.vi used within that example allows you to specify how the data points of the waveform are created within LabVIEW.  You can specify how many data points are created and the spacing between those points with the Fs (sampling frequency in samples per second) and #s (number of samples in the waveform) inputs to that function.  The Basic Function Generator.vi will output a waveform data type, which consists of three components:

1. The array of data points to be generated.
2. T0 -  the inital time of the first data point.
3. dt - the spacing between the data points in the waveform.

However, when you actually generate that data using DAQ hardware, those data points will be generated at the rate you specify with the rate input of the DAQmx Timing VI.  If you want to just use the timing information contained within the waveform data type, select the Use Waveform instance of the DAQmx Timing VI instead of the Sample Clock instance.  This way, you can just wire the waveform data into the DAQmx Timing VI and the driver figures out the rate based on the timing information contained within.



Regards,
Travis G.
Applications Engineering
National Instruments
www.ni.com/support

Message Edited by Travis G. on 09-19-2006 02:07 PM

Message 8 of 23
(5,339 Views)

Thank you very much.

Could you give me your email address? I am working on PCI6251 now. Since I am a new comer in Labview, I have a lot of problems. Can I send you the mail of them?

Thanks.

0 Kudos
Message 9 of 23
(5,329 Views)

Hello Jason,

I would be happy to continue to help you with LabVIEW and DAQmx programming, however the best and easiest way for me to help would be through these discussion forums.  The discussion forums allow us to easily attach code or screenshots to a post.  Also, this way the next person who has these same questions can come back and look at our posts as an easy reference tool.  If privacy is a concern, you can create a service request and directly contact a National Instruments Application Engineer at www.ni.com/support.  Also, don't forget the many Knowledgebases, tutorials, application notes, example code, and other support resources on our website.  Here are a few that I find particularly helpful for getting started with DAQmx programming.

Complete Data Acquisition Tutorial 

Learn 10 Functions in NI-DAQmx and Handle 80 Percent of Your Data Acquisition Applications

Regards,
Travis G.
Applications Engineering
National Instruments

 
Message 10 of 23
(5,319 Views)