Manson HCS-3XXX

The Manson HCS-3XXX is a programmable power supply unit family.

The user does not need not call any methods. He can use the automatic delegation to easily set current and voltage by assigning values to the members of the same names.

Usage:

from htf.powersupply import MansonHCS3xxx

m = MansonHCS3xxx("COM3")

# set output to 4 V
m.voltage = 4
print(m.voltage)
# set current (maximum) to 0.5 A
m.current = 0.5
print(m.current)
class htf.powersupply.manson_hcs_3xxx.MansonHCS3xxx(port, decimalPlacesForCurrent=1, debug=False)

MansonHCS3xxx is a hardware abstraction to the Manson HCS-3xxx power supply family using a UART to control it.

MansonHCS3xxx uses DelegatorMixin to automatically set and read it’s members voltage and current.

Parameters:
  • port (str) – the comport to be used, eg. “COM3”, 3 or “/dev/ttyUSB0”, etc.
  • decimalPlacesForCurrent=1 (int) – the number of decimal places for the current. HCS-3100, 3150, 3200 and 3202 have one decimal place. HCS-3102, 3014 and 3204 have two decimal places.
  • debug=False (bool) – if set to True debugging is enabled
close()

Close the serial member. This method is automatically called when __del__() is called.

disableOutput()

Disable output.

enableOutput()

Enable output.

getCurrent()

Read the current current from device and return the result.

Returns:the current current.
Return type:float
getDisplayVoltageCurrentAndStatus()

Get the display voltage, current and status.

Returns:a dictionary containing “voltage”, “current” and “status”.
Return type:dict
getPresetMaximumCurrent()

Get preset maximum current for current preset.

Returns:the preset maximum current.
Return type:int
getPresetMaximumVoltage()

Get preset maximum voltage for current preset.

Returns:the preset maximum voltage.
Return type:int
getPresetMaximumVoltageAndCurrent()

Get the preset maximum voltage and current.

Returns:a dictionary containing “voltage” and “current”.
Return type:dict
getPresetVoltageAndCurrent()

Get the preset voltage and current.

Returns:a dictionary containing “voltage” and “current”.
Return type:dict
getPresets()

Get three voltage-current presets.

Returns:a dictionary containing “voltage”, “current” and “P<preset>”.
Return type:dict
getVoltage()

Read current voltage from device and return the result.

Returns:the current voltage.
Return type:float
loadPreset(preset)

Load preset preset.

Parameters:preset (int) – may be 0, 1, or 2.
presetMaximumCurrent(current)

Set maximum voltage for current preset.

presetMaximumVoltage(voltage)

Set maximum voltage for current preset.

query(query, answerLines=1)

Send a command and wait for the answer.

Parameters:
  • query (str) – the query to be sent.
  • answerLines=1 (int) – the number of lines to be received.
Returns:

the answer line(s).

Return type:

str

Raises:

TimeoutException – if a communication time-out occurred.

setCurrent(current)

Set the output current to current.

Parameters:current (int, float or str) – the current in units of amperes as int(), float() or string, eg. 0, 0.5, “0.5” or even “0.5 mA” work.
setVoltage(voltage)

Set the output voltage to voltage.

Parameters:voltage (int, float or str) – the voltage in units of volts as int(), float() or string, eg. 23, 23.0, “23.0” or even “23.0 V” work. voltage may have on decimal point. If voltage is None the output is disabled.
storePresets(presets)

Store three voltage-current presets.

Parameters:presets (dict) – a dictionary containing the key P1, P2 and P3. Each key constaint “voltage” and “current” keys.

Usage:

>>> presets = {
>>>    'P1': {'current': 12.0, 'voltage': 5.0},
>>>    'P2': {'current': 12.0, 'voltage': 13.8},
>>>    'P3': {'current': 12.0, 'voltage': 25.0}}
>>> manson.storePresets(presets)
exception htf.powersupply.manson_hcs_3xxx.TimeoutException

Exception that is raised if a communication time-out occurred.