03-11-2022 10:31 AM
Software: Labview 2019, LINX
Hardware: Sparkfun STC31 CO2 sensor, NI USB-8451
I am trying to read CO2 concentration data from an I2C based sensor (STC31). However, I am not sure how to implement 'argument' after command code using LabVIEW. I am attaching the screenshot, of how I have set it up (which is clearly not working). I have also attached the data sheet.
Solved! Go to Solution.
03-12-2022 07:51 AM
Your command needs to be one transaction. So build up an array of bytes that contain your command ID and the arguments.
You also need to make sure you handle the CRC. Either disable it (command 0x3768) or include it in your command.
03-14-2022 09:35 AM
Thanks for your reply. Is this what you meant (snapshot below) "So build up an array of bytes that contain your command ID and the arguments.". It still gives me the error 301740.
03-14-2022 09:43 AM
Stop converting to I16. The library expects an array of U8.
03-15-2022 10:34 AM
Thanks to suggestion from 'crossrulz' I have been able to successfully make the code work. The 'command' and 'argument' needs to be implemented as shown in the snapshot below.
I am also attaching the final working VI.