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(record)[source]

Bases: ConnectionSerial

Communicate with a DC current source from Optronic Laboratories.

Attention

The COM interface must be selected (using the buttons on the front panel) to be RS-232 after the Current Source is initially powered on. Even if this is the default power-on interface, it must be re-selected before communication will work. This is required for models with firmware revision 5.8, other firmware versions may be different.

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

'address': int, the internal address of the device [default: 1]
'delay': float, the number of seconds to wait between send/receive commands [default: 0.05]

as well as those key-value pairs supported by the parent ConnectionSerial class.

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

Parameters:

record (EquipmentRecord) – A record from an Equipment-Register Database.

get_current()[source]

Get the output current.

Returns:

float – The value of the output current.

get_setup(lamp, typ)[source]

Get the lamp setup.

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

  • typ (int) –

    The type of data to read. Must be one of 40, 50, 60, 70, 80, 90, 95.

    • 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)

Returns:

str or float – The value of the data type that was requested.

get_voltage()[source]

Get the output voltage.

Returns:

float – The value of the output voltage.

get_wattage()[source]

Get the output wattage.

Returns:

float – The value of the output wattage.

reset()[source]

Reset the communication buffers.

select_lamp(number)[source]

Select a lamp.

Parameters:

number (int) – The lamp number to select, between 0 and 9.

set_current(amps)[source]

Set the target output current.

Parameters:

amps (float) – 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:

float – The present value of the output current.

set_setup(lamp, typ, value)[source]

Set the lamp setup.

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

  • typ (int) –

    The type of data to write. Must be one of 40, 50, 60, 70, 80, 90, 95.

    • 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 (str or float) – The value to write.

set_voltage(volts)[source]

Set the target output voltage.

Parameters:

volts (float) – 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:

float – The present value of the output voltage.

set_wattage(watts)[source]

Set the target output wattage.

Parameters:

watts (float) – The target wattage, in Volts. 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:

float – The present value of the output wattage.

state()[source]

Returns whether the output is on or off.

Returns:

boolTrue if the output is on, False if the output is off.

property system_status_byte

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

Type:

int

target_info()[source]

Get the target information of the currently-selected lamp.

Returns:

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

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

turn_off()[source]

Turn the output off.

turn_on()[source]

Turn the output on.

zero_voltage_monitor()[source]

Zero the voltage monitor.