LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to implement i2c for ni9403 at crio 9066

Hello?

I have a cRIO 9066 and the 9403 DIO module, and was hoping someone could help me figure out how to interface with a device that communicates over I2C.

I'm trynig to communicate with PH EZO (atlas scientific).

http://www.atlas-scientific.com/product_pages/circuits/ezo_ph.html 

thanks in advance

 

Tamir

 

0 Kudos
Message 1 of 13
(4,853 Views)

http://www.ni.com/white-paper/3479/en/

 

Or, you could just go to VIMP and download one of the many built librarys for I2C

0 Kudos
Message 2 of 13
(4,820 Views)

I tried this on already and its doesn't work.

Did you hace a success with I2C and NI9403 ? 

0 Kudos
Message 3 of 13
(4,799 Views)

I haven't used the 9403 specifically.  But, I tend to use the built libraries to work with I2C.  My last post should have said VIPM instead of VIMP.

 

Really, I don't have enough to help you.  Unless you're expecting me to write your entire project for you so that you can use my code, you've shown me nothing.

 

1)  What have you tried?  "I tried this" says nothing.  Did you copy the code from the white paper and run into issues?  Did you download a package from VIPM and couldn't figure that out?  Where's your code?

 

2) What does "it doesn't work" mean?  There's such a wide variety of issues we can be seeing here.  Are you getting anything off the DIO lines?  Are you getting a broken VI? Can you compile?  Which line isn't behaving as you expect? 

0 Kudos
Message 4 of 13
(4,764 Views)

1)  I tried several options:   the link you posted and several options from vipm.

2)  the code compiled but when i run it (i built code in the RT to control from their) but the sensor doesn't respond ( it have a LED to indicate).

when i connected  scope to the DIO its seems the values have been changed from low to high.

 

the code that I'm tring to work with its this fron the white paper (http://www.ni.com/white-paper/3479/en/).

 

 

 

0 Kudos
Message 5 of 13
(4,739 Views)

You say you have the DIO being read on a scope.  At this point, it's a bit unclear what you mean.  You say you see values changed from low to high.  Does this mean it's only giving a high result and never a low?  Do high values represent as a low?

 

If it's the first, remove the device from your I2C bus.  Instead, just attach it to the scope and read. 

 

My guess is the problem comes from a lack of understanding of I2C (specifically arbitration).  https://en.wikipedia.org/wiki/I%C2%B2C#Arbitration_using_SDA

 

Do you have pull-up resistors on your bus?  If not, it's likely your master is trying to rest at high, seeing a low, and then stopping the transmission.  This is part of the I2C protocol.

0 Kudos
Message 6 of 13
(4,723 Views)

I have pull up resistors.

I have one master  and one slave, so i don't think it's arbitration issue.

I attached 3 pics. on of SCL scope and one from SDA and one from both together (in the one together its offset ,both 5 V high, so its be easy to see)

 

 

Download All
0 Kudos
Message 7 of 13
(4,710 Views)

What are the values you are expecting?

JD B.
Applications Engineer
National Instruments
0 Kudos
Message 8 of 13
(4,648 Views)

from what i saw in i2c documentation, it's need to look like that.

0 Kudos
Message 9 of 13
(4,620 Views)

I apologize. I am a little confused. What exactly is the issue you need assistance with? Are you getting incorrect or unexpected readings? Do the examples not work?

 

Will you please provide more specifics about your question? 

JD B.
Applications Engineer
National Instruments
0 Kudos
Message 10 of 13
(4,587 Views)