Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Sequential Sampling on USB 6225

Currently I'm writing a program that samples a PWM signal in an analogue manner and by means of data processing a PWM output is obtained. The signal I'm sampling has a frequency of 1kHz. I need to read 35 signal of the same format. In order to obtain a good resolution in terms of PWM, I'm running the DAQ at a rate of 250kHz and obtaining 250 samples thus having 250 samples every 1ms. In order to be able to sample at this rate each signal is sampled with a task of its own. The issue with this is that in order to sample for 1ms, the data aqusition loop takes 37ms. Is there a possibilty to improve this time with the same hardware?

 

Thanks in advance

0 Kudos
Message 1 of 3
(2,906 Views)

You only need 1 data acquisition task, and can use channel expansion to get all channels at once.  Also it looks like you need a continuous task rather than a finite.  Every time you restart your task, it takes additional time to start, acquire, stop.  Check out the DAQmx shipping examples.

Paul Davidson
National Instruments
Product Owner - ni.com Chat
0 Kudos
Message 2 of 3
(2,884 Views)

Bad news: you've got to make some substantial changes to have much hope of getting there from here.  Your channel count, oversampling plan (250 samples per 1 kHz PWM cycle), and apparent need to update all 35 PWM measurements at a fairly rapid rate demand a lot more data acq hardware than you're likely to want to afford.

 

OR...

 

Get a bunch of capacitors and resistors to make low-pass filters for all the PWM channels, then sample the filtered outputs.  Still not perfect as the ripple will limit your precision, but you can get rapid measurement updates without acquiring huge amounts of data.

 

BTW, your code would improve by relying less on local variables.  There are some potential race conditions when writing to them from different places.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 3 of 3
(2,879 Views)