LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What is the typical way to acquire both digital and analog signals?

I have been working with analog up until now. I have added a DI/DO module to my DAQmx and now need to work with both digital and analog. I am wondering what the "typical" design pattern is for mixing these two signals.

I am expecting about 10 voltage signals and about 12 DI signals at 1,000/second.

 

Messing around I learned that I can set up a task for each and then convert a digital waveform to an analog waveform and then add the waveform to my array of analog waveforms. I this "best" or are there better ways to do this?

 

Image 11.png

0 Kudos
Message 1 of 3
(962 Views)

That seems reasonable, but there are 2 other important things you should do:

 

- sync the 2 tasks in hardware by configuring them to share the same sample clock.  (sharing a common trigger can work if both devices are in the same chassis, but I very much prefer the shared sample clock approach whenever feasible.)

   One task will generate its own sample clock the normal way, the other will be configured to use it.  The former task would then be considered the master for timing, and must be started last.

 

- read the same # samples from both AI and DI tasks to keep the data in sync as well.  This may not be *strictly* necessary, but is almost always a good idea when sampling is sync'ed.

 

 

-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 2 of 3
(912 Views)

Great! Thank you.

I do have the samples collecting at the same rate. I'll add the clock sharing.

Thanks for your help!

0 Kudos
Message 3 of 3
(902 Views)