Micro-Manager & Matlab - DLL issues

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

Micro-Manager & Matlab - DLL issues

JB Lugagne
Hi all,

I would like to control MM via Matlab. I got all the devices on my
microscope to work with Micro-Manager fine, and just launching micro-manager
by itself works smoothly, the hardware configuration loads and I can control
all devices. However, when I try to launch it via Matlab by running:

>> addpath('C:\Program Files\Micro-Manager-2.0beta\')
>> S = StartMMStudio('C:\Program Files\Micro-Manager-2.0beta\','-setup');
[Restart Matlab]
>> addpath('C:\Program Files\Micro-Manager-2.0beta\')
>> S = StartMMStudio('C:\Program Files\Micro-Manager-2.0beta\');

The MM interface pops up, but when I try to launch my configuration file, I
get the following error dialog box:

Error: Failed to load hardware configuration
Line 9: Device, Ti2-E__0,NikonTi2,Ti2-E__0
Failed to load device "Ti2-E__0" from adapter module "NikonTi2" [Failed to
load device adapter "NikonTi2" [ Failed to load module "C:\Program
Files\Micro-Manager-2.0beta\mmgr_dal_NikonTi2.dll" [ The module, or a module
it depends upon, could not be found [Windows error: The specified module
could not be found.) ]]]

I've tried adding all subfolders under "C:\Program
Files\Micro-Manager-2.0beta\" to the matlab path (with the genpath()
function) and to place the micromanager folder under a path with no space,
no luck so far. I have followed the exact same procedure on a Nikon Ti-1
that we also have in the lab and had no problems with it.

I am using Matlab R2018b, MM 2.0-beta3_20190204, Windows 10 Pro version
1809.

I am probably completely missing something?

Thank you!
Jean-Baptiste.





--
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: Micro-Manager & Matlab - DLL issues

nanthony
I use Matlab with micromanager but have never had an issue like this (we also don't use the TI2 adapter though).

If I'm not mistaken, your matlab path won't matter in this case, the fact that you started micromanager from the correct directory should be enough.

Aside from the obvious task of making sure that C:\Program
Files\Micro-Manager-2.0beta\mmgr_dal_NikonTi2.dll actually exists, I would check the "Corelogs" folder to see if the logs tell you any more about this issue.

Another thing to try is to change to Micromanager Gamma. I think Beta is unmaintained.

--Nick

> On Mar 29, 2019, at 4:17 PM, JB Lugagne <[hidden email]> wrote:
>
> Hi all,
>
> I would like to control MM via Matlab. I got all the devices on my
> microscope to work with Micro-Manager fine, and just launching micro-manager
> by itself works smoothly, the hardware configuration loads and I can control
> all devices. However, when I try to launch it via Matlab by running:
>
>>> addpath('C:\Program Files\Micro-Manager-2.0beta\')
>>> S = StartMMStudio('C:\Program Files\Micro-Manager-2.0beta\','-setup');
> [Restart Matlab]
>>> addpath('C:\Program Files\Micro-Manager-2.0beta\')
>>> S = StartMMStudio('C:\Program Files\Micro-Manager-2.0beta\');
>
> The MM interface pops up, but when I try to launch my configuration file, I
> get the following error dialog box:
>
> Error: Failed to load hardware configuration
> Line 9: Device, Ti2-E__0,NikonTi2,Ti2-E__0
> Failed to load device "Ti2-E__0" from adapter module "NikonTi2" [Failed to
> load device adapter "NikonTi2" [ Failed to load module "C:\Program
> Files\Micro-Manager-2.0beta\mmgr_dal_NikonTi2.dll" [ The module, or a module
> it depends upon, could not be found [Windows error: The specified module
> could not be found.) ]]]
>
> I've tried adding all subfolders under "C:\Program
> Files\Micro-Manager-2.0beta\" to the matlab path (with the genpath()
> function) and to place the micromanager folder under a path with no space,
> no luck so far. I have followed the exact same procedure on a Nikon Ti-1
> that we also have in the lab and had no problems with it.
>
> I am using Matlab R2018b, MM 2.0-beta3_20190204, Windows 10 Pro version
> 1809.
>
> I am probably completely missing something?
>
> Thank you!
> Jean-Baptiste.
>
>
>
>
>
> --
> Sent from: https://urldefense.proofpoint.com/v2/url?u=http-3A__micro-2Dmanager.3463995.n2.nabble.com_&d=DwICAg&c=yHlS04HhBraes5BQ9ueu5zKhE7rtNXt_d012z2PA6ws&r=VOzx3RPoFiAnEjWZNVKllozJBWVHbhKhbit0V1WrFG2kkO7riI9lwQ0usSmhFkzq&m=EOPgn1QSjO5U2-cJjA6Ka_OJP5MuscYKt2LGxIXcToE&s=Zn5QB8ueHgiUscLDwRpRY5liSUyLnwHzZpX_rv5tPBo&e=
>
>
> _______________________________________________
> micro-manager-general mailing list
> [hidden email]
> https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.sourceforge.net_lists_listinfo_micro-2Dmanager-2Dgeneral&d=DwICAg&c=yHlS04HhBraes5BQ9ueu5zKhE7rtNXt_d012z2PA6ws&r=VOzx3RPoFiAnEjWZNVKllozJBWVHbhKhbit0V1WrFG2kkO7riI9lwQ0usSmhFkzq&m=EOPgn1QSjO5U2-cJjA6Ka_OJP5MuscYKt2LGxIXcToE&s=eIrcyrxEneWMzCGOnFS44RKYvNbvDGpGNy0sncObnqM&e=


_______________________________________________
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: Micro-Manager & Matlab - DLL issues

JB Lugagne
Thank you Nick for your reply.

I have kind of solved my issue: If I move to the micromanager install folder
in matlab:
>> cd 'C:\Program Files\Micro-Manager-2.0beta\'

And then launch MicroManager in Matlab from this location:
>> gui = StartMMStudio('C:\Program Files\Micro-Manager-2.0beta\');

Then it works!
It is kind of annoying that I have to move there and I'm not sure if I have
to stay in the MM folder after launch or if it is going to cause me problems
in the future but I guess for now it kind of solves my problem.

I should point out that any other configuration file that does not involve
the Ti2 adapter runs fine launching from anywhere else. (as long as I add
the MM install path)

Thanks!
Jean-Baptiste



--
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