From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
06-12-2014 09:21 AM
Hello !
I try to communicate with a LM92 temperature sensor via the NI USB-8451 by I²C protocol. I have an issue with the addressing because the 7 bits sensor address is 1001011 (A1 and A0 set to 1) but the LM92 is working in little endian (LSB first) and Labview adds the R/W bit at the end of the address so the complete frame sent to the LM92 is 1001011R/W.
I'm trying to find a solution to invert the complete frame before seending it in order to communicate with the LM92.
Labview returns the error -301742 because the address is not the wright one and i can't find how to send the adress in little endian.
I just need to read the temperature register of the sensor so i don't need to write anything in it.
Does anyone have an answer ?
Solved! Go to Solution.
06-12-2014 09:40 AM - edited 06-12-2014 09:43 AM
@Sanguigui wrote:
Hello !
I try to communicate with a LM92 temperature sensor via the NI USB-8451 by I²C protocol. I have an issue with the addressing because the 7 bits sensor address is 1001011 (A1 and A0 set to 1) but the LM92 is working in little endian (LSB first) and Labview adds the R/W bit at the end of the address so the complete frame sent to the LM92 is 1001011R/W.
I'm trying to find a solution to invert the complete frame before seending it in order to communicate with the LM92.
Labview returns the error -301742 because the address is not the wright one and i can't find how to send the adress in little endian.
I just need to read the temperature register of the sensor so i don't need to write anything in it.
Does anyone have an answer ?
I do not have the USB-8451 to check this myself, but based off of this document: http://www.ni.com/white-paper/5767/en/ I would guess you should be looking into these two VIs:
Advanced LabVIEW API for Device Addressing
Use the Script Address + Write or + Read Functions after a Script Issue Start function to program the device address.
Note: This, however, is just a shot in the dark. It seems like deep down they are calling a library, so it may be out of your control unless you have access to the library being called as well.
06-12-2014 09:48 AM
Thank you MrHappyAsthma i'll give it a try !
06-13-2014 08:38 AM
Sorry MrHappyAsthma but the advanced adressing didn't worked... I think i may have to modify one of the adressing vi in order to transfer my frame in little endian...
06-13-2014 08:51 AM - edited 06-13-2014 08:53 AM
@Sanguigui wrote:
Sorry @MrHappyAsthma but the advanced adressing didn't worked... I think i may have to modify one of the adressing vi in order to transfer my frame in little endian...
Ah Im sorry to hear that. I was hoping those advanced functions would give you more control over Bit Order.
Based off of the VIs in the sample code provided in the original post, it seems like the address gets the extra r/w bit added inside NI-854X I2C Read VI. Specifically in the Call Library Function Node:
If you can access that, then you should be able to flip the bits and add the read bit to the front. Then you could do similarly for the write. However Idk how deep into the library you are able to access/modify as I do not have it installed.
06-24-2014 06:41 AM
To solve the problem :
The adressing problem doesn't come from the adress sent in Big Endian, my LM92 was on a board and a driver forbade the LM92 sensor to communicate with my USB-8451 (i don't know why yet).
So I just desoldered my LM92 and solded directly +5V SDA SCL and GND wires on it and it works with the Labview examples that you can find in HELP -> Find examples
Thank for trying to help me MrHappyAsthma !
07-03-2014 05:10 AM
Is there any NI modules which contains analog measurements and digital measurements and frequency and also main I2C communication in one module???
Please give a suggesion if any third party modules also including above parameters.
07-03-2014 06:06 AM - edited 07-03-2014 06:06 AM
08-28-2014 10:31 AM
@Sanguigui, I was having a similar issue recently but not with the LM92. Areyou suggesting that by connecting the IC directly with the NI interface, wewill have no issues in addressing? I wanted to know if the LM92 reconfigureditself to work with big endian system or did LabView convert the address tolittle endian. It’s a bit confusing as you found a solution where you didn’t tore-program or reconfigure something that seemed to be a configuration orprogramming issue.
08-28-2014 10:45 AM
@kurt81
The driver on my PCB worked with 5V command but the NI USB-8451 works with 3.3V max so when desoldering the driver my message in little endian was well understood.
By searching to modify the C program directly i found that users doesn't have the right to modify the codes already implanted.
And yes i solved the problem by directly connecting my sensor to the NI 8451 because it works by default in I2C, the driver was only here to avoid communication loss by repeating the signal.
In the Labview examples for I2C communication you will find a function to convert the address from big to little endian so my LM92 didn't reconfigure itself !