HIDmanager and graceful device adapter fails

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

HIDmanager and graceful device adapter fails

James, John

Hello all,


I have my spinning-disk scope running really well in uM. However, currently I have to have two config files, one without and one with a simple halogen light source.

The light source uses the HIDmanager for communication, which works well when the box is switched on. However, if I have a config file that includes the device adapter but light isn't switched on, then uM errors and unloads everything (see corelog below). Is this expected behaviour? 

I was hoping that uM would keep calm and carry on, and just fail to load that light source, allowing me to have a unified config file for everything. Would a try/catch block in the HIDmanager code help mitigate this when the adaptor tries to open the port?


Any thoughts gratefully received! 

Thanks,

John


2019-01-02T15:51:58.362945 tid3840 [IFO,Core] Will initialize device Andor-AMH200-FOS
2019-01-02T15:51:58.362945 tid3840 [dbg,dev:Andor-AMH200-FOS] Opening HID device: Andor-AMH200-FOS
2019-01-02T15:51:58.362945 tid3840 [IFO,dev:Andor-AMH200-FOS] Failed to open HID device Andor-AMH200-FOS
2019-01-02T15:51:58.362945 tid3840 [ERR,Core:dev:Andor-AMH200-FOS] Error in device "Andor-AMH200-FOS": (Error message unavailable) (113)
2019-01-02T15:51:58.362945 tid3840 [IFO,Core] Unloading all devices after failure to load system configuration
2019-01-02T15:51:58.362945 tid3840 [dbg,Core] Will unload all devices
2019-01-02T15:51:58.362945 tid3840 [IFO,Core] Did unload all devices
2019-01-02T15:51:58.362945 tid3840 [IFO,Core] Now rethrowing original error from system configuration loading
2019-01-02T15:51:58.362945 tid3840 [IFO,App] Failed to load hardware configuation
                                   [       ] java.lang.Exception: Line 20: Property,Core,Initialize,1
                                   [       ] Error in device "Andor-AMH200-FOS": (Error message unavailable) (113)



_______________________________________________
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: HIDmanager and graceful device adapter fails

Stuurman, Nico
Hi John,


Great to hear from you (and Happy New Year!)

> I have my spinning-disk scope running really well in uM. However,
> currently I have to have two config files, one without and one with a
> simple halogen light source.
>
> The light source uses the HIDmanager for communication, which works
> well when the box is switched on. However, if I have a config file
> that includes the device adapter but light isn't switched on, then uM
> errors and unloads everything (see corelog below). Is this expected
> behaviour?
>

Regretfully yes.  The problem is that if one device fails in your
configuration, then all mentions of that device in your config need to
be dealt with gracefully, which is not straight forward. We never took
care of this issue, since it can be mitigated by having two
configuration files.

> I was hoping that uM would keep calm and carry on, and just fail to
> load that light source, allowing me to have a unified config file for
> everything. Would a try/catch block in the HIDmanager code help
> mitigate this when the adaptor tries to open the port?
>

Not really, because of the aforementioned problem.  The HIDManager
actually does not throw an exception, but returns an error (which is the
appropriate behavior).  The only way to fix this is to go through the
Core and User Interface code, and design a mechanism of dealing with
missing devices (which also needs to account for needed devices
malfunctioning and then warning the user).  Not an easy task!

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: HIDmanager and graceful device adapter fails

James, John
Hey Nico!

>Great to hear from you (and Happy New Year!)

Happy new year to you too! I hope you and the family are all well.

>> I have my spinning-disk scope running really well in uM. However,
>> currently I have to have two config files, one without and one with a
>> simple halogen light source.
>>
>> The light source uses the HIDmanager for communication, which works
>> well when the box is switched on. However, if I have a config file
>> that includes the device adapter but light isn't switched on, then uM
>> errors and unloads everything (see corelog below). Is this expected
>> behaviour?
>>
>
>Regretfully yes.  The problem is that if one device fails in your configuration,
>then all mentions of that device in your config need to be dealt with gracefully,
>which is not straight forward. We never took care of this issue, since it can be
>mitigated by having two configuration files.
>

OK, understood. It's good to hear the authoritative answer and that two configs is the way to go.
I was slightly worried the device adapter I wrote was flaky but I can rest easy...

>> I was hoping that uM would keep calm and carry on, and just fail to
>> load that light source, allowing me to have a unified config file for
>> everything. Would a try/catch block in the HIDmanager code help
>> mitigate this when the adaptor tries to open the port?
>>
>
>Not really, because of the aforementioned problem.  The HIDManager actually
>does not throw an exception, but returns an error (which is the appropriate
>behavior).  The only way to fix this is to go through the Core and User Interface
>code, and design a mechanism of dealing with missing devices (which also needs
>to account for needed devices malfunctioning and then warning the user).  Not
>an easy task!

Agreed! Thanks for your quick response too.
Cheers,
John


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