LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx Simultaneous Digital and Analog Acquisition

Solved!
Go to solution

Hello everyone,

 

I'm using the USB-6212 acquisition board to acquire both analog and digital inputs. However, I met some problems that I'm not sure how to solve.

 

Every channel (analog input and digital line) is independent from one another but should be acquired at the same time (using the same clock, I reckon) but I'm not managing to achieve it; besides that, I cannot set a task so as the digital acquisition is done by "continuous sample" - the error says it is not supported, but I've seen this configuration in other examples in this forum.

 

The only way to get a digital waveform is to keep pooling the input? And, therefore, also pool the analog input? Isn't it this approach expensive from the resource perspective?

 

Best Regards

0 Kudos
Message 1 of 9
(3,737 Views)

The reason that you cannot setup the same type of task for your digital line is that the 6212 does not have hardware timing for the digital inputs (only software timing).  This means that there is no sample clock perse.  The digital lines only take one sample at a time when your software asks for it.

 

Because of this limitation of your board, the only way to get an analog sample and digital sample at the same time would be to do software timing single point acquisition for both.  And this is really not guaranteed to be very accurate.

 

I wouldn't say this "polling" method incurs a performance hit necessarily, but it will be much slower and much less accurate than the hardware sampling you have available on the analog inputs.

Chris
Certified LabVIEW Architect
Certified TestStand Architect
Message 2 of 9
(3,731 Views)

Thank you very much for your answer.

Could you point out which boards present this hardware timer feature?

And is there a way I could use to estimate the hit on performance if I acquire on demand?

0 Kudos
Message 3 of 9
(3,723 Views)
Solution
Accepted by topic author Edmi0

The performance hit is going to be determined by the speed of your computer and your USB hub.

 

I think to get hardware timing for digital I/O in a USB device, you are going to have to step up to an X Series card like the 6341, but I'm not sure about that.  You can find this spec under the Specifications tab of every product.  You're looking for "Hardware" under DIO > Timing. 

Chris
Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 4 of 9
(3,713 Views)

Great!

 

So for now, I guess I'll stick to acquire on demand and see where it goes. So I just have to configure the taks so the mode is "on demand" and just keep calling the daq read, correct?

0 Kudos
Message 5 of 9
(3,710 Views)

Yep, that's it.

Chris
Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 6 of 9
(3,700 Views)

So, I wrote a small program just do see it working. It's the one attached on this post and didn't get a good result.

 

I defined the tasks on MAX, one with a digital input and the other with analog input; both had the mode set to "on demand"

However the result - as seen on the chart as soon as you open the VI - is kinda off... the signals simply doesn't match. What did I do wrong? Or is this the expected behavior?

Any thoughts on how this could be improved?

 

(the signal on screen is a 100Hz square wave with variable duty cycle)

0 Kudos
Message 7 of 9
(3,692 Views)

Yeah, this is pretty much expected.  The problem is that your software (a Windows machine with horrible determinism) is performing the timing.

 

If you were samping something slower it would look better, but you're not really going to get much of anything better with software timing.  That's why hardware timing is almost always used for analog sampling.

Chris
Certified LabVIEW Architect
Certified TestStand Architect
Message 8 of 9
(3,673 Views)

Thank you so much for your help. I really appreciate.

 

Kudos for you

0 Kudos
Message 9 of 9
(3,652 Views)