[micro-manager-general] Call additional scripts from within a script
Status: Beta
Brought to you by:
nicost
|
From: Then,Patrick // Leibniz-I. <Pat...@le...> - 2020-03-30 19:48:33
|
Hello,
I'm currently experimenting with scripting in Micro-Manager through use of the MMStartup.bsh script.
What I want to do is call MM from some external program and start an multi-dimensional acquisition.
This works so far by just putting everything directly into the startup script.
Ideally, however, I want to expand it a bit by splitting the script into several parts containing different actions to be performed, which I would previously manipulate externally, e.g. through a Python or Labview programm.
The problem is that even when I use the startup script to call a very simple script like the one below ( by 'run("..\\settings.bsh")';):
exposure=20;
mmc.setExposure(exposure);
I get an error
"Line 55: run-time error : Sourced file: ..\settings.bsh : Attempt to resolve method: setExposure() on undefined variable or class name: mmc"
Can somebody help me understand what's going wrong here?
If I run the script directly, it will do what I expect it to do - set the exposure to 20ms. Yet calling it from within another script will prevent it from recognizing the mmc class for some reason.
Do I need to import some class specifically? Or need to set some working directory?
Of course I could potentially just read settings from some external txt file, instead of splitting it into several scripts, if all else fails.
Also, I really appreciate the hard work behind MM and would like to thank the people involved with it, but are there any plans to expand/rework the documentation?
Especially advanced things like scripting and programming MM are documented poorly at times and rather disjointed.
Best regards,
Pat
|