Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I set the sample rate for the USB 6251 system using 16 analog input and 2 counter timer input channels

I have a NI USB 6251 DAQ system using all 16 A-in channels (RSE) and both Counter/Timer channels as frequency input channels.  Using Labview 8.20, I have tried a number of different ways (both DAQ Assistant and individual channel programming) to read all 18 channels in a timed loop.  Each of the channels has simple slope and offset functions to convert from raw voltage to various sensor unit values.  The values are then written to data file using a DAQ Assistant module.  My problem is I cannot get the program to sample faster than 1 Hz.  It does not matter what I put for a value in the Timed Loop input, the sample rate does not change.  I am relatively new to Labview programming, so it may be something simple I am missing or it could be I am trying to do too much inside the loop.  Has anyone else run into the same issues?
0 Kudos
Message 1 of 7
(3,720 Views)

Could you attach the vi that you are working on??

We could suggest better after taking a look at it

0 Kudos
Message 2 of 7
(3,713 Views)

Attached is the vi I am having trouble with.  As you will see it is very much a work in progress, so please excuse the mess.

0 Kudos
Message 3 of 7
(3,703 Views)
The VI you attached was missing a few sub VI's, but I believe it is overkill to have separate tasks for each AI channel. You only need one task to sample all of the AI channels. After doing this I would remove the timed loop and using the timing information in the DAQ Assistant. You can set your sampling rate from there. You can use the Convert From Dynamic Data VI to convert the data to a 2D array or you can use the Select Signal express VI to select just one of the channels.

Also, here are a couple of great resources to get started using DAQ. I hope this helps!

Complete Data Acquisition Tutorial
http://zone.ni.com/devzone/cda/tut/p/id/3116

Learn 10 Functions in NI-DAQmx and Handle 80 Percent of Your Data Acquisition Applications
http://zone.ni.com/devzone/cda/tut/p/id/2835
Regards,

Chris Delvizis
National Instruments
0 Kudos
Message 4 of 7
(3,692 Views)

I will try your suggestions . . .  thanks

 

Ken

0 Kudos
Message 5 of 7
(3,682 Views)
So I tried using the DAQ Assistant VI's as you suggested, and am still having trouble getting a reasonable sample rate.  I did try the sample rate in the DAQ assistant VI set to "continuous" sampling and kept getting error -200279 no matter how large I set the buffer.  I attached a sample program that will run, but it will only run at slightly more than 1 sample per second.  I also notice consistant gaps in the data as I watch it run by on the waveform chart.  It seems what I am trying to do should be fairly simple to do, and I have yet to add slope and offset programming to the individual channels and a "write to file" VI, which will slow the program down even more.  Could you have a look & let me know what I am doing wrong?  Thanks
0 Kudos
Message 6 of 7
(3,630 Views)
Ken,

The problem seems to be with your 2 counter DAQ Assistants. Trying running the acquisition after removing those DAQ Assistants. The applications should aquire correctly. You may want to try doing the frequency measurements in parallel loops to the acquisition.
Regards,

Chris Delvizis
National Instruments
0 Kudos
Message 7 of 7
(3,609 Views)