Question about Zeiss CAN29 messaging

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Question about Zeiss CAN29 messaging

Wiktor Phillips
Hi,

Quick question: Is there any kind of documentation of the low-level/platform independent communications protocol for the CAN29 bus? Or am I stuck inferring the byte commands/responses from the implementation in the Zeiss CAN29 device adapter..?

Cheers,

Wiktor



När du skickar e-post till Karolinska Institutet (KI) innebär detta att KI kommer att behandla dina personuppgifter. Här finns information om hur KI behandlar personuppgifter. 


Sending email to Karolinska Institutet (KI) will result in KI processing your personal data. You can read more about KI’s processing of personal data here. 



_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: Question about Zeiss CAN29 messaging

Micro-Manager mailing list
Hi Wiktor,

I'm wondering (speaking from total ignorance here), whether this is just a standard CAN bus (extended frame=29bit) interface:

Gary

On Mon, 20 May 2019 at 07:57, Wiktor Phillips <[hidden email]> wrote:
Hi,

Quick question: Is there any kind of documentation of the low-level/platform independent communications protocol for the CAN29 bus? Or am I stuck inferring the byte commands/responses from the implementation in the Zeiss CAN29 device adapter..?

Cheers,

Wiktor



När du skickar e-post till Karolinska Institutet (KI) innebär detta att KI kommer att behandla dina personuppgifter. Här finns information om hur KI behandlar personuppgifter. 


Sending email to Karolinska Institutet (KI) will result in KI processing your personal data. You can read more about KI’s processing of personal data here. 

_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general




_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: Question about Zeiss CAN29 messaging

Matthias Blaicher
The raw messages have a preamble and postamble and occurrences of 0x10 are escaped.

I have recently build my own library to talk to an observer and developed it against the Zeiss internal simulation. See also my previous message on this topic some days ago.

I found the messages to be well structured and the MTBMonitor and MTBTest very helpful to decode the messages and their format.

Best,
Matthias

On May 20, 2019 1:32:00 AM GMT+02:00, Gary Ruben via micro-manager-general <[hidden email]> wrote:
Hi Wiktor,

I'm wondering (speaking from total ignorance here), whether this is just a standard CAN bus (extended frame=29bit) interface:

Gary

On Mon, 20 May 2019 at 07:57, Wiktor Phillips <[hidden email]> wrote:
Hi,

Quick question: Is there any kind of documentation of the low-level/platform independent communications protocol for the CAN29 bus? Or am I stuck inferring the byte commands/responses from the implementation in the Zeiss CAN29 device adapter..?

Cheers,

Wiktor



När du skickar e-post till Karolinska Institutet (KI) innebär detta att KI kommer att behandla dina personuppgifter. Här finns information om hur KI behandlar personuppgifter. 


Sending email to Karolinska Institutet (KI) will result in KI processing your personal data. You can read more about KI’s processing of personal data here. 

_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general



--
Sent from my Android device with K-9 Mail. Please excuse my brevity.

_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: Question about Zeiss CAN29 messaging

Wiktor Phillips
Thanks Matthias.

So from what I understand this may require doing some initial dev work on a Windows machine with the MTB SDK installed? I intend to interface with the microscope from Linux if possible.

Essentially, I should monitor the bus while issuing commands to capture their structure, then reconstruct the raw messages with a bespoke parser + serial interface in my language of choice?

Are the utilities to monitor the CAN bus included in the SDK or are they from a third party?

Thanks,

Wiktor

From: Matthias Blaicher <[hidden email]>
Sent: Monday, May 20, 2019 12:40 PM
To: Micro-Manager General; Gary Ruben via micro-manager-general
Subject: Re: [micro-manager-general] Question about Zeiss CAN29 messaging
 
The raw messages have a preamble and postamble and occurrences of 0x10 are escaped.

I have recently build my own library to talk to an observer and developed it against the Zeiss internal simulation. See also my previous message on this topic some days ago.

I found the messages to be well structured and the MTBMonitor and MTBTest very helpful to decode the messages and their format.

Best,
Matthias

On May 20, 2019 1:32:00 AM GMT+02:00, Gary Ruben via micro-manager-general <[hidden email]> wrote:
Hi Wiktor,

I'm wondering (speaking from total ignorance here), whether this is just a standard CAN bus (extended frame=29bit) interface:

Gary

On Mon, 20 May 2019 at 07:57, Wiktor Phillips <[hidden email]> wrote:
Hi,

Quick question: Is there any kind of documentation of the low-level/platform independent communications protocol for the CAN29 bus? Or am I stuck inferring the byte commands/responses from the implementation in the Zeiss CAN29 device adapter..?

Cheers,

Wiktor



När du skickar e-post till Karolinska Institutet (KI) innebär detta att KI kommer att behandla dina personuppgifter. Här finns information om hur KI behandlar personuppgifter. 


Sending email to Karolinska Institutet (KI) will result in KI processing your personal data. You can read more about KI’s processing of personal data here. 

_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general



--
Sent from my Android device with K-9 Mail. Please excuse my brevity.


_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: Question about Zeiss CAN29 messaging

Stuurman, Nico
In reply to this post by Wiktor Phillips
On 5/19/19 12:24 PM, Wiktor Phillips wrote:
> Quick question: Is there any kind of documentation of the
> low-level/platform independent communications protocol for the CAN29
> bus? Or am I stuck inferring the byte commands/responses from the
> implementation in the Zeiss CAN29 device adapter..?

You should ask Zeiss.  If I am not mistaken, description of the
communication interface comes with the MTB (but I may very well be
wrong, and you may need to request this separately).  They have very
good documentation and supported it (at least in the past) very well.

You can also study the code of the Micro-Manager ZeissCAN29 device
adapter, which should give you a clear idea how to go about this.
Indeed, the low level protocol is an extension of the original CAN
protocol.  However, that only tells you something about the structure of
the messages, not the content.  I do remember that this protocol was a
pleasure to work with, so well structured that it was very straight
forward to implement new devices. Thanks for the mention of the
emulator!  Regretfully, I will have no time to work on that, but
hopefully it can help others to improve and extend the existing code.

Best,


Nico


_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: Question about Zeiss CAN29 messaging

Matthias Blaicher
In reply to this post by Wiktor Phillips
Hi Wiktor,

I find it entertaining, that you are doing what I played with the last few weeks. I'm also primarily under Linux, so I can understand where you are coming from.

The Zeiss MTB is mostly a .NET application talking to a communication server. It can talk to a microscope, but also simulate one via the communication server.
There are thre important programs provided by the Zeis RDK/SDK:

- MTBConfig for configuration of the device layout. Can also set up a simulated device.
- MTBMonitor to see what low level commands go over the wire. It also helps you to see what byte goes where. Note that marking the bytes with the mouse allows easy decoding of the big endian data entries.
- MTBCtrl for manual control of the microscope, helps to figure out what means what. It may ask you for a password in simulation mode, it is "service".


My development setup was as follow:

Inside a virtual machine (I used the free Windows Edge evaluation VM)
1. MTB2011 with simulated microscope
2. Forward this to a serial COM port with my https://github.com/mabl/ZeissMTBCan29Bridge
3. Use a COM port loop (com0com) to Forward it to a second COM port.
4. Attach that to a COM to TCP/IP bride. (One could also use micromanager here to connect to the loop port.)

Pipe that TCP connection to the outside and develop against the TCP Com port.

Once I'm back to true hardware I'll try and get USB working, but I expect my code to directly work with a true Zeiss serial COM port.


Regarding the messages, my notes are sparse but basically:

> * Look all 10ms for a new message. These can be uncolicited.
>
> Message look like:
>
> PREAMBLE: 0x10 0x02
> MESSAGE: Arbitrary bytes. 0x10 and 0x0D? are escaped with 0x10.
> POSTAMBLE: 0x10 0x03
>
> Message format:
> ===============
>
> 00: Target address
> 0x1B -> AxioImager A1/D1
> 0x19 -> AxioObserver Z1/D1
> 0x60 -> DefiniteFocus
> 0x50 -> Colibri
>
>
> 01: Source address (Micromanager hard-codes 0x11, MTB uses 0x10)
>
> # Starting from here is what Micromanager usually labels command[]
>
> [0]
> 02: Size of data block (How many bytes after the command group byte)
>
> [1]
> 03: Command class
>
> Query
> 0x15 -> Read command, multiple replies, see https://github.com/micro-manager/micro-manager/blob/88ab1ff051b548aafced024c46f902720eb9d553/DeviceAdapters/ZeissCAN29/ZeissHub.cpp#L684 )
> 0x18 -> Read command, single answer (see https://github.com/micro-manager/micro-manager/blob/88ab1ff051b548aafced024c46f902720eb9d553/DeviceAdapters/ZeissCAN29/ZeissHub.cpp#L625)
>
> 0x19 -> Write command, with response
> 0x1B -> Write command, no response
>
> Response
> 0x05 -> Multi-value response to a 0x18 command
>
> 0x08 -> Direct answers, response to 0x18
> 0x09 -> Last entry of a multi-value response to a 0x18 command
>
> 0x07 -> Events/unsolicited message
>
> [2]
> 04: Command group / Command Number
> BROADCAST = 0x01 ?
> BIOS = 0x02 # see https://github.com/micro-manager/micro-manager/blob/88ab1ff051b548aafced024c46f902720eb9d553/DeviceAdapters/ZeissCAN29/ZeissHub.cpp#L309
> DESCRIPTOR = 0x15
> SYSTEM = 0xA0
> CHANGER = 0xA1
> SERVO = 0xA2
> AXIS = 0xA3
>
> [3]
> 05: ProcessID, can be freely chosen. Typically between 0x10 and 0xfe
>
>
> [4]
> 06: SubID
>
> [5]
> 07: Device Id (often optional)
>
>
>
> ######
> # Device discovery (see ZeissHub::Initialize)
>
> Discover which type of microscope we use, by sending to different target addresses:
> - Send a Read command (0x18) to command group GET_VERSION (0x02) with subid 0x07.
> According to GetBiosInfo(), subid 0x05 is the BIOS version. 0x07 is probably application version.
>
> - Will get a version string reply.

I'm also looking to get USB working with an Observer under Linux, but I'm too busy right now...

Best
Matthias

On May 20, 2019 1:01:24 PM GMT+02:00, Wiktor Phillips <[hidden email]> wrote:
Thanks Matthias.

So from what I understand this may require doing some initial dev work on a Windows machine with the MTB SDK installed? I intend to interface with the microscope from Linux if possible.

Essentially, I should monitor the bus while issuing commands to capture their structure, then reconstruct the raw messages with a bespoke parser + serial interface in my language of choice?

Are the utilities to monitor the CAN bus included in the SDK or are they from a third party?

Thanks,

Wiktor

From: Matthias Blaicher <[hidden email]>
Sent: Monday, May 20, 2019 12:40 PM
To: Micro-Manager General; Gary Ruben via micro-manager-general
Subject: Re: [micro-manager-general] Question about Zeiss CAN29 messaging
 
The raw messages have a preamble and postamble and occurrences of 0x10 are escaped.

I have recently build my own library to talk to an observer and developed it against the Zeiss internal simulation. See also my previous message on this topic some days ago.

I found the messages to be well structured and the MTBMonitor and MTBTest very helpful to decode the messages and their format.

Best,
Matthias

On May 20, 2019 1:32:00 AM GMT+02:00, Gary Ruben via micro-manager-general <[hidden email]> wrote:
Hi Wiktor,

I'm wondering (speaking from total ignorance here), whether this is just a standard CAN bus (extended frame=29bit) interface:

Gary

On Mon, 20 May 2019 at 07:57, Wiktor Phillips <[hidden email]> wrote:
Hi,

Quick question: Is there any kind of documentation of the low-level/platform independent communications protocol for the CAN29 bus? Or am I stuck inferring the byte commands/responses from the implementation in the Zeiss CAN29 device adapter..?

Cheers,

Wiktor



När du skickar e-post till Karolinska Institutet (KI) innebär detta att KI kommer att behandla dina personuppgifter. Här finns information om hur KI behandlar personuppgifter. 


Sending email to Karolinska Institutet (KI) will result in KI processing your personal data. You can read more about KI’s processing of personal data here. 

_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general



--
Sent from my Android device with K-9 Mail. Please excuse my brevity.

_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general