01-25-2012 04:34 AM
Solved! Go to Solution.
01-26-2012 02:17 AM
Sure. I probably missed something, but now I'm stuck.
01-26-2012 07:21 AM
01-27-2012 07:44 AM
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.