09-26-2017 01:48 PM
Hi.
I am trying to acquire 2 differents signals using the same hardware (USB-6212).
The issue is that I have to do it at different rates to each channel, but all the examples that I've found about it use only one sample clock hence use the same sample rating for both channels, just like in the image that i attached.
Is there any way to make those two channels in parallel, at different rates? Should I use Master/Slave or any other desing pattern?
Further, how do I calculate the delay of the acquisition time between those channels?
09-26-2017 02:01 PM
Since the USB-6212 has only one A/D-converter you can only start one analog-in task. So read both AI channel inside one task with the higher rate and then decimate the values of one channel.
Regards, Jens
09-26-2017 02:08 PM
@jg69 wrote:
Since the USB-6212 has only one A/D-converter you can only start one analog-in task. So read both AI channel inside one task with the higher rate and then decimate the values of one channel.
Regards, Jens
... or resample at the lower rate.
But in either case, that seems like an achedemic question because sample at a higher rate is always better than at a lower rate so why throw way better data to make it less good?
Ben
09-26-2017 02:11 PM
Hi Guhal,
Is there any way to make those two channels in parallel, at different rates?
Yes it's possible. My Idea is below
Should I use Master/Slave or any other desing pattern?
It's depend type of application that you have. But, I don't advise you this desing pattern "Because you can lost data, Master/slave use notified" Producer/Consumer (Data or Event) it's better.
Further, how do I calculate the delay of the acquisition time between those channels?
Use element of Timing Palette.
Kudos are welcome
09-26-2017 02:21 PM - edited 09-26-2017 02:32 PM
sss
@Fred19ni wrote:
Hi Guhal,
Is there any way to make those two channels in parallel, at different rates?
Yes it's possible. My Idea is below
...
That will only work if you have more one AI device.
have you tried that yourself?
Ben
PS: If you do not belive me wait until Jens posts saying the same thing. (smiley-wink)
09-26-2017 02:23 PM
@Fred19ni wrote:
Is there any way to make those two channels in parallel, at different rates?
Yes it's possible. My Idea is below
NO !!! That will not work on a USB-6216 card! You will get an error on one of the tasks that the resource already is reserved.
Regards, Jens
10-02-2017 02:57 PM - edited 10-02-2017 02:58 PM
I actually try that way, but, as they said, the only possible way to use your idea is having more than one device, which is not my case. Anyway, thank you for your help...
10-02-2017 03:06 PM - edited 10-02-2017 03:08 PM
Ben escreveu:
@jg69 wrote:
Since the USB-6212 has only one A/D-converter you can only start one analog-in task. So read both AI channel inside one task with the higher rate and then decimate the values of one channel.
Regards, Jens
... or resample at the lower rate.
But in either case, that seems like an achedemic question because sample at a higher rate is always better than at a lower rate so why throw way better data to make it less good?
Ben
Since my device has a maximum sampling rate, i thought it would be better to use a higher rate to some channels that are more important, and a lower to the other ones. Does it make any sense?
Further, what did you mean when you said to resample at the lower rate? Should I use another DAQmx Timing VI? Sorry for so many questions, but could you give me an example?
10-02-2017 03:16 PM
Since my device has a maximum sampling rate, i thought it would be better to use a higher rate to some channels that are more importants, and a lower to the other ones. Does it make any sense?
Further, what did you mean when you said to resample at the lower rate? Should I use other DAQmx Timing VI? Sorry for so many questions, but could you give me an example?
10-03-2017 06:44 AM
@guhal wrote:
Further, what did you mean when you said to resample at the lower rate?
This is a signal processing trick to take a lot of data and condense it. There are pros and cons to doing this. Less data = less power. Less data = lower bandwidth. But simple ways to "resample" your data is to perform an average on every X samples to reduce your rate by a factor of X. More involved resampling (what I was taught in school) is to decimate your data and then apply a filter. There are VIs specifically for resampling your data in the Signal Processing palette.