Re: Matlab Configuration - CMMCore Object

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

Re: Matlab Configuration - CMMCore Object

kianago
In addition, I am also receiving the error "Undefined function or variable 'CMMCore'."

>> CMMCore core = new CMMCore();
Undefined function or variable 'CMMCore'.
 
>> import mmcorej.*;
>> mmc = CMMCore;
>> mmc.loadSystemConfiguration ('/Applications/Micro-Manager1.4/MMConfig_demo.cfg');
>> CMMCore core = new CMMCore();
No constructor 'mmcorej.CMMCore' with matching signature found.


On Tue, Jun 26, 2018 at 11:18 AM, Kiana Go <[hidden email]> wrote:
Hello,

  My name is Kiana Go and I am working on configuring matlab with micro-manager. However, I ran into the problem when creating the CMMCore object (Programming Guide):

            >> CMMCore core = new CMMCore();
                  No constructor 'mmcorej.CMMCore' with matching
                  signature found.
   
    However, I successfully created a Java Object of class MMCcore (Matlab Configuration - Step 6). Please reference the problem image below.
   
    I've looked up my problem but have yet to solve it. Based on some research, I suspect it is because I did not set up the Java environment as stated in the Matlab Configuration. It states:
  
     MMCore can be used in Matlab through its Java interface. After setting up the Java         
     environment as described above, MMCoreJ.jar must be added to Matlab Java class path 
     and the directory for the MMCore dynamic libraries (including MMCoreJ_wrap) must be added 
     to the system path.

     I believe I correctly added the MMCoreJ.jar to Matlab Java class path and the directory for the MMCore dynamic libraries as I followed the Matlab Configuration recipe for versions 1.4.6 and newer. However, I do not think I set up the Java environment. It says: "Any Java program (including Matlab) that wants to use the Micro-Manager API needs to put MMCoreJ.jar in its ClassPath." How do I do that as MMCoreJ.jar is in the Micro-Manager folder, which is a separate folder not in Matlab. Both Micro-Manager and Matlab is under Applications.

     Thanks so much in advance! I am lost and really appreciate any help. Thanks so much again!

Much Appreciated,
Kiana Go


--
Class of 2021



--
Class of 2021

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
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: Matlab Configuration - CMMCore Object

Kyle Douglass-2
Hi Kiana Go,

On Tue, Jun 26, 2018 at 8:49 PM, Kiana Go <[hidden email]> wrote:
In addition, I am also receiving the error "Undefined function or variable 'CMMCore'."

>> CMMCore core = new CMMCore();
Undefined function or variable 'CMMCore'.
 
>> import mmcorej.*;
>> mmc = CMMCore;
>> mmc.loadSystemConfiguration ('/Applications/Micro-Manager1.4/MMConfig_demo.cfg');
>> CMMCore core = new CMMCore();
No constructor 'mmcorej.CMMCore' with matching signature found.



The line `CMMCore core = new CMMCore();` is Java code, not MATLAB. Remove this line from your script and you can access the core through the `mmc` object which you already created with `mmc = CMMCore;`.

Write back if you're still having problems.

Cheers,
Kyle

P.S. You may also want to look at the file called StartMMStudio.m inside the Micro-Manager root directory. This script provides a common interface to the most commonly used Micro-Manager objects in MATLAB.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
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: Matlab Configuration - CMMCore Object

kianago
Hi Kyle,

   Thank you so much! That makes so much sense! In addition, I cannot find StartMMStudio.m. Is this for Windows? I am using Mac. In addition, I am following Matlab and the Micro-Manager GUI guide and stumbled upon the error below. However, after gui = MMStudio(false); , Micro-Manager pops up. Do I need gui.show; ? Can I just skip it? Thanks so much in advance!

>> cd '/Applications/Micro-Manager1.4'
>> import org.micromanager.MMStudio;
>> gui = MMStudio(false);
>> gui.show;
     Undefined function 'show' for input arguments of type 'org.micromanager.MMStudio'.
>> mmc = gui.getCore;
>> acq = gui.getAcquisitionEngine;

Much Appreciated,
Kiana Go

On Tue, Jun 26, 2018 at 11:06 PM, Kyle Douglass <[hidden email]> wrote:
Hi Kiana Go,

On Tue, Jun 26, 2018 at 8:49 PM, Kiana Go <[hidden email]> wrote:
In addition, I am also receiving the error "Undefined function or variable 'CMMCore'."

>> CMMCore core = new CMMCore();
Undefined function or variable 'CMMCore'.
 
>> import mmcorej.*;
>> mmc = CMMCore;
>> mmc.loadSystemConfiguration ('/Applications/Micro-Manager1.4/MMConfig_demo.cfg');
>> CMMCore core = new CMMCore();
No constructor 'mmcorej.CMMCore' with matching signature found.



The line `CMMCore core = new CMMCore();` is Java code, not MATLAB. Remove this line from your script and you can access the core through the `mmc` object which you already created with `mmc = CMMCore;`.

Write back if you're still having problems.

Cheers,
Kyle

P.S. You may also want to look at the file called StartMMStudio.m inside the Micro-Manager root directory. This script provides a common interface to the most commonly used Micro-Manager objects in MATLAB.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general




--
Class of 2021

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
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: Matlab Configuration - CMMCore Object

Kyle Douglass-2
Hi Kiana Go,

On Wed, Jun 27, 2018 at 8:03 PM, Kiana Go <[hidden email]> wrote:
Hi Kyle,

   Thank you so much! That makes so much sense! In addition, I cannot find StartMMStudio.m. Is this for Windows?

Whoops. Yes I think that this script is only included with the Windows nightly builds. You may need to download and install MM on a Windows computer and copy the script from the installation directory to your Mac. It's not necessary to use this script, but it does reduce some of the work you need to do when using Micro-Manager in MATLAB.
 
In addition, I am following Matlab and the Micro-Manager GUI guide and stumbled upon the error below. However, after gui = MMStudio(false); , Micro-Manager pops up. Do I need gui.show; ? Can I just skip it?

>> cd '/Applications/Micro-Manager1.4'
>> import org.micromanager.MMStudio;
>> gui = MMStudio(false);
>> gui.show;
     Undefined function 'show' for input arguments of type 'org.micromanager.MMStudio'.

I haven't used Micro-Manager in MATLAB for a while now, but I don't recall using this method. I would say that if everything else works without it, then by all means just skip the call to gui.show :)

Kyle


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
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: Matlab Configuration - CMMCore Object

kianago
Hello Kyle,

    Thanks so much Kyle for the help! I've been stuck on these problems for days but I've finally moved a step forward with your help! :) In addition, can you help me figure out if I need to import any other libraries or anything at all with my code below? Also, if you see anything wrong or peculiar with how I utilize the functions, please let me know. I am new to Matlab and Micro-Manager and am still trying to find my way around it. My goal is to use Matlab's interface with Micro-Manager to control the stage and microscope. I am aiming to automate the process of moving the stage and taking image acquisitions with the code below. 


// Install java core and gui object
    cd '/Applications/Micro-Manager-1.4'
    import org.micromanager.MMStudio;
    gui = MMStudio(false);
    mmc = gui.getCore;
    mmc.loadSystemConfiguration('/Applications/Micro-Manager1.4/MMConfig_automation.cfg')

// Load Devices - Stages and Camera
    mmc.loadDevice("XYStage", "Prior", "ProScanIII");
       throw (CMMError)
    mmc.loadDevice("ZStage", "Prior", "ProScanIII");
      throw (CMMError)
    mmc.loadDevice("Camera", "AndorSDK3", "Andor");
      throw (CMMError)

//Load Serial Ports if needed
     mmc.loadDevice("Port", "SerialManager", "COM1");

// Initialize Devices
     mmc.initializeAllDevices();

//for loops -> until reaches max position of stage (ie. the edge)
     for c = z_start :   increment value  : z_max
          for a = x_start : increment value  :  x_max
                for b = y_start :   increment value   :   y_max

                 //Moves stage ; a/b/c = coordinates
                 mmc.SetXYPosition("XYStage",a, b);
           throw (CMMError)
                 mmc.SetPosition("ZStage",c);
                   throw (CMMError)
            
                 //makes sure everything has stopped moving
                 mmc.waitForSystem();
                    throw (CMMError)
         
                 //takes image acquisition
                 mmc.snapImage();
                    throw (CMMError)
                
                //gets image acquired from snapImage
                img=mmc.getImage();
                    throw (CMMError)
                
                //save image with coordinates as name
               a/b/c = img
            
                //add image to Album 
               gui.addToAlbum(a/b/c);
                    throw (org.micromanager.utils.MMScriptException)
            end
      end 
end

gui.showMessage('Acquisitions completed ')


Thanks so much for the help again Kyle!!!


Much Appreciated,
Kiana Go


On Wed, Jun 27, 2018 at 11:55 PM, Kyle Douglass <[hidden email]> wrote:
Hi Kiana Go,

On Wed, Jun 27, 2018 at 8:03 PM, Kiana Go <[hidden email]> wrote:
Hi Kyle,

   Thank you so much! That makes so much sense! In addition, I cannot find StartMMStudio.m. Is this for Windows?

Whoops. Yes I think that this script is only included with the Windows nightly builds. You may need to download and install MM on a Windows computer and copy the script from the installation directory to your Mac. It's not necessary to use this script, but it does reduce some of the work you need to do when using Micro-Manager in MATLAB.
 
In addition, I am following Matlab and the Micro-Manager GUI guide and stumbled upon the error below. However, after gui = MMStudio(false); , Micro-Manager pops up. Do I need gui.show; ? Can I just skip it?

>> cd '/Applications/Micro-Manager1.4'
>> import org.micromanager.MMStudio;
>> gui = MMStudio(false);
>> gui.show;
     Undefined function 'show' for input arguments of type 'org.micromanager.MMStudio'.

I haven't used Micro-Manager in MATLAB for a while now, but I don't recall using this method. I would say that if everything else works without it, then by all means just skip the call to gui.show :)

Kyle


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general




--
Class of 2021

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
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: Matlab Configuration - CMMCore Object

kianago
Hi Kyle,

   I just realized / is a right division operator. I want to name the image using the X, Y, Z coordinates. Thus, instead of 

  a/b/c = img

  would 

  a,b,c = img

  work correctly and assign the coordinates as the name of the image?

Thanks!
Kiana Go

On Thu, Jun 28, 2018 at 2:05 PM, Kiana Go <[hidden email]> wrote:
Hello Kyle,

    Thanks so much Kyle for the help! I've been stuck on these problems for days but I've finally moved a step forward with your help! :) In addition, can you help me figure out if I need to import any other libraries or anything at all with my code below? Also, if you see anything wrong or peculiar with how I utilize the functions, please let me know. I am new to Matlab and Micro-Manager and am still trying to find my way around it. My goal is to use Matlab's interface with Micro-Manager to control the stage and microscope. I am aiming to automate the process of moving the stage and taking image acquisitions with the code below. 


// Install java core and gui object
    cd '/Applications/Micro-Manager-1.4'
    import org.micromanager.MMStudio;
    gui = MMStudio(false);
    mmc = gui.getCore;
    mmc.loadSystemConfiguration('/Applications/Micro-Manager1.4/MMConfig_automation.cfg')

// Load Devices - Stages and Camera
    mmc.loadDevice("XYStage", "Prior", "ProScanIII");
       throw (CMMError)
    mmc.loadDevice("ZStage", "Prior", "ProScanIII");
      throw (CMMError)
    mmc.loadDevice("Camera", "AndorSDK3", "Andor");
      throw (CMMError)

//Load Serial Ports if needed
     mmc.loadDevice("Port", "SerialManager", "COM1");

// Initialize Devices
     mmc.initializeAllDevices();

//for loops -> until reaches max position of stage (ie. the edge)
     for c = z_start :   increment value  : z_max
          for a = x_start : increment value  :  x_max
                for b = y_start :   increment value   :   y_max

                 //Moves stage ; a/b/c = coordinates
                 mmc.SetXYPosition("XYStage",a, b);
           throw (CMMError)
                 mmc.SetPosition("ZStage",c);
                   throw (CMMError)
            
                 //makes sure everything has stopped moving
                 mmc.waitForSystem();
                    throw (CMMError)
         
                 //takes image acquisition
                 mmc.snapImage();
                    throw (CMMError)
                
                //gets image acquired from snapImage
                img=mmc.getImage();
                    throw (CMMError)
                
                //save image with coordinates as name
               a/b/c = img
            
                //add image to Album 
               gui.addToAlbum(a/b/c);
                    throw (org.micromanager.utils.MMScriptException)
            end
      end 
end

gui.showMessage('Acquisitions completed ')


Thanks so much for the help again Kyle!!!


Much Appreciated,
Kiana Go


On Wed, Jun 27, 2018 at 11:55 PM, Kyle Douglass <[hidden email]> wrote:
Hi Kiana Go,

On Wed, Jun 27, 2018 at 8:03 PM, Kiana Go <[hidden email]> wrote:
Hi Kyle,

   Thank you so much! That makes so much sense! In addition, I cannot find StartMMStudio.m. Is this for Windows?

Whoops. Yes I think that this script is only included with the Windows nightly builds. You may need to download and install MM on a Windows computer and copy the script from the installation directory to your Mac. It's not necessary to use this script, but it does reduce some of the work you need to do when using Micro-Manager in MATLAB.
 
In addition, I am following Matlab and the Micro-Manager GUI guide and stumbled upon the error below. However, after gui = MMStudio(false); , Micro-Manager pops up. Do I need gui.show; ? Can I just skip it?

>> cd '/Applications/Micro-Manager1.4'
>> import org.micromanager.MMStudio;
>> gui = MMStudio(false);
>> gui.show;
     Undefined function 'show' for input arguments of type 'org.micromanager.MMStudio'.

I haven't used Micro-Manager in MATLAB for a while now, but I don't recall using this method. I would say that if everything else works without it, then by all means just skip the call to gui.show :)

Kyle


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general




--
Class of 2021



--
Class of 2021

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
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: Matlab Configuration - CMMCore Object

Kyle Douglass-2
In reply to this post by kianago
Hi Kiana Go,

On Thu, Jun 28, 2018 at 11:05 PM, Kiana Go <[hidden email]> wrote:
Hello Kyle,

    Thanks so much Kyle for the help! I've been stuck on these problems for days but I've finally moved a step forward with your help! :)

You're welcome!
 
In addition, can you help me figure out if I need to import any other libraries or anything at all with my code below? Also, if you see anything wrong or peculiar with how I utilize the functions, please let me know.
               
                //gets image acquired from snapImage
                img=mmc.getImage();
                    throw (CMMError)
                
                //save image with coordinates as name
               a/b/c = img
            
                //add image to Album 
               gui.addToAlbum(a/b/c);
                    throw (org.micromanager.utils.MMScriptException)

It's a bit difficult to offer advice about a script over e-mail. It is, however, fairly routine to help debug any specific error messages that are produced by the script. Are there are any error messages you get when you run the script? If yes, which lines cause the problem?

I think you're right that the line `a/b/c = img` is most likely going to raise an error. My suggestion would be to just run the script as it is and make note of the first error message that you encounter. Fix it, and then rerun the script to see whether you get any new errors further along. If you can't fix it, then write back the mailing list with the code and the error message and we'll see what we can do ;) The error messages should help guide you along the way to finding your solution.

Good luck!
Kyle

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
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: Matlab Configuration - CMMCore Object

kianago
Hi Kyle,

    Sounds like an excellent plan! Thank you so much!!!

Much Appreciated,
Kiana Go

On Thu, Jun 28, 2018 at 11:52 PM, Kyle Douglass <[hidden email]> wrote:
Hi Kiana Go,

On Thu, Jun 28, 2018 at 11:05 PM, Kiana Go <[hidden email]> wrote:
Hello Kyle,

    Thanks so much Kyle for the help! I've been stuck on these problems for days but I've finally moved a step forward with your help! :)

You're welcome!
 
In addition, can you help me figure out if I need to import any other libraries or anything at all with my code below? Also, if you see anything wrong or peculiar with how I utilize the functions, please let me know.
               
                //gets image acquired from snapImage
                img=mmc.getImage();
                    throw (CMMError)
                
                //save image with coordinates as name
               a/b/c = img
            
                //add image to Album 
               gui.addToAlbum(a/b/c);
                    throw (org.micromanager.utils.MMScriptException)

It's a bit difficult to offer advice about a script over e-mail. It is, however, fairly routine to help debug any specific error messages that are produced by the script. Are there are any error messages you get when you run the script? If yes, which lines cause the problem?

I think you're right that the line `a/b/c = img` is most likely going to raise an error. My suggestion would be to just run the script as it is and make note of the first error message that you encounter. Fix it, and then rerun the script to see whether you get any new errors further along. If you can't fix it, then write back the mailing list with the code and the error message and we'll see what we can do ;) The error messages should help guide you along the way to finding your solution.

Good luck!
Kyle

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general




--
Class of 2021

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
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: Matlab Configuration - CMMCore Object

kianago
Hi Kyle,

   Quick question. I am using a XYStage Prior and want to load it.  Is the following correct?  The stage is Prior and its corresponding adapter is the ProScanIII. 
 
mmc.loadDevice("XYStage", "Prior", "ProScanIII");
       throw (CMMError)

  or should it be like:

mmc.loadDevice("XYStage", "Prior", "Prior");
       throw (CMMError)

Much Appreciated,
Kiana Go

On Fri, Jun 29, 2018 at 11:26 AM, Kiana Go <[hidden email]> wrote:
Hi Kyle,

    Sounds like an excellent plan! Thank you so much!!!

Much Appreciated,
Kiana Go

On Thu, Jun 28, 2018 at 11:52 PM, Kyle Douglass <[hidden email]> wrote:
Hi Kiana Go,

On Thu, Jun 28, 2018 at 11:05 PM, Kiana Go <[hidden email]> wrote:
Hello Kyle,

    Thanks so much Kyle for the help! I've been stuck on these problems for days but I've finally moved a step forward with your help! :)

You're welcome!
 
In addition, can you help me figure out if I need to import any other libraries or anything at all with my code below? Also, if you see anything wrong or peculiar with how I utilize the functions, please let me know.
               
                //gets image acquired from snapImage
                img=mmc.getImage();
                    throw (CMMError)
                
                //save image with coordinates as name
               a/b/c = img
            
                //add image to Album 
               gui.addToAlbum(a/b/c);
                    throw (org.micromanager.utils.MMScriptException)

It's a bit difficult to offer advice about a script over e-mail. It is, however, fairly routine to help debug any specific error messages that are produced by the script. Are there are any error messages you get when you run the script? If yes, which lines cause the problem?

I think you're right that the line `a/b/c = img` is most likely going to raise an error. My suggestion would be to just run the script as it is and make note of the first error message that you encounter. Fix it, and then rerun the script to see whether you get any new errors further along. If you can't fix it, then write back the mailing list with the code and the error message and we'll see what we can do ;) The error messages should help guide you along the way to finding your solution.

Good luck!
Kyle

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general




--
Class of 2021



--
Class of 2021

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
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: Matlab Configuration - CMMCore Object

Kyle Douglass-2
Hi Kiana Go,


On Fri, Jun 29, 2018 at 8:51 PM, Kiana Go <[hidden email]> wrote:
Hi Kyle,

   Quick question. I am using a XYStage Prior and want to load it.  Is the following correct?  The stage is Prior and its corresponding adapter is the ProScanIII. 
 
mmc.loadDevice("XYStage", "Prior", "ProScanIII");
       throw (CMMError)

  or should it be like:

mmc.loadDevice("XYStage", "Prior", "Prior");
       throw (CMMError)



I don't currently have Micro-Manager installed on the machine in front of me, but I believe you can find an explanation in the Micro-Manager documentation here: https://micro-manager.org/wiki/Micro-Manager_Programming%20Guide#Loading_devices (Keep in mind that this is Java code, but the arguments to loadDevice() should be the same.)

In particular:

We can use it like this:

CMMCore core = new CMMCore();
core.loadDevice("Camera", "DemoCamera", "DCam");

The command above has three parameters: label, library and name. Device label is the name we want to assign to a specific device. It is completely arbitrary and entirely up to us. We chose to call our camera simply "Camera". "DemoCamera" is the dynamic library name where the adapter resides. "DCam" is the name of the device adapter we want to load.

I hope this helps!
Kyle


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
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: Matlab Configuration - CMMCore Object

kianago
Hi Kyle,

   So I finally ran the code in Matlab. However, I am getting the following error:

>>import mmcorej.*;
>> mmc= CMMCore;
>> mmc.loadDevice("Port", "SerialManager", "COM5");
>> mmc.initializeDevice("Port");
>> mmc.loadDevice("ZStage", "Prior", "ZStage");

>> mmc.initializeDevice("ZStage");
Java exception occurred:
java.lang.Exception: Error in device "ZStage": Serial command failed.  Is the device connected
to the serial port? (14)

at mmcorej.MMCoreJJNI.CMMCore_initializeDevice(Native Method)

at mmcorej.CMMCore.initializeDevice(CMMCore.java:305)

 
>> mmc.setPosition("ZStage", 10);
Java exception occurred:
java.lang.Exception: Error in device "ZStage": Unknown error in the device (1)

at mmcorej.MMCoreJJNI.CMMCore_setPosition__SWIG_0(Native Method)

at mmcorej.CMMCore.setPosition(CMMCore.java:1161)


    The ZStage is connected to serial port COM5. The ZStage also works fine through Micro-Manager and its own software controller. Thus, it is connected. There seems to be a problem with matlab's interface with Micro-Manager to recognize and configure the ZStage. 
    For reference, I am using Prior's ZStage. I am also using the ProScan III controller. Not sure why the ZStage will not initialize and move when given the appropriate methods. 

  Any help would be genuinely appreciated!

Much Appreciated,
Kiana 

On Tue, Jul 3, 2018 at 12:00 AM, Kyle Douglass <[hidden email]> wrote:
Hi Kiana Go,


On Fri, Jun 29, 2018 at 8:51 PM, Kiana Go <[hidden email]> wrote:
Hi Kyle,

   Quick question. I am using a XYStage Prior and want to load it.  Is the following correct?  The stage is Prior and its corresponding adapter is the ProScanIII. 
 
mmc.loadDevice("XYStage", "Prior", "ProScanIII");
       throw (CMMError)

  or should it be like:

mmc.loadDevice("XYStage", "Prior", "Prior");
       throw (CMMError)



I don't currently have Micro-Manager installed on the machine in front of me, but I believe you can find an explanation in the Micro-Manager documentation here: https://micro-manager.org/wiki/Micro-Manager_Programming%20Guide#Loading_devices (Keep in mind that this is Java code, but the arguments to loadDevice() should be the same.)

In particular:

We can use it like this:

CMMCore core = new CMMCore();
core.loadDevice("Camera", "DemoCamera", "DCam");

The command above has three parameters: label, library and name. Device label is the name we want to assign to a specific device. It is completely arbitrary and entirely up to us. We chose to call our camera simply "Camera". "DemoCamera" is the dynamic library name where the adapter resides. "DCam" is the name of the device adapter we want to load.

I hope this helps!
Kyle


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general




--
Class of 2021

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general

Screen Shot 2018-07-12 at 4.55.38 PM.png (374K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Matlab Configuration - CMMCore Object

kianago
Hi Kyle,

   So I finally ran the code in Matlab. However, I am getting the following error:

>>import mmcorej.*;
>> mmc= CMMCore;
>> mmc.loadDevice("Port", "SerialManager", "COM5");
>> mmc.initializeDevice("Port");
>> mmc.loadDevice("ZStage", "Prior", "ZStage");

>> mmc.initializeDevice("ZStage");
Java exception occurred:
java.lang.Exception: Error in device "ZStage": Serial command failed.  Is the device connected
to the serial port? (14)

at mmcorej.MMCoreJJNI.CMMCore_initializeDevice(Native Method)

at mmcorej.CMMCore.initializeDevice(CMMCore.java:305)

 
>> mmc.setPosition("ZStage", 10);
Java exception occurred:
java.lang.Exception: Error in device "ZStage": Unknown error in the device (1)

at mmcorej.MMCoreJJNI.CMMCore_setPosition__SWIG_0(Native Method)

at mmcorej.CMMCore.setPosition(CMMCore.java:1161)


    The ZStage is connected to serial port COM5. The ZStage also works fine through Micro-Manager and its own software controller. Thus, it is connected. There seems to be a problem with matlab's interface with Micro-Manager to recognize and configure the ZStage. 
    For reference, I am using Prior's ZStage. I am also using the ProScan III controller. Not sure why the ZStage will not initialize and move when given the appropriate methods. 

  Any help would be genuinely appreciated!

Much Appreciated,
Kiana 



On Thu, Jul 12, 2018 at 5:02 PM, Kiana Go <[hidden email]> wrote:
Hi Kyle,

   So I finally ran the code in Matlab. However, I am getting the following error:

>>import mmcorej.*;
>> mmc= CMMCore;
>> mmc.loadDevice("Port", "SerialManager", "COM5");
>> mmc.initializeDevice("Port");
>> mmc.loadDevice("ZStage", "Prior", "ZStage");

>> mmc.initializeDevice("ZStage");
Java exception occurred:
java.lang.Exception: Error in device "ZStage": Serial command failed.  Is the device connected
to the serial port? (14)

at mmcorej.MMCoreJJNI.CMMCore_initializeDevice(Native Method)

at mmcorej.CMMCore.initializeDevice(CMMCore.java:305)

 
>> mmc.setPosition("ZStage", 10);
Java exception occurred:
java.lang.Exception: Error in device "ZStage": Unknown error in the device (1)

at mmcorej.MMCoreJJNI.CMMCore_setPosition__SWIG_0(Native Method)

at mmcorej.CMMCore.setPosition(CMMCore.java:1161)


    The ZStage is connected to serial port COM5. The ZStage also works fine through Micro-Manager and its own software controller. Thus, it is connected. There seems to be a problem with matlab's interface with Micro-Manager to recognize and configure the ZStage. 
    For reference, I am using Prior's ZStage. I am also using the ProScan III controller. Not sure why the ZStage will not initialize and move when given the appropriate methods. 

  Any help would be genuinely appreciated!

Much Appreciated,
Kiana 

On Tue, Jul 3, 2018 at 12:00 AM, Kyle Douglass <[hidden email]> wrote:
Hi Kiana Go,


On Fri, Jun 29, 2018 at 8:51 PM, Kiana Go <[hidden email]> wrote:
Hi Kyle,

   Quick question. I am using a XYStage Prior and want to load it.  Is the following correct?  The stage is Prior and its corresponding adapter is the ProScanIII. 
 
mmc.loadDevice("XYStage", "Prior", "ProScanIII");
       throw (CMMError)

  or should it be like:

mmc.loadDevice("XYStage", "Prior", "Prior");
       throw (CMMError)



I don't currently have Micro-Manager installed on the machine in front of me, but I believe you can find an explanation in the Micro-Manager documentation here: https://micro-manager.org/wiki/Micro-Manager_Programming%20Guide#Loading_devices (Keep in mind that this is Java code, but the arguments to loadDevice() should be the same.)

In particular:

We can use it like this:

CMMCore core = new CMMCore();
core.loadDevice("Camera", "DemoCamera", "DCam");

The command above has three parameters: label, library and name. Device label is the name we want to assign to a specific device. It is completely arbitrary and entirely up to us. We chose to call our camera simply "Camera". "DemoCamera" is the dynamic library name where the adapter resides. "DCam" is the name of the device adapter we want to load.

I hope this helps!
Kyle


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general




--
Class of 2021



--
Class of 2021

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
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: Matlab Configuration - CMMCore Object

Kyle Douglass-2
In reply to this post by kianago
Hi Kiana Go,


On Fri, Jul 13, 2018 at 2:02 AM, Kiana Go <[hidden email]> wrote: 
>>import mmcorej.*;
>> mmc= CMMCore;
>> mmc.loadDevice("Port", "SerialManager", "COM5");
>> mmc.initializeDevice("Port");
>> mmc.loadDevice("ZStage", "Prior", "ZStage");

    The ZStage is connected to serial port COM5. The ZStage also works fine through Micro-Manager and its own software controller. Thus, it is connected. There seems to be a problem with matlab's interface with Micro-Manager to recognize and configure the ZStage. 
    For reference, I am using Prior's ZStage. I am also using the ProScan III controller. Not sure why the ZStage will not initialize and move when given the appropriate methods. 

I'm sorry for the late reply; I've been a bit busy lately.

I do not have much experience with loading devices from MATLAB, so I might be wrong about this. At first glance, it looks like you're trying to assign two devices to COM5, which to me seems like the most likely source of the problem.

I don't think that you need to assign a SerialManager device to COM5, since this is a device adapter for general serial port communications. I think you're getting an error when you run the line mmc.loadDevice("ZStage", "Prior", "ZStage"); because the SerialManager is already assigned to the same COM port.

When you tested this in the Micro-Manager GUI, did you also add a SerialManager device adapter to your configuration at COM5, or only the Prior stage?

Best regards,
Kyle

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
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: Matlab Configuration - CMMCore Object

kianago
Hi Kyle,

   It's fine! I got the stage to load! However, now, the camera will not load. However, I was able to load the XY Stage, Z Stage, and Andor SDK3 camera perfectly into a configuration file. However, I used the XYStage, ZStage, and Camera through matlab. Now when I try to reload the same configuration, the camera will not load. For matlab, all I did was move the stage and use: snapImage, img= getImage, and reshape(img, 2048, 2048). The following is the core log and includes the error:

2018-07-20T16:40:15.168729 tid10480 [IFO,App] User has been prompted to reproduce problem
2018-07-20T16:40:21.798640 tid10480 [dbg,Core] Will set Core property: Initialize = 0
2018-07-20T16:40:21.798640 tid10480 [dbg,Core] Will unload all devices
2018-07-20T16:40:21.798640 tid10480 [IFO,Core] Did unload all devices
2018-07-20T16:40:21.798640 tid10480 [dbg,App] Notification for Device: Core Property: Initialize changed to value: 0 ignored since the system is still loading
2018-07-20T16:40:21.798640 tid10480 [dbg,Core] Did set Core property: Initialize = 0
2018-07-20T16:40:21.798640 tid10480 [dbg,Core] Will load device COM5 from SerialManager
2018-07-20T16:40:21.798640 tid10480 [IFO,Core] Did load device COM5 from SerialManager; label = COM5
2018-07-20T16:40:21.798640 tid10480 [dbg,Core] Will load device Andor sCMOS Camera from AndorSDK3
2018-07-20T16:40:21.826639 tid10480 [IFO,Core] Did load device Andor sCMOS Camera from AndorSDK3; label = Camera
2018-07-20T16:40:21.826639 tid10480 [dbg,Core] Will load device XYStage from Prior
2018-07-20T16:40:21.828639 tid10480 [IFO,Core] Did load device XYStage from Prior; label = XYStage
2018-07-20T16:40:21.828639 tid10480 [dbg,Core] Will load device ZStage from Prior
2018-07-20T16:40:21.828639 tid10480 [IFO,Core] Did load device ZStage from Prior; label = ZStage
2018-07-20T16:40:21.828639 tid10480 [dbg,Core:dev:XYStage] Will set property "Port" to "COM5"
2018-07-20T16:40:21.828639 tid10480 [dbg,Core:dev:XYStage] Did set property "Port" to "COM5"
2018-07-20T16:40:21.828639 tid10480 [dbg,Core:dev:ZStage] Will set property "Port" to "COM5"
2018-07-20T16:40:21.828639 tid10480 [dbg,Core:dev:ZStage] Did set property "Port" to "COM5"
2018-07-20T16:40:21.828639 tid10480 [dbg,Core:dev:COM5] Will set property "AnswerTimeout" to "500.0000"
2018-07-20T16:40:21.828639 tid10480 [dbg,Core:dev:COM5] Did set property "AnswerTimeout" to "500.0000"
2018-07-20T16:40:21.828639 tid10480 [dbg,Core:dev:COM5] Will set property "BaudRate" to "9600"
2018-07-20T16:40:21.828639 tid10480 [dbg,Core:dev:COM5] Did set property "BaudRate" to "9600"
2018-07-20T16:40:21.828639 tid10480 [dbg,Core:dev:COM5] Will set property "DataBits" to "8"
2018-07-20T16:40:21.828639 tid10480 [dbg,Core:dev:COM5] Did set property "DataBits" to "8"
2018-07-20T16:40:21.828639 tid10480 [dbg,Core:dev:COM5] Will set property "DelayBetweenCharsMs" to "0.0000"
2018-07-20T16:40:21.828639 tid10480 [dbg,Core:dev:COM5] Did set property "DelayBetweenCharsMs" to "0.0000"
2018-07-20T16:40:21.828639 tid10480 [dbg,Core:dev:COM5] Will set property "Handshaking" to "Off"
2018-07-20T16:40:21.828639 tid10480 [dbg,Core:dev:COM5] Did set property "Handshaking" to "Off"
2018-07-20T16:40:21.828639 tid10480 [dbg,Core:dev:COM5] Will set property "Parity" to "None"
2018-07-20T16:40:21.828639 tid10480 [dbg,Core:dev:COM5] Did set property "Parity" to "None"
2018-07-20T16:40:21.828639 tid10480 [dbg,Core:dev:COM5] Will set property "StopBits" to "1"
2018-07-20T16:40:21.828639 tid10480 [dbg,Core:dev:COM5] Did set property "StopBits" to "1"
2018-07-20T16:40:21.828639 tid10480 [dbg,Core:dev:COM5] Will set property "Verbose" to "1"
2018-07-20T16:40:21.828639 tid10480 [dbg,Core:dev:COM5] Did set property "Verbose" to "1"
2018-07-20T16:40:21.828639 tid10480 [dbg,Core] Will set Core property: Initialize = 1
2018-07-20T16:40:21.828639 tid10480 [IFO,Core] Will initialize 4 devices
2018-07-20T16:40:21.828639 tid10480 [IFO,Core] Will initialize device COM5
2018-07-20T16:40:21.830639 tid10480 [dbg,dev:COM5] Attempting to set flow of COM5 to none
2018-07-20T16:40:21.832639 tid10480 [dbg,dev:COM5] Attempting to set parity of COM5 to none
2018-07-20T16:40:21.832639 tid10480 [dbg,dev:COM5] Attempting to set stopBits of COM5 to 1
2018-07-20T16:40:21.834639 tid10480 [dbg,dev:COM5] Attempting to set dataBits of COM5 to 8
2018-07-20T16:40:21.834639 tid10480 [IFO,Core] Did initialize device COM5
2018-07-20T16:40:21.834639 tid10480 [IFO,Core] Will initialize device Camera
2018-07-20T16:40:21.838639 tid10480 [IFO,dev:Camera] Exception[AT_ERR_CONNECTION] thrown: Error Connecting / Disconnecting Hardware
2018-07-20T16:40:21.838639 tid10480 [ERR,Core:dev:Camera] Error in device "Camera": Unable to communicate with the device. (35)
2018-07-20T16:40:21.838639 tid10480 [IFO,Core] Unloading all devices after failure to load system configuration
2018-07-20T16:40:21.838639 tid10480 [dbg,Core] Will unload all devices
2018-07-20T16:40:22.042639 tid10480 [IFO,Core] Did unload all devices
2018-07-20T16:40:22.042639 tid10480 [IFO,Core] Now rethrowing original error from system configuration loading
2018-07-20T16:40:22.044639 tid10480 [IFO,App] Failed to load hardware configuation
                                    [       ] java.lang.Exception: Line 29: Property,Core,Initialize,1
                                    [       ] Error in device "Camera": Unable to communicate with the device. (35)
                                    [       ] 
                                    [       ]  in Thread[AWT-EventQueue-0,6,main]
                                    [       ]   at mmcorej.MMCoreJJNI.CMMCore_loadSystemConfiguration(Native Method)
                                    [       ]   at mmcorej.CMMCore.loadSystemConfiguration(CMMCore.java:366)
                                    [       ]   at org.micromanager.MMStudio.loadSystemConfiguration(MMStudio.java:1730)
                                    [       ]   at org.micromanager.MMStudio.setSysConfigFile(MMStudio.java:962)
                                    [       ]   at org.micromanager.menus.ToolsMenu.loadConfiguration(ToolsMenu.java:227)
                                    [       ]   at org.micromanager.menus.ToolsMenu.access$400(ToolsMenu.java:28)
                                    [       ]   at org.micromanager.menus.ToolsMenu$11.run(ToolsMenu.java:163)
                                    [       ]   at org.micromanager.utils.GUIUtils$3.actionPerformed(GUIUtils.java:361)
                                    [       ]   at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
                                    [       ]   at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
                                    [       ]   at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
                                    [       ]   at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
                                    [       ]   at javax.swing.AbstractButton.doClick(Unknown Source)
                                    [       ]   at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
                                    [       ]   at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
                                    [       ]   at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
                                    [       ]   at java.awt.Component.processMouseEvent(Unknown Source)
                                    [       ]   at javax.swing.JComponent.processMouseEvent(Unknown Source)
                                    [       ]   at java.awt.Component.processEvent(Unknown Source)
                                    [       ]   at java.awt.Container.processEvent(Unknown Source)
                                    [       ]   at java.awt.Component.dispatchEventImpl(Unknown Source)
                                    [       ]   at java.awt.Container.dispatchEventImpl(Unknown Source)
                                    [       ]   at java.awt.Component.dispatchEvent(Unknown Source)
                                    [       ]   at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
                                    [       ]   at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
                                    [       ]   at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
                                    [       ]   at java.awt.Container.dispatchEventImpl(Unknown Source)
                                    [       ]   at java.awt.Window.dispatchEventImpl(Unknown Source)
                                    [       ]   at java.awt.Component.dispatchEvent(Unknown Source)
                                    [       ]   at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
                                    [       ]   at java.awt.EventQueue.access$000(Unknown Source)
                                    [       ]   at java.awt.EventQueue$1.run(Unknown Source)
                                    [       ]   at java.awt.EventQueue$1.run(Unknown Source)
                                    [       ]   at java.security.AccessController.doPrivileged(Native Method)
                                    [       ]   at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
                                    [       ]   at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
                                    [       ]   at java.awt.EventQueue$2.run(Unknown Source)
                                    [       ]   at java.awt.EventQueue$2.run(Unknown Source)
                                    [       ]   at java.security.AccessController.doPrivileged(Native Method)
                                    [       ]   at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
                                    [       ]   at java.awt.EventQueue.dispatchEvent(Unknown Source)
                                    [       ]   at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
                                    [       ]   at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
                                    [       ]   at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
                                    [       ]   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
                                    [       ]   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
                                    [       ]   at java.awt.EventDispatchThread.run(Unknown Source)
2018-07-20T16:40:23.326639 tid10480 [IFO,App] Updating GUI; config pad = true; from cache = false
2018-07-20T16:40:23.326639 tid10480 [IFO,App] Rebuilding config group table
2018-07-20T16:40:23.326639 tid10480 [IFO,App] Finished rebuilding config group table
2018-07-20T16:40:23.326639 tid10480 [dbg,Core] Will update system state cache
2018-07-20T16:40:23.326639 tid10480 [IFO,Core] Did update system state cache
2018-07-20T16:40:23.328638 tid10480 [IFO,App] Finished updating GUI
2018-07-20T16:40:23.328638 tid10480 [IFO,App] Updating GUI; config pad = true; from cache = false
2018-07-20T16:40:23.328638 tid10480 [IFO,App] Rebuilding config group table
2018-07-20T16:40:23.328638 tid10480 [IFO,App] Finished rebuilding config group table
2018-07-20T16:40:23.328638 tid10480 [dbg,Core] Will update system state cache
2018-07-20T16:40:23.328638 tid10480 [IFO,Core] Did update system state cache
2018-07-20T16:40:23.330638 tid10480 [IFO,App] Finished updating GUI
2018-07-20T16:40:25.956635 tid10480 [IFO,App] User has stopped log capture
2018-07-20T16:40:25.960635 tid3636 [IFO,App] ***** BEGIN Problem Report System Info (incremental) *****
2018-07-20T16:40:25.960635 tid3636 [IFO,App] Total physical memory (caveats apply if JVM is 32-bit): 68630441984 (63.9 GiB)
                                   [       ] Committed virtual memory size: 1246478336 (1.2 GiB)
                                   [       ] Free physical memory (may be meaningless if JVM is 32-bit): 63417466880 (59.1 GiB)
2018-07-20T16:40:25.960635 tid3636 [IFO,App] JVM heap memory usage: used = 139647464 (133.2 MiB); committed = 1027735552 (980.1 MiB); max = 1864171520 (1.7 GiB)
                                   [       ] JVM non-heap memory usage: used = 59994976 (57.2 MiB); committed = 60489728 (57.7 MiB); max = 136314880 (130.0 MiB)
2018-07-20T16:40:25.960635 tid3636 [IFO,App] All Java threads:
                                   [       ]   id 2 ("Reference Handler"): WAITING
                                   [       ]   id 3 ("Finalizer"): WAITING
                                   [       ]   id 4 ("Signal Dispatcher"): RUNNABLE
                                   [       ]   id 5 ("Attach Listener"): RUNNABLE
                                   [       ]   id 10 ("Java2D Disposer"): WAITING
                                   [       ]   id 11 ("AWT-Shutdown"): WAITING
                                   [       ]   id 12 ("AWT-Windows"): RUNNABLE
                                   [       ]   id 15 ("AWT-EventQueue-0"): RUNNABLE
                                   [       ]   id 18 ("DestroyJavaVM"): RUNNABLE
                                   [       ]   id 20 ("TimerQueue"): TIMED_WAITING
                                   [       ]   id 21 ("EDTHangLogger timer"): TIMED_WAITING
                                   [       ]   id 23 ("D3D Screen Updater"): TIMED_WAITING
                                   [       ]   id 24 ("Thread-5"): TIMED_WAITING
                                   [       ]   id 25 ("BeanShell interpreter"): TIMED_WAITING
                                   [       ]   id 30 ("SwingWorker-pool-4-thread-1"): WAITING
                                   [       ]   id 33 ("Swing-Shell"): WAITING
                                   [       ]   id 39 ("SwingWorker-pool-4-thread-2"): RUNNABLE
                                   [       ] (End all Java threads)
2018-07-20T16:40:25.960635 tid3636 [IFO,App] Deadlocked Java threads: none detected
2018-07-20T16:40:25.960635 tid3636 [IFO,App] MMCore version: MMCore version 8.7.1
                                   [       ] Circular buffer size (MB): 5120
2018-07-20T16:40:25.960635 tid3636 [IFO,App] Core property cache ("system state cache") contents:
                                   [       ]   Core/AutoFocus = 
                                   [       ]   Core/AutoShutter = 1
                                   [       ]   Core/Camera = 
                                   [       ]   Core/ChannelGroup = 
                                   [       ]   Core/Focus = 
                                   [       ]   Core/Galvo = 
                                   [       ]   Core/ImageProcessor = 
                                   [       ]   Core/Initialize = 1
                                   [       ]   Core/SLM = 
                                   [       ]   Core/Shutter = 
                                   [       ]   Core/TimeoutMs = 5000
                                   [       ]   Core/XYStage = 
2018-07-20T16:40:25.960635 tid3636 [IFO,App] ***** END Problem Report System Info (incremental) *****
2018-07-20T16:40:25.960635 tid3636 [IFO,App] Problem Report: End of log capture
2018-07-20T16:40:25.960635 tid3636 [IFO,LogManager] Removing secondary log file C:\Users\Linda Liu\MMProblemReport\CoreLogCapture.txt
***** END Captured Log *****


     I am not sure why the camera will not load anymore. Any help would be appreciated.

Much Appreciated,
Kiana Go


On Fri, Jul 20, 2018 at 12:11 AM, Kyle Douglass <[hidden email]> wrote:
Hi Kiana Go,


On Fri, Jul 13, 2018 at 2:02 AM, Kiana Go <[hidden email]> wrote: 
>>import mmcorej.*;
>> mmc= CMMCore;
>> mmc.loadDevice("Port", "SerialManager", "COM5");
>> mmc.initializeDevice("Port");
>> mmc.loadDevice("ZStage", "Prior", "ZStage");

    The ZStage is connected to serial port COM5. The ZStage also works fine through Micro-Manager and its own software controller. Thus, it is connected. There seems to be a problem with matlab's interface with Micro-Manager to recognize and configure the ZStage. 
    For reference, I am using Prior's ZStage. I am also using the ProScan III controller. Not sure why the ZStage will not initialize and move when given the appropriate methods. 

I'm sorry for the late reply; I've been a bit busy lately.

I do not have much experience with loading devices from MATLAB, so I might be wrong about this. At first glance, it looks like you're trying to assign two devices to COM5, which to me seems like the most likely source of the problem.

I don't think that you need to assign a SerialManager device to COM5, since this is a device adapter for general serial port communications. I think you're getting an error when you run the line mmc.loadDevice("ZStage", "Prior", "ZStage"); because the SerialManager is already assigned to the same COM port.

When you tested this in the Micro-Manager GUI, did you also add a SerialManager device adapter to your configuration at COM5, or only the Prior stage?

Best regards,
Kyle

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general




--
Class of 2021

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
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: Matlab Configuration - CMMCore Object

kianago
Hi Kyle,

   Got it to work. I had to close all the software, turn the camera off, disconnect and reconnect the usb to the computer, turn the camera on, wait about 10 seconds, and when I loaded the configuration, everything worked fine!
However, I am wondering if Micro-Manager can stream in a webcam video (using the standard UVC protocol)?

Much Appreciated,
Kiana Go
   

On Fri, Jul 20, 2018 at 4:51 PM, Kiana Go <[hidden email]> wrote:
Hi Kyle,

   It's fine! I got the stage to load! However, now, the camera will not load. However, I was able to load the XY Stage, Z Stage, and Andor SDK3 camera perfectly into a configuration file. However, I used the XYStage, ZStage, and Camera through matlab. Now when I try to reload the same configuration, the camera will not load. For matlab, all I did was move the stage and use: snapImage, img= getImage, and reshape(img, 2048, 2048). The following is the core log and includes the error:

2018-07-20T16:40:15.168729 tid10480 [IFO,App] User has been prompted to reproduce problem
2018-07-20T16:40:21.798640 tid10480 [dbg,Core] Will set Core property: Initialize = 0
2018-07-20T16:40:21.798640 tid10480 [dbg,Core] Will unload all devices
2018-07-20T16:40:21.798640 tid10480 [IFO,Core] Did unload all devices
2018-07-20T16:40:21.798640 tid10480 [dbg,App] Notification for Device: Core Property: Initialize changed to value: 0 ignored since the system is still loading
2018-07-20T16:40:21.798640 tid10480 [dbg,Core] Did set Core property: Initialize = 0
2018-07-20T16:40:21.798640 tid10480 [dbg,Core] Will load device COM5 from SerialManager
2018-07-20T16:40:21.798640 tid10480 [IFO,Core] Did load device COM5 from SerialManager; label = COM5
2018-07-20T16:40:21.798640 tid10480 [dbg,Core] Will load device Andor sCMOS Camera from AndorSDK3
2018-07-20T16:40:21.826639 tid10480 [IFO,Core] Did load device Andor sCMOS Camera from AndorSDK3; label = Camera
2018-07-20T16:40:21.826639 tid10480 [dbg,Core] Will load device XYStage from Prior
2018-07-20T16:40:21.828639 tid10480 [IFO,Core] Did load device XYStage from Prior; label = XYStage
2018-07-20T16:40:21.828639 tid10480 [dbg,Core] Will load device ZStage from Prior
2018-07-20T16:40:21.828639 tid10480 [IFO,Core] Did load device ZStage from Prior; label = ZStage
2018-07-20T16:40:21.828639 tid10480 [dbg,Core:dev:XYStage] Will set property "Port" to "COM5"
2018-07-20T16:40:21.828639 tid10480 [dbg,Core:dev:XYStage] Did set property "Port" to "COM5"
2018-07-20T16:40:21.828639 tid10480 [dbg,Core:dev:ZStage] Will set property "Port" to "COM5"
2018-07-20T16:40:21.828639 tid10480 [dbg,Core:dev:ZStage] Did set property "Port" to "COM5"
2018-07-20T16:40:21.828639 tid10480 [dbg,Core:dev:COM5] Will set property "AnswerTimeout" to "500.0000"
2018-07-20T16:40:21.828639 tid10480 [dbg,Core:dev:COM5] Did set property "AnswerTimeout" to "500.0000"
2018-07-20T16:40:21.828639 tid10480 [dbg,Core:dev:COM5] Will set property "BaudRate" to "9600"
2018-07-20T16:40:21.828639 tid10480 [dbg,Core:dev:COM5] Did set property "BaudRate" to "9600"
2018-07-20T16:40:21.828639 tid10480 [dbg,Core:dev:COM5] Will set property "DataBits" to "8"
2018-07-20T16:40:21.828639 tid10480 [dbg,Core:dev:COM5] Did set property "DataBits" to "8"
2018-07-20T16:40:21.828639 tid10480 [dbg,Core:dev:COM5] Will set property "DelayBetweenCharsMs" to "0.0000"
2018-07-20T16:40:21.828639 tid10480 [dbg,Core:dev:COM5] Did set property "DelayBetweenCharsMs" to "0.0000"
2018-07-20T16:40:21.828639 tid10480 [dbg,Core:dev:COM5] Will set property "Handshaking" to "Off"
2018-07-20T16:40:21.828639 tid10480 [dbg,Core:dev:COM5] Did set property "Handshaking" to "Off"
2018-07-20T16:40:21.828639 tid10480 [dbg,Core:dev:COM5] Will set property "Parity" to "None"
2018-07-20T16:40:21.828639 tid10480 [dbg,Core:dev:COM5] Did set property "Parity" to "None"
2018-07-20T16:40:21.828639 tid10480 [dbg,Core:dev:COM5] Will set property "StopBits" to "1"
2018-07-20T16:40:21.828639 tid10480 [dbg,Core:dev:COM5] Did set property "StopBits" to "1"
2018-07-20T16:40:21.828639 tid10480 [dbg,Core:dev:COM5] Will set property "Verbose" to "1"
2018-07-20T16:40:21.828639 tid10480 [dbg,Core:dev:COM5] Did set property "Verbose" to "1"
2018-07-20T16:40:21.828639 tid10480 [dbg,Core] Will set Core property: Initialize = 1
2018-07-20T16:40:21.828639 tid10480 [IFO,Core] Will initialize 4 devices
2018-07-20T16:40:21.828639 tid10480 [IFO,Core] Will initialize device COM5
2018-07-20T16:40:21.830639 tid10480 [dbg,dev:COM5] Attempting to set flow of COM5 to none
2018-07-20T16:40:21.832639 tid10480 [dbg,dev:COM5] Attempting to set parity of COM5 to none
2018-07-20T16:40:21.832639 tid10480 [dbg,dev:COM5] Attempting to set stopBits of COM5 to 1
2018-07-20T16:40:21.834639 tid10480 [dbg,dev:COM5] Attempting to set dataBits of COM5 to 8
2018-07-20T16:40:21.834639 tid10480 [IFO,Core] Did initialize device COM5
2018-07-20T16:40:21.834639 tid10480 [IFO,Core] Will initialize device Camera
2018-07-20T16:40:21.838639 tid10480 [IFO,dev:Camera] Exception[AT_ERR_CONNECTION] thrown: Error Connecting / Disconnecting Hardware
2018-07-20T16:40:21.838639 tid10480 [ERR,Core:dev:Camera] Error in device "Camera": Unable to communicate with the device. (35)
2018-07-20T16:40:21.838639 tid10480 [IFO,Core] Unloading all devices after failure to load system configuration
2018-07-20T16:40:21.838639 tid10480 [dbg,Core] Will unload all devices
2018-07-20T16:40:22.042639 tid10480 [IFO,Core] Did unload all devices
2018-07-20T16:40:22.042639 tid10480 [IFO,Core] Now rethrowing original error from system configuration loading
2018-07-20T16:40:22.044639 tid10480 [IFO,App] Failed to load hardware configuation
                                    [       ] java.lang.Exception: Line 29: Property,Core,Initialize,1
                                    [       ] Error in device "Camera": Unable to communicate with the device. (35)
                                    [       ] 
                                    [       ]  in Thread[AWT-EventQueue-0,6,main]
                                    [       ]   at mmcorej.MMCoreJJNI.CMMCore_loadSystemConfiguration(Native Method)
                                    [       ]   at mmcorej.CMMCore.loadSystemConfiguration(CMMCore.java:366)
                                    [       ]   at org.micromanager.MMStudio.loadSystemConfiguration(MMStudio.java:1730)
                                    [       ]   at org.micromanager.MMStudio.setSysConfigFile(MMStudio.java:962)
                                    [       ]   at org.micromanager.menus.ToolsMenu.loadConfiguration(ToolsMenu.java:227)
                                    [       ]   at org.micromanager.menus.ToolsMenu.access$400(ToolsMenu.java:28)
                                    [       ]   at org.micromanager.menus.ToolsMenu$11.run(ToolsMenu.java:163)
                                    [       ]   at org.micromanager.utils.GUIUtils$3.actionPerformed(GUIUtils.java:361)
                                    [       ]   at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
                                    [       ]   at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
                                    [       ]   at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
                                    [       ]   at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
                                    [       ]   at javax.swing.AbstractButton.doClick(Unknown Source)
                                    [       ]   at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
                                    [       ]   at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
                                    [       ]   at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
                                    [       ]   at java.awt.Component.processMouseEvent(Unknown Source)
                                    [       ]   at javax.swing.JComponent.processMouseEvent(Unknown Source)
                                    [       ]   at java.awt.Component.processEvent(Unknown Source)
                                    [       ]   at java.awt.Container.processEvent(Unknown Source)
                                    [       ]   at java.awt.Component.dispatchEventImpl(Unknown Source)
                                    [       ]   at java.awt.Container.dispatchEventImpl(Unknown Source)
                                    [       ]   at java.awt.Component.dispatchEvent(Unknown Source)
                                    [       ]   at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
                                    [       ]   at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
                                    [       ]   at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
                                    [       ]   at java.awt.Container.dispatchEventImpl(Unknown Source)
                                    [       ]   at java.awt.Window.dispatchEventImpl(Unknown Source)
                                    [       ]   at java.awt.Component.dispatchEvent(Unknown Source)
                                    [       ]   at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
                                    [       ]   at java.awt.EventQueue.access$000(Unknown Source)
                                    [       ]   at java.awt.EventQueue$1.run(Unknown Source)
                                    [       ]   at java.awt.EventQueue$1.run(Unknown Source)
                                    [       ]   at java.security.AccessController.doPrivileged(Native Method)
                                    [       ]   at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
                                    [       ]   at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
                                    [       ]   at java.awt.EventQueue$2.run(Unknown Source)
                                    [       ]   at java.awt.EventQueue$2.run(Unknown Source)
                                    [       ]   at java.security.AccessController.doPrivileged(Native Method)
                                    [       ]   at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
                                    [       ]   at java.awt.EventQueue.dispatchEvent(Unknown Source)
                                    [       ]   at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
                                    [       ]   at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
                                    [       ]   at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
                                    [       ]   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
                                    [       ]   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
                                    [       ]   at java.awt.EventDispatchThread.run(Unknown Source)
2018-07-20T16:40:23.326639 tid10480 [IFO,App] Updating GUI; config pad = true; from cache = false
2018-07-20T16:40:23.326639 tid10480 [IFO,App] Rebuilding config group table
2018-07-20T16:40:23.326639 tid10480 [IFO,App] Finished rebuilding config group table
2018-07-20T16:40:23.326639 tid10480 [dbg,Core] Will update system state cache
2018-07-20T16:40:23.326639 tid10480 [IFO,Core] Did update system state cache
2018-07-20T16:40:23.328638 tid10480 [IFO,App] Finished updating GUI
2018-07-20T16:40:23.328638 tid10480 [IFO,App] Updating GUI; config pad = true; from cache = false
2018-07-20T16:40:23.328638 tid10480 [IFO,App] Rebuilding config group table
2018-07-20T16:40:23.328638 tid10480 [IFO,App] Finished rebuilding config group table
2018-07-20T16:40:23.328638 tid10480 [dbg,Core] Will update system state cache
2018-07-20T16:40:23.328638 tid10480 [IFO,Core] Did update system state cache
2018-07-20T16:40:23.330638 tid10480 [IFO,App] Finished updating GUI
2018-07-20T16:40:25.956635 tid10480 [IFO,App] User has stopped log capture
2018-07-20T16:40:25.960635 tid3636 [IFO,App] ***** BEGIN Problem Report System Info (incremental) *****
2018-07-20T16:40:25.960635 tid3636 [IFO,App] Total physical memory (caveats apply if JVM is 32-bit): 68630441984 (63.9 GiB)
                                   [       ] Committed virtual memory size: 1246478336 (1.2 GiB)
                                   [       ] Free physical memory (may be meaningless if JVM is 32-bit): 63417466880 (59.1 GiB)
2018-07-20T16:40:25.960635 tid3636 [IFO,App] JVM heap memory usage: used = 139647464 (133.2 MiB); committed = 1027735552 (980.1 MiB); max = 1864171520 (1.7 GiB)
                                   [       ] JVM non-heap memory usage: used = 59994976 (57.2 MiB); committed = 60489728 (57.7 MiB); max = 136314880 (130.0 MiB)
2018-07-20T16:40:25.960635 tid3636 [IFO,App] All Java threads:
                                   [       ]   id 2 ("Reference Handler"): WAITING
                                   [       ]   id 3 ("Finalizer"): WAITING
                                   [       ]   id 4 ("Signal Dispatcher"): RUNNABLE
                                   [       ]   id 5 ("Attach Listener"): RUNNABLE
                                   [       ]   id 10 ("Java2D Disposer"): WAITING
                                   [       ]   id 11 ("AWT-Shutdown"): WAITING
                                   [       ]   id 12 ("AWT-Windows"): RUNNABLE
                                   [       ]   id 15 ("AWT-EventQueue-0"): RUNNABLE
                                   [       ]   id 18 ("DestroyJavaVM"): RUNNABLE
                                   [       ]   id 20 ("TimerQueue"): TIMED_WAITING
                                   [       ]   id 21 ("EDTHangLogger timer"): TIMED_WAITING
                                   [       ]   id 23 ("D3D Screen Updater"): TIMED_WAITING
                                   [       ]   id 24 ("Thread-5"): TIMED_WAITING
                                   [       ]   id 25 ("BeanShell interpreter"): TIMED_WAITING
                                   [       ]   id 30 ("SwingWorker-pool-4-thread-1"): WAITING
                                   [       ]   id 33 ("Swing-Shell"): WAITING
                                   [       ]   id 39 ("SwingWorker-pool-4-thread-2"): RUNNABLE
                                   [       ] (End all Java threads)
2018-07-20T16:40:25.960635 tid3636 [IFO,App] Deadlocked Java threads: none detected
2018-07-20T16:40:25.960635 tid3636 [IFO,App] MMCore version: MMCore version 8.7.1
                                   [       ] Circular buffer size (MB): 5120
2018-07-20T16:40:25.960635 tid3636 [IFO,App] Core property cache ("system state cache") contents:
                                   [       ]   Core/AutoFocus = 
                                   [       ]   Core/AutoShutter = 1
                                   [       ]   Core/Camera = 
                                   [       ]   Core/ChannelGroup = 
                                   [       ]   Core/Focus = 
                                   [       ]   Core/Galvo = 
                                   [       ]   Core/ImageProcessor = 
                                   [       ]   Core/Initialize = 1
                                   [       ]   Core/SLM = 
                                   [       ]   Core/Shutter = 
                                   [       ]   Core/TimeoutMs = 5000
                                   [       ]   Core/XYStage = 
2018-07-20T16:40:25.960635 tid3636 [IFO,App] ***** END Problem Report System Info (incremental) *****
2018-07-20T16:40:25.960635 tid3636 [IFO,App] Problem Report: End of log capture
2018-07-20T16:40:25.960635 tid3636 [IFO,LogManager] Removing secondary log file C:\Users\Linda Liu\MMProblemReport\CoreLogCapture.txt
***** END Captured Log *****


     I am not sure why the camera will not load anymore. Any help would be appreciated.

Much Appreciated,
Kiana Go


On Fri, Jul 20, 2018 at 12:11 AM, Kyle Douglass <[hidden email]> wrote:
Hi Kiana Go,


On Fri, Jul 13, 2018 at 2:02 AM, Kiana Go <[hidden email]> wrote: 
>>import mmcorej.*;
>> mmc= CMMCore;
>> mmc.loadDevice("Port", "SerialManager", "COM5");
>> mmc.initializeDevice("Port");
>> mmc.loadDevice("ZStage", "Prior", "ZStage");

    The ZStage is connected to serial port COM5. The ZStage also works fine through Micro-Manager and its own software controller. Thus, it is connected. There seems to be a problem with matlab's interface with Micro-Manager to recognize and configure the ZStage. 
    For reference, I am using Prior's ZStage. I am also using the ProScan III controller. Not sure why the ZStage will not initialize and move when given the appropriate methods. 

I'm sorry for the late reply; I've been a bit busy lately.

I do not have much experience with loading devices from MATLAB, so I might be wrong about this. At first glance, it looks like you're trying to assign two devices to COM5, which to me seems like the most likely source of the problem.

I don't think that you need to assign a SerialManager device to COM5, since this is a device adapter for general serial port communications. I think you're getting an error when you run the line mmc.loadDevice("ZStage", "Prior", "ZStage"); because the SerialManager is already assigned to the same COM port.

When you tested this in the Micro-Manager GUI, did you also add a SerialManager device adapter to your configuration at COM5, or only the Prior stage?

Best regards,
Kyle

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general




--
Class of 2021



--
Class of 2021

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general