test two different baud rates during DetectDevice()?

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

test two different baud rates during DetectDevice()?

Karl Bellve-3

Is it possible to test multiple baud rates in DetectDevice()?

In my case, 115200 and 19200.

I haven't been able to make it work. 


--
Kia ora,

Karl Bellvé

Kia ora, a common Kiwi salutation, means to wish somebody life and health in the Maori language


_______________________________________________
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: test two different baud rates during DetectDevice()?

JonD
Administrator
Hi Karl,


Karl Bellve-3 wrote
> Is it possible to test multiple baud rates in DetectDevice()?

The ASIStage device adapter does it, see
https://valelab4.ucsf.edu/trac/micromanager/browser/DeviceAdapters/ASIStage/ASIStage.cpp#L178

Jon



--
Sent from: http://micro-manager.3463995.n2.nabble.com/


_______________________________________________
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: test two different baud rates during DetectDevice()?

Karl Bellve-3


On Fri, Mar 15, 2019 at 12:36 PM JonD <[hidden email]> wrote:
Hi Karl,


Karl Bellve-3 wrote
> Is it possible to test multiple baud rates in DetectDevice()?

The ASIStage device adapter does it, see
https://valelab4.ucsf.edu/trac/micromanager/browser/DeviceAdapters/ASIStage/ASIStage.cpp#L178

Jon


Excellent! At a quick glance, I am not seeing much difference between what I am doing and what you did but yours works and mine doesn't :D


--
Kia ora,

Karl Bellvé

Kia ora, a common Kiwi salutation, means to wish somebody life and health in the Maori language


_______________________________________________
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: test two different baud rates during DetectDevice()?

Karl Bellve-3
On Fri, Mar 15, 2019 at 12:47 PM Karl Bellve <[hidden email]> wrote:

>
>
>
> On Fri, Mar 15, 2019 at 12:36 PM JonD <[hidden email]> wrote:
>>
>> Hi Karl,
>>
>>
>> Karl Bellve-3 wrote
>> > Is it possible to test multiple baud rates in DetectDevice()?
>>
>> The ASIStage device adapter does it, see
>> https://valelab4.ucsf.edu/trac/micromanager/browser/DeviceAdapters/ASIStage/ASIStage.cpp#L178
>>
>> Jon
>
>
>
> Excellent! At a quick glance, I am not seeing much difference between what I am doing and what you did but yours works and mine doesn't :D
>

There is something mysterious happening...

I would like to first check 115,200 and then 19,200 baud and that was
what I was doing in my code.  If I do it in that order, only the
device that works at 115,200 is seen by micromanager. The devices that
only work at 19,200 fail to be detected.

However, if I go from 19,200 to 115,200, all three devices are seen by
micromanager, but baud rate is set 19,200 for all three. They all
three seem to work inside micromanager at 19,200.

The device that is supposed to work at 115,200 is connected via USB.
The other two devices are connected through a USB<->serial adapter and
presumably all three have a FTDI chip internally.

I am going to have a beer.


--
Kia ora,

Karl Bellvé

Kia ora, a common Kiwi salutation, means to wish somebody life and
health in the Maori language


_______________________________________________
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: test two different baud rates during DetectDevice()?

JonD
Administrator
Karl Bellve-3 wrote

> I would like to first check 115,200 and then 19,200 baud and that was
> what I was doing in my code.  If I do it in that order, only the
> device that works at 115,200 is seen by micromanager. The devices that
> only work at 19,200 fail to be detected.
>
> However, if I go from 19,200 to 115,200, all three devices are seen by
> micromanager, but baud rate is set 19,200 for all three. They all
> three seem to work inside micromanager at 19,200.
>
> The device that is supposed to work at 115,200 is connected via USB.
> The other two devices are connected through a USB<->serial adapter and
> presumably all three have a FTDI chip internally.

Just brainstorming here, I know debugging these things can be maddening.

DetectDevice() works by sending a string on each serial port (and in this
case once for each possible baud rate) and listening for an appropriate
response from the device.  Could the string sent at the too-fast baud rate
could be putting the device in a bad state somehow?  And/or could the sent
sent at the too-slow baud rate lead to some sort of response that somehow is
"good enough" for DetectDevice()?

The more specific the string/response pair the better.  The code I pointed
you to could probably be improved because it only checks that the device
replies with something, not necessarily anything in particular.  In a
different device adapter I look for a very specific multi-character
response.

Jon







--
Sent from: http://micro-manager.3463995.n2.nabble.com/


_______________________________________________
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: test two different baud rates during DetectDevice()?

Karl Bellve-3
On Fri, Mar 15, 2019 at 3:56 PM JonD <[hidden email]> wrote:
>
<snip>
>
> The more specific the string/response pair the better.  The code I pointed
> you to could probably be improved because it only checks that the device
> replies with something, not necessarily anything in particular.  In a
> different device adapter I look for a very specific multi-character
> response.
>
> Jon

In pgFocus, I put a string in the firmware (BIG-pgFocus) that must be
returned to confirm identification. Works like a charm.

But, these devices (Cobolt lasers) I have limited choices but I do
send two different text string challenges looking at correct responses
for each. Both must be correct. The strings aren't the most
sophisticated but it should be ok.  I do all this in a separate
function called "ConfirmIdentity()" that returns true if the responses
are correct. I think that part works.

I will take another crack at it next week.

Have a good weekend.

--
Kia ora,

Karl Bellvé

Kia ora, a common Kiwi salutation, means to wish somebody life and
health in the Maori language


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