Multiple serial ports for one device requires hub?

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

Multiple serial ports for one device requires hub?

Kaspar Emanuel

Hey all,

This week I got started writing some device adapters for the hardware included in the HiSeq 2000 and 2500 DNA sequencers. This work is funded by the ReSeq crowd funder. You can follow along on my branch here (I know I need to rebase this onto the mm2 branch — it’s all new device adapter folders though).

The machine controls the Z actuator using two serial ports for communication: one for sending commands and the other for receiving responses. Does writing a device adapter for this require a “hub” adapter? It seems a bit overkill but I couldn’t see a good way to have two serial ports in a single device adapter class. Am I overlooking something? Any tips at all appreciated as I am still quite new to Micromanager.

Cheers,

Kaspar



_______________________________________________
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: Multiple serial ports for one device requires hub?

Stuurman, Nico
Hi Kaspar,

On 6/10/2019 12:40 PM, Kaspar Emanuel wrote:
This week I got started writing some device adapters for the hardware included in the HiSeq 2000 and 2500 DNA sequencers. This work is funded by the ReSeq crowd funder. You can follow along on my branch here (I know I need to rebase this onto the mm2 branch — it’s all new device adapter folders though).

In that case, no need to rebase.  You can develop Device Adapters wherever you want, preferably by basing your code on the subversion repository.  Once you are ready, you can email me your files, and I can make you an account so that you can push your updated directly.

The machine controls the Z actuator using two serial ports for communication: one for sending commands and the other for receiving responses. Does writing a device adapter for this require a “hub” adapter? It seems a bit overkill but I couldn’t see a good way to have two serial ports in a single device adapter class. Am I overlooking something? Any tips at all appreciated as I am still quite new to Micromanager.


I don't think that you need a Hub device.  You can simply make two pre-initialization properties, one for each serial port.  You may want to name these differently than MM::g_Keyword_Port, but rather "Port-Receive", and "Port-Send", or whatever makes most sense to you.  Upon initialization, these properties will be set, and you should be able to open these serial ports and use the build-in cross-platform code to read and write to these ports.

Hope this helps!

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: Multiple serial ports for one device requires hub?

Kaspar Emanuel

Thanks Nico,

It seemed to me that not naming a port MM::g_Keyword_Port would result in it not being initialized properly. The baud rate and other settings wouldn’t appear when adding the device using the hardware configuration wizard. It also seemed to me that I couldn’t properly set the baud rate from my code or use the ports.

If you think it should be possible then I’ll give it another go and come back here if I get stuck again.

Cheers,

Kaspar

On 11/06/2019 06:55, Stuurman, Nico wrote:

Hi Kaspar,

On 6/10/2019 12:40 PM, Kaspar Emanuel wrote:
This week I got started writing some device adapters for the hardware included in the HiSeq 2000 and 2500 DNA sequencers. This work is funded by the ReSeq crowd funder. You can follow along on my branch here (I know I need to rebase this onto the mm2 branch — it’s all new device adapter folders though).

In that case, no need to rebase.  You can develop Device Adapters wherever you want, preferably by basing your code on the subversion repository.  Once you are ready, you can email me your files, and I can make you an account so that you can push your updated directly.

The machine controls the Z actuator using two serial ports for communication: one for sending commands and the other for receiving responses. Does writing a device adapter for this require a “hub” adapter? It seems a bit overkill but I couldn’t see a good way to have two serial ports in a single device adapter class. Am I overlooking something? Any tips at all appreciated as I am still quite new to Micromanager.


I don't think that you need a Hub device.  You can simply make two pre-initialization properties, one for each serial port.  You may want to name these differently than MM::g_Keyword_Port, but rather "Port-Receive", and "Port-Send", or whatever makes most sense to you.  Upon initialization, these properties will be set, and you should be able to open these serial ports and use the build-in cross-platform code to read and write to these ports.

Hope this helps!

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: Multiple serial ports for one device requires hub?

Stuurman, Nico
Hi Kaspar,

On 6/11/2019 1:34 AM, Kaspar Emanuel wrote:
It seemed to me that not naming a port MM::g_Keyword_Port would result in it not being initialized properly. The baud rate and other settings wouldn’t appear when adding the device using the hardware configuration wizard. It also seemed to me that I couldn’t properly set the baud rate from my code or use the ports.

If you think it should be possible then I’ll give it another go and come back here if I get stuck again.


No, you are absolutely right.  The hardware configuration wizard interprets the string variable MM::g_Keyword_Port in a special way, and only allows for a single port.  That was certainly a reasonable limitation, and I guess the day finally came that we had a device with two ports;) 

If you created a Hub, then the Hub could have one port, and the "daughter device" its own port.  That may indeed work, but it feels a bit ugly.  It may be nicer to introduce the concept of a second port (making the number of ports completely unlimited is probably more disruptive, and since it took 14 years for a device with 2 ports to pop up, a device with 3 may never appear;).  You can experiment first in your code, by creating a device with two ports and writing the config file for it by hand (or modify one that was created by the HCW).  If that works, I can look into adding a second port keyword and making sure that the HCW will work with that.  That will be in 2.0-gamma only though.

Best,

Nico



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