can't initialize Sutter shutters from java

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

can't initialize Sutter shutters from java

Shashank Sundareshan

Hi,

 

I’m a newbie coder trying to write a java program to run my Hamamatsu camera, Sutter shutters and flywheels, and Prior XYStage.

Using Windows Vista, eclipse IDE, and uManager 1.3.4 with nightly build update 20100224

So far I have been able to load the camera and shutters, but when I try to initialize them, it produces an error:

LOG(2010-04-20T11:06:27.719494, 1072, 005D6960:): Starting initialization sequence for 3 devices...
LOG(2010-04-20T11:06:27.720494, 1072, 005D6960:): Error occured. Device ShutterA. Shutter-A. Error code 17 (11 hex).
, file .\MMCore.cpp, line 758

 

However, when I initialize the camera by itself, it works fine.

 

Also, do I need to initialize them before I can get/set properties like State?

Before initializing:

StrVector properties = core.getDevicePropertyNames("ShutterB");
                for (int i=0; i<properties.size(); i++) {
                    String prop = properties.get(i);
                    String val = core.getProperty("ShutterB", prop);
                    System.out.println("Name: " + prop + ", value: " + val);


Gives me (no “State” property):
Name: Description, value: Sutter Lambda shutter adapter
Name: Name, value: Shutter-B
Name: Port, value: P1

 

Thanks!

 

Shashank

[hidden email]


------------------------------------------------------------------------------

_______________________________________________
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: can't initialize Sutter shutters from java

Nico Stuurman
Administrator
<base href="x-msg://80/">Hi Shashank,

I’m a newbie coder trying to write a java program to run my Hamamatsu camera, Sutter shutters and flywheels, and Prior XYStage.
Using Windows Vista, eclipse IDE, and uManager 1.3.4 with nightly build update 20100224
So far I have been able to load the camera and shutters, but when I try to initialize them, it produces an error:
LOG(2010-04-20T11:06:27.719494, 1072, 005D6960:): Starting initialization sequence for 3 devices...
LOG(2010-04-20T11:06:27.720494, 1072, 005D6960:): Error occured. Device ShutterA. Shutter-A. Error code 17 (11 hex). 
, file .\MMCore.cpp, line 758

See my mail from a few hours ago ("Loading Arduino Duemilanove").  You need to set the Pre-initialization properties for your device before initializing it.  Your Sutter shutter will need a serial port and you will need to set the "Port" property (or whatever it is called in that adapter).

Also, do I need to initialize them before I can get/set properties like State?
Before initializing:
StrVector properties = core.getDevicePropertyNames("ShutterB");
                for (int i=0; i<properties.size(); i++) {
                    String prop = properties.get(i);
                    String val = core.getProperty("ShutterB", prop);
                    System.out.println("Name: " + prop + ", value: " + val);

Gives me (no “State” property):

That is correct.  The "State" property will be created during initialization.

Name: Description, value: Sutter Lambda shutter adapter
Name: Name, value: Shutter-B
Name: Port, value: P1

There you go.  Do you have a serial port named "P1" initialized?  Once you set the "Port" property to a valid serial port (that is, a serial port that has been initialized in Micro-Manager, MM considers serial ports to be just another device) you should be able to initializa your shutter.

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: can't initialize Sutter shutters from java

Shashank Sundareshan
<base href="x-msg://80/">

Ok, so now my code reads:   

 

        core = new CMMCore();

        core.unloadAllDevices();
        MicroManager mm = new MicroManager(); //loads GUI
        core.loadDevice("COM1", "SerialManager", "/dev/tty.usbserial-A4001t3L");
        Thread.sleep(1000);
        core.initializeDevice("COM1");

 

and I get:

LOG(2010-04-22T10:49:22.031000, 4068, 0064E4F0:): Device /dev/tty.usbserial-A4001t3L loaded from SerialManager and labeled as COM1
Exception in thread "main" java.lang.Exception: Error code: 22
/dev/tty.usbserial-A4001t3L. Error code 101 (65 hex).

    at mmcorej.MMCoreJJNI.CMMCore_initializeDevice(Native Method)
    at mmcorej.CMMCore.initializeDevice(CMMCore.java:53)
    at MicroManager.main(MicroManager.java:78)
LOG(2010-04-22T10:49:23.031000, 4068, 0064E4F0:): Error occured. Device COM1. /dev/tty.usbserial-A4001t3L. Error code 101 (65 hex).
, file .\MMCore.cpp, line 832

 

Do I need to change the third argument of the loadDevice method to something different? Should that point to where the driver for my port is? If it resides in C:\Windows\system32.. etc, how do I insert this filepath into that argument?

 

Thanks,

Shashank

 

From: Nico Stuurman [mailto:[hidden email]]
Sent: Wednesday, April 21, 2010 3:58 PM
To: Micro-Manager General
Subject: Re: [micro-manager-general] can't initialize Sutter shutters from java

 

Hi Shashank,

 

I’m a newbie coder trying to write a java program to run my Hamamatsu camera, Sutter shutters and flywheels, and Prior XYStage.

Using Windows Vista, eclipse IDE, and uManager 1.3.4 with nightly build update 20100224

So far I have been able to load the camera and shutters, but when I try to initialize them, it produces an error:

LOG(2010-04-20T11:06:27.719494, 1072, 005D6960:): Starting initialization sequence for 3 devices...
LOG(2010-04-20T11:06:27.720494, 1072, 005D6960:): Error occured. Device ShutterA. Shutter-A. Error code 17 (11 hex). 
, file .\MMCore.cpp, line 758

 

See my mail from a few hours ago ("Loading Arduino Duemilanove").  You need to set the Pre-initialization properties for your device before initializing it.  Your Sutter shutter will need a serial port and you will need to set the "Port" property (or whatever it is called in that adapter).



Also, do I need to initialize them before I can get/set properties like State?

Before initializing:

StrVector properties = core.getDevicePropertyNames("ShutterB");
                for (int i=0; i<properties.size(); i++) {
                    String prop = properties.get(i);
                    String val = core.getProperty("ShutterB", prop);
                    System.out.println("Name: " + prop + ", value: " + val);


Gives me (no “State” property):

 

That is correct.  The "State" property will be created during initialization.

 

Name: Description, value: Sutter Lambda shutter adapter
Name: Name, value: Shutter-B
Name: Port, value: P1

 

There you go.  Do you have a serial port named "P1" initialized?  Once you set the "Port" property to a valid serial port (that is, a serial port that has been initialized in Micro-Manager, MM considers serial ports to be just another device) you should be able to initializa your shutter.

 

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: can't initialize Sutter shutters from java

Nico Stuurman-4
<base href="x-msg://80/">

Ok, so now my code reads:   
 
        core.loadDevice("COM1", "SerialManager", "/dev/tty.usbserial-A4001t3L");
        core.initializeDevice("COM1");
 
and I get:
LOG(2010-04-22T10:49:22.031000, 4068, 0064E4F0:): Device /dev/tty.usbserial-A4001t3L loaded from SerialManager and labeled as COM1
Exception in thread "main" java.lang.Exception: Error code: 22
/dev/tty.usbserial-A4001t3L. Error code 101 (65 hex). 

This would only work in the very unlikely case that your OS knows one of its serial ports under the name "dev/tty.usbserial-A4001t3L".  If you are on Windows, the name is more likely "COM3", or something similar.  The Micro-Manager Hardware Configuration Wizard will lists the serial ports available on your system.  

Best,

Nico

------------------------------------------------------------------------------

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