<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Oct 6, 2014 at 10:57 PM, Dirk Hohndel <span dir="ltr"><<a href="mailto:dirk@hohndel.org" target="_blank">dirk@hohndel.org</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"><span class="">On Mon, Oct 06, 2014 at 09:29:17PM -0400, John Van Ostrand wrote:<br>
> I have the Cochran data stream well decoded, both dive log information and<br>
> sample data. If someone is interested in moving the cochran file import<br>
> code forward I'd be glad to collaborate.<br>
<br>
</span>We're certainly interested. Linus started this a while ago but didn't get<br>
to the point where he could make sense of the data... so there are some<br>
old files but nothing that works.<br>
<br>
We might even be able to get access to a Cochran dive computer to test<br>
this :-)<br></blockquote><div><br></div><div>I've looked at the code and ran it against my Cochran ".CAN" file. I saw configuration and dive header information but the sample data looked off.<br><br></div><div>Here is my documentation for the sample data.  This is EMC data that includes tissue loading and no tank pressure data.<br><br>Cochran logs samples every second however the format toggles between two formats every second.<br>Each sample contains depth change in feet, the first contains ascent rate data and the second contains temperature.<br><br>+----------------------------------------------------- Flag indicating event byte<br>|+---------------------------------------------------- Negative flag for depth change<br>||++++++---------------------------------------------- Depth change in feet*4<br>|||||||| +-------------------------------------------- Positive flag for ascent rate<br>|||||||| |+++++++------------------------------------- Ascent rate (extrapolate even seconds)<br>|||||||| |||||||| ++++++++---------------------------- Odd numbered tissue loads<br>|||||||| |||||||| |||||||| +-------------------------- Flag indicating event byte<br>|||||||| |||||||| |||||||| |+------------------------- Negative flag for depth change<br>|||||||| |||||||| |||||||| ||++++++------------------- Depth change in feet*4<br>|||||||| |||||||| |||||||| |||||||| ++++++++---------- Temperature in F - 20F<br>|||||||| |||||||| |||||||| |||||||| |||||||| ++++++++- Even numbered tissue loads<br>01111111 01111111 00000000 01111111 00000000 00000000<br></div><div>+        Second 0        + +       Second 1         +<br></div><div><br>NOTE: If an event byte is found, it has been inserted into the stream<br>Start reading the next sample immediately after the even byte. Be aware<br>that it's common to have two event bytes in a row and some event bytes<br></div><div>(like deco events) have up to 4 extra data bytes following the event byte.<br></div><div><br></div><div>Commander data is the same except it lacks tissue load bytes<br><br>+----------------------------------- Flag indicating event byte<br>|+---------------------------------- Negative flag for depth change<br>||++++++---------------------------- Depth change in feet*4<br>|||||||| +-------------------------- Positive flag for ascent rate<br>|||||||| |+++++++------------------- Ascent rate (extrapolate even seconds)<br>|||||||| |||||||| +----------------- Flag indicating event byte<br>|||||||| |||||||| |+---------------- Negative flag for depth change<br>|||||||| |||||||| ||++++++---------- Depth change in feet*4<br>|||||||| |||||||| |||||||| ++++++++- Temperature in F - 20F<br>01111111 01111111 01111111 00000000<br>+    Second 0    + +   Second 1    +<br><br>NOTE: If an event byte is found, it has been inserted into the stream<br>Start reading the next sample immediately after the even byte. Be aware<br>that it's common to have two event bytes in a row and some event bytes<br>(like deco events) have up to 4extra data bytes following the event byte.<br><br></div><div>I suspect the Gemini has an additional bytes for tank pressure. If it's in 4psi increments like Linus says then it needs 10 bits for a 4096PSI tank. I'd bet it's spread across two samples.<br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<span class=""><br>
> Additionally,  I have the Cochran DC import working in subsurface and could<br>
> use some help. I'm in a little over my head hunting down a seg fault in<br>
> Subsurface when I use the log file option when importing.<br>
<br>
</span>More than happy to help with that... where exactly does it happen? Can you<br>
reliably reproduce it? Do you have a stack trace?<br>
<span class=""><br></span></blockquote><div> </div><div>A preface first. Cochran downloads all the logbook data in one read and all the sample data in another. My code does the same.<br><br></div><div>The fault occurs after all the data is downloaded and may be happening during or after the data is parsed. I'm probably walking over some memory somewhere.<br><br>I don't have a stack trace. I'll see if I can get one.<br><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="">
> I could also use some dive logs that have more interesting dives than I've<br>
> done. Ones with more than two gasses, helium, more dives than the DC can<br>
> hold and a wider range of events. I'm also trying to tease out the model<br>
> features and I need a wide selection of data from the same models which<br>
> have different memory or feature configurations.<br>
<br>
</span>A good friend of mine who is a Trimix instructor has a Cochran. I'm sure I<br>
could get access to that in order to test - it's a bit of driving to get<br>
there, so I'd love to make sure we have pretty solid code before I do that<br>
- ideally the ability to do a full dump (assuming that's supported by<br>
their protocol)<span class=""><br></span></blockquote><br></div><div class="gmail_quote">He may have the same model as I do, an EMC-20H, but having samples with more gases and a logbook that's rolled off old dives would be handy.<br><br>The best thing at this point is if you can get your friend to capture 
the USB traffic while doing an import in Analyst and send us the data. I
 used USBlyzer which has a trial period for your friend. It does need to
 be configured to capture more data per message, I've seen 4K packets 
transferred over USB. I  can take a CSV export from that, produce raw 
data files and run a DC simulator. <br><br></div><div class="gmail_quote">There are several things that may vary between models and depending on features enabled on the model. The last few bytes of the first response is used to verify the model. If it's unknown the download/import will not continue and we won't have a full download. When transferring logbook and sample data the baud rate changes probably to match the CPU on the DC. It varies between families. Then the memory start and end addresses vary depending on the model and what features are enabled. Apparently Cochran hardware for a model is identical but they only enable as much memory as you've purchased. Then there is a difference in data format between EMC and Commander and probably Gemini which affects how much data i as for and how it's parsed.<br><br></div><div class="gmail_quote">There are a few Cochran computers around here. I have a new EMC model and a 10 year Commander and the rest are different models of the same family. I'll see how many I can work through before you take the time to travel. If you happen to get together with him let me know and I can be available to help.<br><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="">
> If you have a Cochran DC and would like to help, I have a download program<br>
> to import the memory from the DC into raw data files. Alternatively, you<br>
> can import to Subsurface one my code is in the tree and help me identify<br>
> new events and find problems.<br>
<br>
</span>I'd be interested in either. I'm traveling the next two weeks so it will<br>
be a little while before I can get access to a Cochran, but in the<br>
meantime we can track down your crash and address any other questions you<br>
might have.<br>
<span class=""><font color="#888888"><br>
/D<br>
</font></span></blockquote></div><br clear="all"><br>-- <br><div dir="ltr"><div>John Van Ostrand<br></div><div>At large on sabbatical<br></div><br></div>
</div></div>