LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Implementing 'arguments' using I2C.

Solved!
Go to solution

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.

ZeUs87_1-1647016158795.png

 

 

ZeUs87_0-1647015750860.png

 

 

0 Kudos
Message 1 of 5
(1,108 Views)

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.


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
Message 2 of 5
(1,071 Views)

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.

ZeUs87_0-1647268441067.png

 

0 Kudos
Message 3 of 5
(1,042 Views)

Stop converting to I16.  The library expects an array of U8.


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 4 of 5
(1,037 Views)
Solution
Accepted by topic author ZeUs87

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.

 

ZeUs87_0-1647356784430.png

 

0 Kudos
Message 5 of 5
(1,005 Views)