<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Jun 27, 2014 at 5:46 PM, John Van Ostrand <span dir="ltr"><<a href="mailto:john@vanostrand.com" target="_blank">john@vanostrand.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br><div dir="ltr"><div><div><div><div>Hi All,<br><br></div>I've been staring at and playing with this data for a week now and I don't feel any closer to deciphering the dive profile sample data from my Cochran EMC-20H.<br>
<br></div>Personally I love a challenge like this and I'm hoping some of you do as well because this one is tough. Instead of digging into a good book this weekend why not sit back with a laptop or tablet and this puzzle.<br>
</div>
<br>You'll find everything you need at the link below. I've removed the mundanely easy work from this puzzle. Included are binary files, annotated hexdumps to illustrate the data and some programs to extract and display data (don't judge, these are quick and dirty programs.) Start with the README and you'll be into the fun part within minutes.<br>
</div><div><br></div>
<a href="https://drive.google.com/file/d/0B-VD5cn7zgGHN1pVRWpib2pJc0k/edit?usp=sharing" target="_blank">https://drive.google.com/file/d/0B-VD5cn7zgGHN1pVRWpib2pJc0k/edit?usp=sharing</a><span class=""><font color="#888888"><br clear="all">
</font></span></div></blockquote><div><br></div><div>I've made some progress on this but I could still use another set of eyes.<br><br></div><div></div><div>Each sample is in 3 byte structure and the composition of that structure changes every second between two types. The odd seconds (if it starts at 1 sec) have a structure that seems to have a pressure change in mbar, the even seconds have a structure that seems to store temperature samples. Both types of structures seem to hold tissue compartment estimates.<br>
<br></div><div>Two seconds of samples looks like this (hex and binary for each sample shown):<br><br></div><div>Odd Seconds (bytes 1 to 3)<br></div><div>0x02 00000010 Bit 7, when 0, indicates that a sample follows. Bits 6 is a flag, maybe + or - indicator or data, bits 5-3 are always 0, bits 2-0 vary often.<br>
</div><div>0x14 00010100 Bit 7 indicates a negative value in this byte, bits 6-0 seem to be mbar increments from the last sample.<br></div><div>0x03 00000011 Byte indicates tissue compartment loading for one compartment.<br>
<br></div><div>Even Seconds (bytes 4 to 6)<br></div><div>0x01 00000001 Bit 7, when 0, indicates that a sample follows. Bits 6 is a flag, maybe + or - indicator or data, bits 5-3 are always 0, bits 2-0 vary often.<br></div>
<div>0x30 00110000 Bits 6-0 change very slow, like a temperature sample but the value is off and may need to be adjusted, maybe to a calibration. </div><div>0x02 00000010 Byte indicates tissue compartment loading for one compartment.<br>
</div><div><br></div><div>It's clear from using the dive software that samples for depth and temp are displayed for each second yet it appears that depth and temp are only recorded every other second. I've extracted what appears to be the mbar increment data bits and graphed them. They closely, but not exactly, follow a dive profile from the vendor software. There is detail missing and the computed depths are a few feet off. I may not have mbar to feet conversion right or there is a calibration I need to consider.<br>
<br></div><div>I suspect that bytes 1 and 4 hold sample data as well but there aren't enough free bits to match the 7 bits used for depth and the 7 bits seemingly used for temperature.<br><br></div><div>I think the bits may be scattered across more than one sample too.<br>
<br>There are 20 tissues tracked by the DC and the samples are spread across 20 seconds of depth/temp samples. That set of 20 samples is separated from the next set with 4 seconds of depth/temp samples except instead of tissue loading there is different data. Where tissue data would be are either FF or 00. I don't recall seeing the 00s change but the FFs change about mid dive and most bits go to 0. On a repetitive dive, a deeper wreck in this case, the FFs never showed up. It may be tissue loading, or OTUs or some other data. <br>
<br>Because of all this scattering of samples I'm suspecting that there is a temperature increment in the depth sample and a depth increment in the temp sample. The temp increment could be simple, just a -1 or +1 indicating a change in temperature. I've only looked briefly but I can't see which bits it could be. There aren't enough bits left over to make 7 bits of mbar increment so maybe the even-second depth sample is an increment of the odd-second depth sample.<br>
<br></div><div>In thinking this through to a practical application because maybe I'm including bits in the LSB portion that aren't part of the sample. The software displays increments of 0.25 feet, that's about 8 mbar suggesting a minimum increment and a four foot per second change in depth might be a reasonable limit giving a max increment of about 128. I suppose this could be done with 5 bits (a +/- bit and 4 data bits) but it appears to be done with 8 in the main depth sample.<br>
<br></div><div>I'm done for the evening and I'll be driving or diving all day tomorrow.<br><br></div><div>I'd be happy to discuss this later this week if anyone is also working on this.<br></div><div><br></div>
-- <br></div><div dir="ltr"><div>John Van Ostrand<br></div><div>At large on sabbatical<br></div><br></div>
</div></div>