Multifunction DAQ

Showing results for 
Search instead for 
Did you mean: 

Can NI DAQ-6259 read / listen to i2c ?

Is it possible to use LabView and the NI DAQ-6259 to read data from an I2C sensor?
0 Kudos
Message 1 of 15

The NI 6259 doesn't support per cycle tri-stating, so it's not a good choice for I2C communication, but any 655x digital device will do. There is also a low-cost USB solution available (NI USB-8451).



Jochen Klier

National Instruments

0 Kudos
Message 2 of 15



I have actually the same question for USB-6212. Same answer ?



Best regards,


0 Kudos
Message 3 of 15

Hi JB,


yes, that's exactly the same story.



0 Kudos
Message 4 of 15

Hi Jochen,


Thanks for your quick answer.

However, it seems that the device I'd like to interface doesn't use tri-stating ( So if I use two digital I/O of my 6212 connected to SCL and SDA lines, with a proper VI, it wouldn't do the job ? I'm not familiar with I2C bus usage...


Thanks again !


0 Kudos
Message 5 of 15

Hi JB,


in addition to tristating (which might not be necessary for your usecase), I2C communication requires hardware timed digital I/Os. As the digital I/Os on the USB-6212 are static / software timed, this board can't be used for this type of communication.

Sorry, but this is really not the appropriate hardware for your usecase. More information can be found here.




0 Kudos
Message 6 of 15

I have used the NI USB-8541 for several applications. It is very easy to use and supports clock rates up to 250kHz.

You would loose much time trying to implement an I2C communication with a DAQ card.


A search will list many third party interfaces but their implementation in your LabVIEW code may be more difficult.


Just a recommendation... from another JB

Message 7 of 15

Hi all,


After some time working on this, I come back to you with some news.


First, I have to specify that the application I want to write is primarly aimed at students. I want them to really understand what an I2C bus is and how it works, and that's why I don't want to use a dedicated interface.


After some time, I came up with a solution that works quite well. See the VI attached, developped on Labview 2010.

Two remarks:

+ I had to switch to a USB 6251 board since 6212 does not support digital inputs with external clock. As the clock is provided on the bus, I need this feature.

+ The clock on the bus is generated by writing three bits (0 - 1 - 0) one after the other on the SCL line for each bit written on the SDA line. This gives me a 300 Hz clock with the 6251, which is high enough for me.

+ I still have a problem of synchronization of the channels used to generate the messages and to read the answer from the sensor (see the comments in the VI). The two channels I used (1 for generating the I2C messages, and 1 for reading the sensor output) are not right on time.


Now some more questions:

+ How can I synchronize my two tasks, e.g. well enough to be able to catch the state of the bus right after I send an ACK ?

+ Is there a way not to have to start and end the decoding task (the one at the bottom) at each loop iteration while reading the bus when the 0xFF is on it ? 


Thanks a lot !




0 Kudos
Message 8 of 15

Hi JB,


I have actually the same problem that you have had, but I'm not so familiar with Labview. Smiley Indifferent

I'd like to read data from an I2C sensor ($FILE/DHDigiPicco_E...

I'm not using the dedicated interface, but the USB 6343 board. After long seeking on the examples I've tried to use the standard MyDAQ VIs and different structures, but it doesn't work.

My question:

- Is there maybe a way to modify your application for this purpose?

- Could you make a more extended description of the functionality and VIs you used.


I'll be very grateful for any help.


Best regards,


0 Kudos
Message 9 of 15

I managed to create a communication between a DAQ-6009 and a IC2 circuit using the following code:

I2C communication with a NI-6009.pngI used 2 DO and 1 DI channels. The code is software timed. There is a delay between the execution of each DO channel which is necessary for the IC2 communication.

Using this system, I could reach about 1kbit/s.

I believe that the same code could be used for DAQ-6259

0 Kudos
Message 10 of 15