NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Member
Zbigniew_StS
Posts: 70
0 Kudos
Accepted Solution

I2C/SMBus Melexis MLX90614 IR Termometr

I use NI-8451 interface to read temperature from Melexis IR termometer, that use SMBus protocol. Using I2C mode I can read RAM for actual temperature readout, but can not cooperate with EEPROM. Did any one made comunication with termometer? There is some specific behaviour: IR device reply at each adress, but there is no results for command that (sholud) changes I2C/SMBus addres. I have made any sugested actions (like disconnect/reconnect) and still have readout at each adress. In fact I need three or four devices at single bus and that is reason why I am looking for solutions.
Regards
Zbigniew St. Sobków PhD, LabVIEW Champion, CLD, CPI
_____________________________________________________________________________
"You can lead a horse to water, but if you can get him to float on his back you've got something."
Active Participant
GPIB_Guru
Posts: 516
0 Kudos

Re: I2C/SMBus Melexis MLX90614 IR Termometr

Can you provide some of the code that doesn't work so I can compare it to the data sheet to make sure you are not making a simple coding error?

Member
Zbigniew_StS
Posts: 70
0 Kudos

Re: I2C/SMBus Melexis MLX90614 IR Termometr

Sure. I probably missed something, but now I'm stuck.

Regards
Zbigniew St. Sobków PhD, LabVIEW Champion, CLD, CPI
_____________________________________________________________________________
"You can lead a horse to water, but if you can get him to float on his back you've got something."
Member
Zbigniew_StS
Posts: 70
0 Kudos

Re: I2C/SMBus Melexis MLX90614 IR Termometr

...and documentation.

Regards
Zbigniew St. Sobków PhD, LabVIEW Champion, CLD, CPI
_____________________________________________________________________________
"You can lead a horse to water, but if you can get him to float on his back you've got something."
Active Participant
GPIB_Guru
Posts: 516
0 Kudos

Re: I2C/SMBus Melexis MLX90614 IR Termometr

Ok. I see 4 mistakes in your code

1. On your Read_Termometer_NI_send.vi, you are only reading 2 bytes on the read when it appears the Melexis returns 3 bytes (Data Low, Data High, PEC).

2. You are doing a left shift of 1 on the I2C_Termom_Addr. Our API uses a 7-bit address. With the default address of 0 this is okay, but when you change the address this will no longer work.

3. On your write, you are splitting the request into multiple writes (Write (Command), Write (Data Low, Data High, PEC)). This will create the incorrect pattern on the bus. You must use a single write with all 4 bytes. Also, I don't know if the read will do any good. You probably always need to do a write/read. Again, this would need to do a read of 3 and a write of just the EEPROM_SMBus_Address to read it back.

4. You are passing a zero for the PEC. I think it needs to be the correct 8-bit CRC on the first three elements (Command, Dala Low, Data High) or else the command will likely be rejected by your device.

By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page