From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
09-28-2017 03:41 PM
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...
09-28-2017 08:17 PM
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)..
09-29-2017 01:30 PM
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.
09-29-2017 02:07 PM
Theres just absolutely no data being read through my code which I find odd since a similar device works on this VI.
09-29-2017 02:39 PM
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?
09-29-2017 06:45 PM
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.
10-01-2017 07:07 AM - edited 10-01-2017 07:11 AM
Hi,
I 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?