02-09-2009 08:48 AM
I am working with an Li-800 gas analyzer and I am trying to extract a CO2 measurement from a serial feedback I get from the instrument. Unfortunately the documentation for doing this is limited and I am stuck.
I can successfully poll the instrument and get a package of information back from it. In the “normal view” in my string indicator, the result is gibberish. When I switch to hex view I get something like this:
062A 0028 9838 3895 9884 DA76 960F DB3C 92FA BC26 8F1F D31E 8A56 291D 8104 3000 0000 0000 0000 0000 8056 362E 0000 0000 8746 0000 8921 9333 337D 5DF0 2964 000A
The documentation I have says the instrument should send a 89-byte configuration packet. In looking at this package, I only see 64 bytes. The CO2 information is supposed to be encoded in bytes 64 and 65. The conversion for calculating the CO2 is:
CO2 = (256*config(64) + config(65))/scaling factor; (I think the scaling factor is 8.192)
I have some software that comes with the unit and it says the CO2 at the time I got this configuration package was 2264 ppm.
When I successively poll the device, the bytes in the position occupied by bytes 5DF0 and 2964 change regularly. The 337D byte changes slightly and the rest of the package doesn’t change.
The package is also to supposed to encode the cell temperature (51.8), cell pressure (978) and supply voltage (16.7). These are supposed to be in bytes 68-69, 72-73, and 77-78 respectively. The general conversion formula for all of these is:
Parameter = o + (256*hb +lb)/s; where hb = high byte, lb = low byte, s = scaling, o = offset
I am pretty sure offset is 0 for all parameters except for temperature which is -20. The scaling factor for temperature is 8.192, for pressure is 0.8192, and for voltage is 148.945.
Any thoughts on this problem?
Thanks.
Solved! Go to Solution.
02-09-2009 08:59 AM
Hi CoreyNE,
did you set the correct termination character? From your data i think you use the default "0xA" and that could be the reason for only 64 bytes instead of 89.
Mike
02-09-2009 09:00 AM
02-09-2009 09:05 AM

02-09-2009 01:46 PM
02-09-2009 02:24 PM

02-09-2009 03:00 PM
Cory
You set the Termination properties with a Proerty node.
02-10-2009 07:33 AM
I made sure the termination character was disabled but I get the same result. Maybe the documentation is incorrect in how many bytes are supposed to be returned.
02-10-2009 07:52 AM
There are two term char enables properties, one for transmit and one for recieve.
Try using a property node after your read to see if there are more bytes waitng to be read.
If you post your code we could help clear up some of the more subtle points.
Ben
02-10-2009 08:55 AM
Here's the code as it stands now. There is not much to it. Once I have it working it will serve as a sub-routine in a larger data acquisition program.
Corey