LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I2C - Block read command

Hi,

 

I would like to pass a command into to my device through I2C. The small section of the data sheet is included and code is attached.

 

The device is a temperature sensor with 16 pixels. A block read command exists (in data sheet and image attached) for reading the temperature at each pixel (its low byte and high byte). I want to output all this at any instant. My code does not seem to recognize the command that I pass into it (01001100).

 

Please help

Download All
0 Kudos
Message 1 of 12
(5,264 Views)

Are you getting an error?  Are you getting any data back?  Are you sure you have the write address?  I went ahead an cleaned up you VI and added some parsing of the data.  But there is not enough information to help any further.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 12
(5,212 Views)

Hi,

Thanks for the response. I am getting outputs that do not make sense to me (screenshot attached -output.png), the values should be constantly changing as the pixels take in different inputs from the environment.

 

I have another working VI that loops through the 16 addresses for each pixel instead of attempting a block read, so I believe the address is correct (screenshot attached - WorksOnAnotherVI.png). The block read is needed - any more suggestions that comes to mind?

Download All
0 Kudos
Message 3 of 12
(5,188 Views)

Additionally - attached is the screenshot of the addresses the block read should be obtaining simultaneously. I have a loop VI to go through each one systematically

0 Kudos
Message 4 of 12
(5,187 Views)

Looks like I did not need to put in the Transpose 2D Array.  I get that confused often.  Just select the Transpose 2D Array, hit Ctrl+Space to open QuickDrop, and then Ctrl+r.  That will remove and rewire for you.  After that, the chart will interpret each element of the data as a different channel.

 

And now that I know what the data means, I would say things look correct.  13.6C is a little colder than standard room temperature, but a believable "ambient".


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 12
(5,173 Views)

The values are not changing at all, it should be output live data, for instance, if i place a hot object in front of the sensor, readings should increase in value. But they are stuck on those numbers no matter how many times I run it.

 

The output should be 35 bytes, Ambient Hi and Low aswell as the 16 pixels of Hi and Low (as shown on block read command on data sheet attached above), and the PEC. Resulting in 2+(16*2)+1= 35 bytes of output data

0 Kudos
Message 6 of 12
(5,162 Views)

I think the command should be 01001100 in binary. That's 76 in decimal rep.

 

 

============EDIT============

Now I see crossrulz already fixed that in his code (there it's 4C in HEX). 

0 Kudos
Message 7 of 12
(5,154 Views)

Hi, thanks for the reply.

I have tried that and to no avail. This is baffling...

0 Kudos
Message 8 of 12
(5,146 Views)

The problem is its not giving live data, the data that is displayed in the array in the image - it never changes, even if I hold the sensor in my hand and run the program multiple times. There should be 35 bytes of data that changes all the time that include ambient temperature measurement and the temperature that the pixels read (from light - infrared radiation) that enters the sensor - this is from address 18 to 34 (datasheets attached).

 

Is there another way to pass a command into I2C? Also looking at the data sheet (attached images to this post), 01 seems to be for E2PROM whereas 00 is for RAM, is this of interest?

0 Kudos
Message 9 of 12
(5,123 Views)

Yes, but your command already reflects that.

What I am confused about is that in one place they say 01xxxxxx is for RAM block read, and in another that 00xxxxxxx is for RAM read. I understand it in a way that 01001100 is a special BLOCK READ command.

 

Are you sure the VI that reads single values works correctly? The screenshot doesn't look too good - almost all values are maxed. I think most important thing for now would be to make sure that the address is correct.

0 Kudos
Message 10 of 12
(5,113 Views)