Laser control via script

Hello,

I would like to ask for help regarding laser control via script. I have Micro-Manager 2.0 gamma.
In my optical setup, I have got two lasers, blue one and red one. Each time I want to control, just one laser. Both lasers are Cobolt 06-01 and are built in C-FLEX. Everything looks compatible and works well when it is controlled manually.
I am just wondering why is the laser marked as shutter (but it is might not important).

I am able to select the wanted laser via:
mmc.setProperty(“Core”, “Shutter”, “Cobolt red Laser”);

Following commands works as well (start/stop Emission):
mmc.setShutterOpen(true);
mmc.setShutterOpen(false);

BUT I am not able to set Power of laser or find out the current Power. I have tried following commands but any of then did not work:
mmc.getProperty(“Cobolt red Laser”,“Power”);
mmc.setProperty(“Cobolt red Laser”,“Power”);

or
mmc.getProperty(“Cobolt red Laser”,“Power Setpoint [mW]”);
mmc.setProperty(“Cobolt red Laser”,“Power Setpoint [mW]”);

even
mmc.getProperty(“Cobolt red Laser”,“Cobolt red Laser-12-Power Setpoint [mW]”);
mmc.setProperty(“Cobolt red Laser”,“Cobolt red Laser-12-Power Setpoint [mW]”);

I am attaching a picture as a view to the Property Name in my Hardware configuration.
I tried to be inspired here as well but it didn’t solve my problem: GUI panel for Cobolt laser control - Micro-Manager.

Please, how should look like the correct commands, which find out the power value and to set the new power in my case?

Thank You very much!
Best regards,

Jiri

I am just wondering why is the laser marked as shutter (but it is might not important).

The software device interface of Micro-Manager knows about a couple of device types. The “abstract” device that switches a light source on and off was called “Shutter”. So, indeed not very important (and it is really difficult to name things well!).

mmc.getProperty(“Cobolt red Laser”,“Power Setpoint [mW]”);

Try:

mmc.getProperty(“Cobolt red Laser”,“12-Power Setpoint [mW]”);
mmc.setProperty(“Cobolt red Laser”,“12-Power Setpoint [mW]”, "5.0");

I do not know why, but the author of the Cobolt device adapter decided to number the properties. Those numbers are part of the name of the property. It is even possible that there is a space at the end of "red Laser “, and the beginning of " 12-Po”. Hard to tell from the picture, but compare with other devices.

1 Like

At first, I couldn’t figure out if this was my Cobolt driver or the “official” one, and then I saw the numbers. Not my driver. :wink:

… As nico wrote, those need to be included, and any white spaces…

1 Like

Correct is “12-Power Setpoint [mW]” without space :slight_smile:

Thank You!
Jiri

Dear Karl Bellvé,

I would like to test your driver for Cobolt, because using the official one it is not possible to start emitting in modulation mode in MicroManager2.0gamma (we discussed with Cobolt - their driver is primarily for µM1.4).
I have checked the website, where it is written that it should be possible to choose digital modulation mode. So, I would like ask you, how can I switch to Modulation mode and choose digital modulation in Device Property Browser? I can’t see it in the offered options (see attached image).

Thank You,
Best regards,
Jiri

There is no difference in the Cobolt device adapter between 1.4 and 2.0. Happy to explain this to the Cobolt developers. 1.4 is no longer maintained, so it would be good to get them on board.

As Nico said, there is no difference between 1.4 and 2.0 as it relates to Device Adapters. My Cobolt Driver is the same driver for both versions of micromanager. Their driver should be the same way.

I am also not enthusiastic about supporting Cobolt at this time. I recommend that they support their driver regardless of which version of micromanager is being used.

Without looking at my code, I believe I do a function check. If my driver doesn’t detect digital modulation, it won’t present it as an option in the interface. I hope that helps.

I checked my code…

if (SerialCommand (ID_ + "em").compare(g_Msg_UNSUPPORTED_COMMAND) == 0) bModulation_ = false;
    bModulation_ = false;

I send “em” to the laser and check for an invalid response.

Edited to add…my driver has a “property” for sending direct serial commands. You are welcome to send the appropriate command via a BSH script or enter it directly and see if it works.

Edited to add…

Looks like I over ride and force bModulation to be false. Not sure why… I developed this at home, without access to a Cobolt during covid lockdown. Looks like that line, 308, needs to be deleted. The Skyra driver code, which this is based on, doesn’t have that line. You could try it. No warranties…