Cochran DCs

John Van Ostrand john at vanostrand.com
Tue Oct 7 10:24:16 PDT 2014


On Mon, Oct 6, 2014 at 10:57 PM, Dirk Hohndel <dirk at hohndel.org> wrote:

> On Mon, Oct 06, 2014 at 09:29:17PM -0400, John Van Ostrand wrote:
> > I have the Cochran data stream well decoded, both dive log information
> and
> > sample data. If someone is interested in moving the cochran file import
> > code forward I'd be glad to collaborate.
>
> We're certainly interested. Linus started this a while ago but didn't get
> to the point where he could make sense of the data... so there are some
> old files but nothing that works.
>
> We might even be able to get access to a Cochran dive computer to test
> this :-)
>

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.

Here is my documentation for the sample data.  This is EMC data that
includes tissue loading and no tank pressure data.

Cochran logs samples every second however the format toggles between two
formats every second.
Each sample contains depth change in feet, the first contains ascent rate
data and the second contains temperature.

+----------------------------------------------------- Flag indicating
event byte
|+---------------------------------------------------- Negative flag for
depth change
||++++++---------------------------------------------- Depth change in
feet*4
|||||||| +-------------------------------------------- Positive flag for
ascent rate
|||||||| |+++++++------------------------------------- Ascent rate
(extrapolate even seconds)
|||||||| |||||||| ++++++++---------------------------- Odd numbered tissue
loads
|||||||| |||||||| |||||||| +-------------------------- Flag indicating
event byte
|||||||| |||||||| |||||||| |+------------------------- Negative flag for
depth change
|||||||| |||||||| |||||||| ||++++++------------------- Depth change in
feet*4
|||||||| |||||||| |||||||| |||||||| ++++++++---------- Temperature in F -
20F
|||||||| |||||||| |||||||| |||||||| |||||||| ++++++++- Even numbered tissue
loads
01111111 01111111 00000000 01111111 00000000 00000000
+        Second 0        + +       Second 1         +

NOTE: If an event byte is found, it has been inserted into the stream
Start reading the next sample immediately after the even byte. Be aware
that it's common to have two event bytes in a row and some event bytes
(like deco events) have up to 4 extra data bytes following the event byte.

Commander data is the same except it lacks tissue load bytes

+----------------------------------- Flag indicating event byte
|+---------------------------------- Negative flag for depth change
||++++++---------------------------- Depth change in feet*4
|||||||| +-------------------------- Positive flag for ascent rate
|||||||| |+++++++------------------- Ascent rate (extrapolate even seconds)
|||||||| |||||||| +----------------- Flag indicating event byte
|||||||| |||||||| |+---------------- Negative flag for depth change
|||||||| |||||||| ||++++++---------- Depth change in feet*4
|||||||| |||||||| |||||||| ++++++++- Temperature in F - 20F
01111111 01111111 01111111 00000000
+    Second 0    + +   Second 1    +

NOTE: If an event byte is found, it has been inserted into the stream
Start reading the next sample immediately after the even byte. Be aware
that it's common to have two event bytes in a row and some event bytes
(like deco events) have up to 4extra data bytes following the event byte.

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.


>
> > Additionally,  I have the Cochran DC import working in subsurface and
> could
> > use some help. I'm in a little over my head hunting down a seg fault in
> > Subsurface when I use the log file option when importing.
>
> More than happy to help with that... where exactly does it happen? Can you
> reliably reproduce it? Do you have a stack trace?
>
>
A preface first. Cochran downloads all the logbook data in one read and all
the sample data in another. My code does the same.

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.

I don't have a stack trace. I'll see if I can get one.

> I could also use some dive logs that have more interesting dives than I've
> > done. Ones with more than two gasses, helium, more dives than the DC can
> > hold and a wider range of events. I'm also trying to tease out the model
> > features and I need a wide selection of data from the same models which
> > have different memory or feature configurations.
>
> A good friend of mine who is a Trimix instructor has a Cochran. I'm sure I
> could get access to that in order to test - it's a bit of driving to get
> there, so I'd love to make sure we have pretty solid code before I do that
> - ideally the ability to do a full dump (assuming that's supported by
> their protocol)
>

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.

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.

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.

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.

> If you have a Cochran DC and would like to help, I have a download program
> > to import the memory from the DC into raw data files. Alternatively, you
> > can import to Subsurface one my code is in the tree and help me identify
> > new events and find problems.
>
> I'd be interested in either. I'm traveling the next two weeks so it will
> be a little while before I can get access to a Cochran, but in the
> meantime we can track down your crash and address any other questions you
> might have.
>
> /D
>


-- 
John Van Ostrand
At large on sabbatical
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20141007/fe645df0/attachment.html>


More information about the subsurface mailing list