Thorlabs MC2000B Agent

The Thorlabs MC2000B Agent is an OCS agent which helps monitor input and output frequencies of the Thorlabs chopper, and sends commands to set the frequency of the chopper, as well as other features such as the bladetype and reference modes of the device.

Dependencies

This agent requires running on a Windows machine outside a Docker container. This requires manually setting the environment variable for $OCS_CONFIG_DIR to the ocs-site-configs path on your computer. Because we are outside a Docker container, the Thorlabs MC2000B agent will also need to run in the $OCS_CONFIG_DIR path. Instructions for setting an environment variable on a Windows computer:

Python Packages

The MC2000B optical chopper is a Thorlabs device. To use the Agent, a software package must be installed from Thorlabs’ website. The software package includes the Python software development kit for third-party development. That software is imported as MC20000B_COMMAND_LIB in the OCS Agent.

Configuration File Examples

Below are configuration examples for the ocs config file.

OCS Site Config

To configure the Thorlabs MC2000B chopper Agent we need to add a ThorlabsMC2000BAgent block to our ocs configuration file. Here is an example configuration block using all of the available arguments:

{'agent-class': 'ThorlabsMC2000BAgent',
 'instance-id': 'chopper',
 'arguments': [['--mode', 'acq'],
               ['--com-port', 'COM3']]},

Description

The Thorlabs MC2000B Agent takes in 15 bladetypes, the names of which can be found at the link below under Single and Dual Frequency Optical Chopper Blades and Harmonic Frequency Optical Chopper Blades as the item number:

Agent API

class socs.agents.thorlabs_mc2000b.agent.ThorlabsMC2000BAgent(agent, comport, nbaud=115200, timeout=3)[source]

Agent to connect to the MC2000B Thorlabs chopper controller device.

Parameters:
  • comport (str) – COM port to connect to device. Ex: “COM3”

  • nbaud (int) – baud rate of the device (115200)

  • timeout (int) – the timeout time for the device; default is set to 3s

init_chopper(auto_acquire=False)[source]

Task - Perform first time setup of MC2000B chopper controller communication.

Parameters:

auto_acquire (bool, optional) – Default is false. Starts data acquisition after initilialization if True.

set_frequency(freq=None)[source]

Task - Set the frequency of the chopper.

Parameters:

freq (float) – Frequency of chopper blades.

set_bladetype(bladetype=None)[source]

Task - Set the bladetype of the chopper. Selecting a bladetype influences the range of frequencies permitted for the chopper.

Parameters:

bladetype (str) – Name of bladetype assigned to chopper controller setup. Default set to ‘MC1F2’ to reach the range of 4-8Hz.

set_reference_output_mode(output_mode=None)[source]

Task - Set the output reference mode to determine the setting of frequency output/input.

Parameters:

output_mode (str) – Output reference mode of chopper frequency. Possible modes are ‘target’ or ‘actual’. Default set to ‘target’.

set_blade_reference(reference=None)[source]

Task - Set the reference mode for the blade. This is the point on the chopper blades for the controller to measure and set frequency.

Parameters:

reference (str) – Reference mode of the blade. Default set to ‘internalinner’. Can be “internal”, “external”, “internalinner”, “internalouter”, “externalinner”, “externalouter”

acq()[source]

Process - Acquire data from the MC2000B chopper device.