LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sampling multiple channels at the same frequency

Solved!
Go to solution

I am having some problems understanding how to set up my cDAQ chassis.  I have a working labview program that should (I guess it's NOT working!) sample 5 channels at 5 Hz each channel.  When I get the data from the system each analog channel (all in the same task) looks to sampling at ~1.xx Hz.

 

I set up my task to sample 3 analog channels at 5 Hz, 1 sample per channel.  Does this give me an effictive sample rate of  1.666 Hz sample per channel?  This is waht my data seems to be telling me.

 

If the above is true, will changing my task to sample 3 channels at 15 Hz, 1 sample per channel give me an effictive sample rate of 5 Hz per channel?

 

The other 2 channels are digital and on a different task and seem to be working (fingers crossed!)

 

Thanks and Happy Holidays.

 

Kyle

 

I can post code if this question confusing.

0 Kudos
Message 1 of 16
(4,491 Views)
If you are requesting 1 sample per channel, you are not using ANY sample rate. It's strictly softwire timed. To use hardware timed sampling, you need to request multiple samples.
0 Kudos
Message 2 of 16
(4,489 Views)

Hello Kyle,

 

Thank you for using NI forums.  What cDAQ module are you using, and are you doing continuous or finite acquisition?  If your cDAQ module doesn't support simultaneous sampling then you are correct that the sampling rate will be divided by the number of samples, so if you would like to acquire at 5Hz on three channels then you should select 15Hz as the sampling rate.  Please let me know if you encounter any problems.

 

Regards,

0 Kudos
Message 3 of 16
(4,433 Views)

Brandon,

 

I am using a cDAQ-1972 with 9215, 9219 and 9401 x 2.  The analog task is set up according to the picture attached.  I need to sample each of the 3 analog channels 5 times per second.  I have changed the rate to 15 Hz but have not tested it because I do not have access to the equiptment until tonight.

 

I have the two digital channels set up with DAQ assistant as quad incoders and they seem to work fine.  For every three encoder readings I get only one reading from the 9215. 

 

Thabks,

 

Kyle

0 Kudos
Message 4 of 16
(4,413 Views)

Hi Kyle.Kyle

 

Check the below figure. It might be work for your data acquisition system. You can change according to your requirements later.

 

 awawa.JPG

 

 

I tried to make a data acquisition vi according to your requriemetns. I preferred to use hardware clock rather software timing.

 

If you have any doubts let me know

 

Thanks

0 Kudos
Message 5 of 16
(4,390 Views)

Viru,

 

Thank you for the reply.  I may have a sample rate issue with my module and not my LabView program.  Please see the pictures below.  I set the system up to sample 100000 times at 5 samples per channel per second (finite samples).  I still recieve data from the fist channel at a very slow rate.  If I increse the rate to 10 samples per channel per second the problem only gets worse.  NI saya this module can sample at 100 samples per second.  I may have set it up wrong but at this point it looks like 1 sample per second is all that it can do.

 

Kyle

 

   

0 Kudos
Message 6 of 16
(4,383 Views)

All,

 

Here is the problem.

 

http://digital.ni.com/public.nsf/allkb/1015F4182FB8A805862572D1006B4CC1

 

 

Thanks for your help.  I am now going to try and change this setting!

 

Kyle

0 Kudos
Message 7 of 16
(4,377 Views)
None of these images are showing the entire program and are not showing the part you had wrong initially. Why don't you post the actual VI. Can you at least answer the question about the DAQmx Read and whether you changed it from 1 Sample?
0 Kudos
Message 8 of 16
(4,367 Views)

Dennis,

 

You are correct, none of the images show the entire program.  The image 'Analog task.jpg' in my reply to Brandon shows my first sample setting with continouous samples.  This resulted in a rate of appx 1.8 Hz. 

 

I then took your advice and set 100000 finite samples at 5 samples per channel per second as shown in the 'Analog Task.jpg' in my last post.  I recieved a sample rate of appx 1.8 Hz as well.

 

I then did some digging on the NI website and found that the NI 9215 was set to sample at 2 Hz for 'high resolution' according to the link above.  I am currently trying to follow the instructions on that link but am having no luck.  I fully expect that if I change my sampling rate to 'best 60 Hz rejection' or 'high speed' I will have solved the problem.

 

I don't understand why my DAQmx channel properties box gives me completely different options then the example on the link shows.

 

Thanks,

 

Kyle

0 Kudos
Message 9 of 16
(4,348 Views)
You had a problem in the original with the DAQmx Read. I keep repeating myself. You had it set for 1Samp. I don't care if you change the parameters for DAQmx Timing. YOU HAVE TO CHANGE THE WAY YOU ARE DOING THE ACTUAL READ.
0 Kudos
Message 10 of 16
(4,343 Views)