PreciseExcite over TCP/IP

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

PreciseExcite over TCP/IP

Martin Kielhorn
Hi Nico,
our PreciseExcite ceased working on the USB port.
However I was still able to control it via telnet over the ethernet connection.

So my question is: What is the best way to add TCP/IP support to the
existing device adapter?

I think I have to replace the following communication functions.
However I think I also have to write some initialization somewhere.

Is there already some portable networking class in MMCore or should I use the
normal sys/socket.h functions?

/////////////////////////////////////
//  Communications
/////////////////////////////////////


void Controller::Send(string cmd)
{
   int ret = SendSerialCommand(port_.c_str(), cmd.c_str(), carriage_return);
   if (ret!=DEVICE_OK)
      error_ = DEVICE_SERIAL_COMMAND_FAILED;
}


void Controller::ReceiveOneLine()
{
   buf_string_ = "";
   GetSerialAnswer(port_.c_str(), line_feed, buf_string_);

}

void Controller::Purge()
{
   int ret = PurgeComPort(port_.c_str());
   if (ret!=0)
      error_ = DEVICE_SERIAL_COMMAND_FAILED;
}



--
Martin Kielhorn
Randall Division of Cell & Molecular Biophysics
King's College London, New Hunt's House
Guy's Campus, London SE1 1UL, U.K.
tel: +44 (0) 207 848 6519,  fax: +44 (0) 207 848 6435

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
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: PreciseExcite over TCP/IP

Nico Stuurman
Administrator
Hi Martin,

> our PreciseExcite ceased working on the USB port.

??? Did the FTCI chip die?  I would assume that the Coolled will be  
happy to help fix that

> However I was still able to control it via telnet over the ethernet  
> connection.
>
> So my question is: What is the best way to add TCP/IP support to the
> existing device adapter?

Now that is an interesting question.  The most useful way would be to  
write a TCP/IP adapter very similar to our Serial Manager(s) and USB  
Manager.  This would be a generic adapter that will communicate over  
TCP/IP, but the Micro-Manager Core will not be able to distinguish it  
from any of the other communication adapters.  It will likely take a  
target IP address as a pre-initialization property.  The beauty of  
this approach is that it should make it possible to communicate with  
all devices that have a TCP/IP connector.

> I think I have to replace the following communication functions.

You could do that, but it would be a (ugly) hack.

> However I think I also have to write some initialization somewhere.
>
> Is there already some portable networking class in MMCore or should  
> I use the
> normal sys/socket.h functions?

There are no networking functions.  I would first check if Boost  
offers any networking abstractions, and use these to write such an  
adapter.

Best,

Nico


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
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: PreciseExcite over TCP/IP

Gordon Scott
Hi Nico, Martin,


> ??? Did the FTCI chip die?  I would assume that the Coolled will be  
> happy to help fix that

The chip appears OK as the unit enumerates OK, which requires both Rx
and Tx. There's a very small risk of something subtle in the chip, like
a failed fifo, but that seems very unlikely.

FWIW, It isn't an FTDI, it's a Maxim part (MAX3420) with an SPI
interface to the CPU.

One of our guys is going to King's College on Monday and if the
opportunity is useful will try to check the unit with his laptop.

ATB,
        Gordon.
--
Gordon Scott  Design Engineering
            Custom Interconnect Ltd.   http://www.cil-uk.co.uk
            CoolLED                    http://www.coolled.com
            Phone +44-1264-321321
            CIL House, Charlton Road, Andover SP10 3JL, UK

 


This message has been scanned by MailController - www.MailController.altohiway.com

This message and any attachments are strictly confidential and intended solely for the addressee. Any unauthorized use or disclosure, in whole or in part, is prohibited. E-mails are subject to possible alteration. Custom Interconnect Ltd and the sender decline any liability if this message and/or any attachments have been altered, changed or falsified. If you are not the intended recipient of this message, please delete it and notify the sender immediately.

Custom Interconnect Limited is a limited company registered in England and Wales. Registered number: 2026753. Registered office: CIL House 48 Charlton road Andover, Hampshire United Kingdom SP103JL.

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
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: PreciseExcite over TCP/IP

Martin Kielhorn
In reply to this post by Nico Stuurman
Hello,
I changed the Precise Excite Device Adapter to do the communication over TCP/IP instead of the serial port.

2009/10/7 Nico Stuurman <[hidden email]>
Hi Martin,

> our PreciseExcite ceased working on the USB port.

??? Did the FTCI chip die?  I would assume that the Coolled will be
happy to help fix that

I don't know yet. Maybe its just a software problem.


> However I was still able to control it via telnet over the ethernet
> connection.
>
> So my question is: What is the best way to add TCP/IP support to the
> existing device adapter?

Now that is an interesting question.  The most useful way would be to
write a TCP/IP adapter very similar to our Serial Manager(s) and USB
Manager.  This would be a generic adapter that will communicate over
TCP/IP, but the Micro-Manager Core will not be able to distinguish it
from any of the other communication adapters.  It will likely take a
target IP address as a pre-initialization property.  The beauty of
this approach is that it should make it possible to communicate with
all devices that have a TCP/IP connector.

> I think I have to replace the following communication functions.

You could do that, but it would be a (ugly) hack.

Okay I did that hack for now.
Its not perfect because e.g. upon the LAMS request my method
delivers one big string like this:
================================
establishing tcp/ip connection
connected socketfd=43
receiving ... buf='Hi
'
receiving ... no data, recv would block
don't know how to purge network
sending message = 'LAMS'
receiving ... buf='LAM:A: 470nm
LAM:B: 490nm
LAM:C: 565nm
XLAM_L=47
XLAM_R=66
LAM:D: 635nm
'
================================

But the parser doesn't recognize the separate modules.

Anyway I'm glad I can switch the lamp on and off now.


--
Martin Kielhorn
Randall Division of Cell & Molecular Biophysics
King's College London, New Hunt's House
Guy's Campus, London SE1 1UL, U.K.
tel: +44 (0) 207 848 6519,  fax: +44 (0) 207 848 6435

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general

PrecisExcite.cpp (20K) Download Attachment