LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I2C giving no signal - picture of optic and datasheet attached

Hi,

 

The below code works for another optic sensor, but I have a new one and its almost identical other than the arrangement of the light pixels for the sensor. Well at least I thought it was identical... I believe I have used the correct values to setup the optic but perhaps someone with more experience can assist

 

Datasheet attached, image and VI attached...

Download All
0 Kudos
Message 1 of 7
(2,546 Views)

You do not need that FOR loop.  You read all of the temperatures in one read.  I would then use a Delete From Array with the index and length unwired.  This will remove the PEC from the data.  There are a few ways you can proceed from here to get your array of numbers.  I would like to use Byte Array To String and then Unflatten From String to convert into an array of U16 (tell the Unflatten From String to use Little Endian).  The other option is Decimate 1D Array to make two arrays (even indexes to first array, odd indexes to the other) and then Join Number to form your array of U16.  Then you apply your multiplier (10) to the array (no offset per the specification)..


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 7
(2,514 Views)

 Hi,

 

Thanks for replying and sharing your knowledge. I am not sure how to implement what you said. I attached a VI of an attempt.

 

With regard to it reading everything in one read, I thought this was optional with the command. My VI cycles through all the different addresses instead of block reading them all.

0 Kudos
Message 3 of 7
(2,495 Views)

Theres just absolutely no data being read through my code which I find odd since a similar device works on this VI.

0 Kudos
Message 4 of 7
(2,490 Views)

I tried it with a more simpler version of my VI and its dead, nothing is coming through. With your idea in two ways

 

I used this with my other two optic sensors and the same. So something is wrong between datasheet and implementation. What do you think?

0 Kudos
Message 5 of 7
(2,477 Views)

With this device, you have to specify what to read.  So you need to use the I2C Write Read VI.  I did a bunch of other clean up to make things simpler.


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 6 of 7
(2,469 Views)

Hi,

wired the I2C configuration and this works for me previous sensors but not for my new ones but the datasheets are identical from what I can tell. I've tried looking through the datasheet I uploaded and cant put my finger on whats wrong. What do you think?

0 Kudos
Message 7 of 7
(2,454 Views)