04-22-2020 07:33 AM
Hello ,
I want make an acquisition of 32 channels analog when the angular counter change of 1°.
I know the sampling rate is 500kS/s , will the acqusition time of 32 channels be 1/(500kS/32) if I make a single acquisition?
do you have any idea how i should do the code for this acqusition?
Thank so much
Jerome
Solved! Go to Solution.
04-22-2020 10:55 AM
There's some understandable confusion inherent in your question.
1. You have a *multiplexing* device, so the maximum possible sample rate will depend on the # of channels being multiplexed within the same task. Something like (but probably a bit less than) 1.25 MHz / 32. A little under 40 kHz.
2. In DAQmx terminology, a "sample" includes 1 A/D conversion for each channel included in the task. If you have 32 channels in your task and a sample rate of 20 kHz, then once every sample interval (50 microsec at 20 kHz) all 32 channels will get A/D converted. When you request samples from a call to DAQmx Read, you'll always get the same # of data values for each channel in the task.
3. Putting these things together, you'll probably be limited to a sample rate somewhere in the 35-40 kHz range when including all 32 channels in the task. But each sample will include an A/D conversion for all 32 channels.
4. There's a decent chance there's a better approach that would drive the acquisition directly from the encoder signal. This method could capture data at regular position increments such as 1 degree without wastefully acquiring at the max possible speed and post-processing to find 1 degree points after the fact.
What's the encoder resolution? You might be able to use the encoder signal directly as an external sample clock for your AI task. There are also ways to divide down the encoder signal so that you take AI samples every Nth cycle of the encoder pulse train.
-Kevin P
04-24-2020 02:19 AM
Hello Kevin,
thank for your answer ,
where do you find the value 1.25MHz?
my DAQ have a value 500kS/s , how you convert 500kS/s in 1.25MHz
my encoder have 5000 pts by turn,
my system turn around 4 RPM so I want to know the time of conversion and the angle difference between the first channel and the 32 channel
Jerome G.
04-24-2020 07:15 AM - edited 04-24-2020 07:16 AM
The 1.25 MHz was a mistake on my part. When I searched for specs, I must have clicked on the wrong link and looked up specs for a different device. I agree that your maximum is actually 500 kHz sampling for 1 channel, and it will get divided from there when you need to accomodate many channels.
I'm afraid I really don't understand the rest of your question. What do *you* mean by "time of conversion"? Are you talking about the time needed to multiplex among all 32 AI channels? That's pretty much just going to be 1 sample period.
So at 500 kHz/32 = 15625 Hz sampling, 1 period would be 64 microsec. That's the neighborhood you're in, but it's possible the board doesn't support a full 15625 Hz sampling on 32 channels, it might be just a little less.
So anyway, at 4 RPM you've got 24 degrees/sec. Your interval is about 64 microsec, so you can expect to travel 0.0015 degrees. Your encoder resolution is 360/5000 = 0.072 degrees per cycle. So you're travelling a small fraction of one encoder pulse during the multiplexing.
Is that what you were looking to figure out?
-Kevin P
04-24-2020 08:24 AM
thank you for your answer
for my question "time of conversion" , I want tell about the time of acquisition and the time of transmission .
I think when the sampling rate is 500kS/s this includes the acquisition time and the transmission time.
I would like to know the minimun time beetwen two acquisitions because I want to be sure I don't loose a measurement .
because I need to compare channel 1 with all channels , so I don't want may variation of signals.
I think you have answered at my question
Thank you for your availability
Jerome G.
04-24-2020 08:45 AM
Just to be clear, the DAQmx driver will be able to transmit data from the device to your PC at an *average sustained* rate of 500 kHz. And it manages all the difficult stuff with buffering so you won't miss any samples.
BUT, you should *not* expect to transmit each sample 1 at a time during every 1/500 kHz = 2 microsec time interval.
A typical rule of thumb is to iterate over DAQmx Read calls about 10 times a second, requesting 1/10th second worth of samples each time. DAQmx Read will be pulling data out of the task buffer on your PC. In the background, the DAQmx driver manages the dirty work of delivering data from your device across USB into the task buffer.
The end result is a lossless stream of data, but you need to read the data in decent-sized chunks. Each call to DAQmx Read will take more than 2 microsec to execute, so you have to read in chunks to keep up with the device and dr
And again, you'll need to configure your task for a sample rate of 15625 Hz or less in order to multiplex across 32 AI channels when you have a max internal *conversion* rate of 500 kHz.
-Kevin P
04-29-2020 01:16 AM
Thanks for all
You have answered at all my questions .
I want to thank you for the time that you spent for me
See you soon on the forum
Jerome G.