LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Digital and analog in at the same time

Hello Group,

how do I simultaneously and synchonously aquire (read) data from digital and
analogue channels? In the Manual there are just chapters for aquiring one of
both at a time and I also can't see a function in the menu for that.

Thanx

Frank
0 Kudos
Message 1 of 3
(3,517 Views)
This is highly dependent on your hardware.

In most cases, you should simply wire the digital lines to analog inputs and just do use the examples for analog input.

Many devices do not permit continuous acquisition form the DIO lines.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 3
(3,517 Views)
Frank,

Depending on the DAQ hardware you have you may have issues with simultaneously acquiring data even on your analog channels. Our MIO (Multifunction Input/Output) DAQ cards have one analog to digital converter (ADC) and a multiplexor is used to scan all of the input channels. There will be a slight interchannel delay and you will not have truely simultaneously acquired data (loss of phase will occur). In order to perform true simultaneous acquisition you will need one of our SIO (Simultaneous Input/Output) cards.

Furthermore, our DAQ driver, NI-DAQ, is not multithreaded. Meaning, you have to pay close attention to what calls you make into the DLL, or to what VIs you are using, if LabVIEW is your development environment. For instance, AI_Read is
a blocking call, meaning if you ask for 10 bytes of data it will block all other calls until 10 bytes have been acquired. So even if you write a multithreaded application to perform analog and then digital acquisition you will have to not ask for so much that you will be blocking for great periods of time.

I agree with Ben's comment that one solution would be to pass your digital inputs to an analog input and use a SIO card to simultaneously acquire data. However, depending on what these DIO inputs will be used for this may not be a suitable option for you.

Regards,
Justin Britten

Applications Engineer
National Instruments
Message 3 of 3
(3,517 Views)