Showing results for 
Search instead for 
Did you mean: 

Problem creating an SMBusBlockRead function with 8451

HI !
I'm trying to programm some routines to talk to a bq20z80 from Texas Instruments who has a SMBus protocol based on a physical I2C interface. For that, I'm using Labview 8.20 with a 8451 USB-to-I2C interface.
I allready made the read word and write word functions and they do well. Problems did appear since I wanted to make the SMBus BLOCK READ routine. The figured showed below (taken from this URL : represents what a SMBus BLOCK READ signifies :

One of the big difference between a SMBus Block Read and an SMBus Read Word is shown in the red square on the previous picture. Indeed, after you send the command to ask the slave to send a block of Bytes to the master (in this case the command is 0x0045), the slave will first tell the master how many bytes he'll send to him, before he does it. So we know that the fisrt returned value will be 1 Byte (value between 0 and 255, the number of bytes that will be returned). This answer has to go to the next I2C read script who needs to know how many bytes the master will have to receive from the slave.
So shortly said, the master has to do 2 consequent reads without start/stop bit or adresse write. As the attached VI is the most logical maner for me to do it, it doesn't work and I receive an error message : "NI-845x : The Slave did not acknowledge a data byte transmitted by the I2C Master". On the Front pannel of the programm, I can see that the first byte has been correctly received (the number 11), but no data could be transmitted afterwards.
N.B. As I know that the number of bytes to be read is 11, on the VI that a constant that is fixed at the entry of the second Read I2C Block.
Thanks a lot in advance for your answers,

Message Edité par newbieLBW le 11-09-2006 08:42 AM

0 Kudos
Message 1 of 3
Hi Yves,

We discussed your problem with colleagues from R&D and we found this solution:

"Well the VI looks good, but it seems you have to break the script in order to avoid the error you got.
See the modified attached VI  to understand what i mean. Unfortunately you can not use read results within the script, but i hope this works."

Best Regards.

Matthieu Papaux
National Instruments
Message 2 of 3
Thanks a lot for the information. My VI works fine now ! Smiley Wink
0 Kudos
Message 3 of 3