msl.equipment.resources.optronic_laboratories.ol_current_source module

Communicate with a DC current source from Optronic Laboratories.

class msl.equipment.resources.optronic_laboratories.ol_current_source.OLCurrentSource[source]

Bases: object

Communicate with a DC current source from Optronic Laboratories.

Attention

The connection interface must be selected (using the buttons on the front panel) to be either RS-232 or IEEE-488 after the Current Source is initially powered on. Even if this is the default power-on interface, it must be manually re-selected before communication will work.

The properties for the connection supports the following key-value pairs in the Connections Database:

'address': int, the internal address of the device (RS-232 only) [default: 1]
'delay': float, the number of seconds to wait between a write-read transaction (RS-232 only) [default: 0.1]

as well as the key-value pairs supported by ConnectionSerial if using RS-232 as the interface or by ConnectionGPIB if using IEEE-488 as the interface.

Do not instantiate this class directly. Use the connect() method to connect to the equipment.

get_current() float[source]

Get the output current.

get_option(lamp: int, option: int) str | float[source]

Get the value of a lamp configuration option.

Parameters:
  • lamp – The lamp number (between 0 and 9, inclusive).

  • option

    The option type to read. Must be one of the following values

    • 40: Lamp Hours \(\rightarrow\) float

    • 50: Recalibration interval (hours) \(\rightarrow\) float

    • 60: Target units (A, V or W) \(\rightarrow\) str

    • 70: Target value \(\rightarrow\) float

    • 80: Current limit \(\rightarrow\) float

    • 90: Lamp description text \(\rightarrow\) str

    • 95: Wattage (L or H) \(\rightarrow\) str

Returns:

The value of the option that was requested.

get_voltage() float[source]

Get the output voltage.

get_wattage() float[source]

Get the output wattage.

reset() None[source]

Reset the communication buffers.

select_lamp(lamp: int) None[source]

Select a lamp.

Parameters:

lamp – The lamp number (between 0 and 9, inclusive).

set_current(amps: float) float[source]

Set the target output current.

Parameters:

amps – The target current, in Amps. If the value is above the target current limit for the presently selected lamp setup or if the value is less than the minimum supported current, the target current will not change.

Returns:

The actual value of the output current after it was set.

set_option(lamp: int, option: int, value: str | float) None[source]

Set a value for one of the lamp configuration options.

Parameters:
  • lamp – The lamp number (between 0 and 9, inclusive).

  • option

    The option type to update. Must be one of the following values

    • 40: Lamp Hours

    • 50: Recalibration interval (hours)

    • 60: Target units (A, V or W)

    • 70: Target value

    • 80: Current limit

    • 90: Lamp description text

    • 95: Wattage (L or H)

  • value – The value to write for option.

set_voltage(volts: float) float[source]

Set the target output voltage.

Parameters:

volts – The target voltage, in Volts. If the value is above the target voltage limit for the presently selected lamp setup or if the value is less than the minimum supported voltage, the target voltage will not change.

Returns:

The actual value of the output voltage after it was set.

set_wattage(watts: float) float[source]

Set the target output wattage.

Parameters:

watts – The target wattage, in Watts. If the value is above the target wattage limit for the presently selected lamp setup or if the value is less than the minimum supported wattage, the target wattage will not change.

Returns:

The actual value of the output wattage after it was set.

state() bool[source]

Returns whether the output is on or off.

property system_status_byte: int

The system status byte that is returned in every reply.

It is constructed as follows:

  • bit 7: Busy flag (the device is performing a function)

  • bit 6: Reserved

  • bit 5: Reserved

  • bit 4: Lamp status (0=off, 1=on)

  • bit 3: Reserved

  • bit 2: Reserved

  • bit 1: Seeking current (1=current is ramping)

  • bit 0: Reserved

target_info() dict[str, int | float | str][source]

Get the target information of the currently-selected lamp.

Returns:

The lamp number, target value and target unit. The key-value pairs are:

{'lamp': int, 'value': float, 'unit': str}

turn_off() None[source]

Turn the output off.

turn_on() None[source]

Turn the output on.

zero_voltage_monitor() None[source]

Zero the voltage monitor.