KORAD KA3005P¶
The KORAD KA3005P is a programmable power supply unit.
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 KORAD_KA3005P
k = KORAD_KA3005P("COM3")
# set output to 4 V
k.voltage = 4
print(k.voltage)
# set current (maximum) to 0.5 A
k.current = 0.5
print(k.current)
-
class
htf.powersupply.korad_ka3005p.
KORAD_KA3005P
(port, debug=False)¶ KORAD_KA3005P
is a hardware abstraction to the KORAD KA3005P power supply unit using a UART to control it.KORAD_KA3005P
usesDelegatorMixin
to automatically set and read it’s membersvoltage
andcurrent
.Parameters: -
close
()¶ Close the serial member. This method is automatically called when
__del__()
is called.
-
disableOutput
()¶ Disable output.
-
enableOutput
()¶ Enable output.
Raises: SetOutputException
– if output was not set.
-
getCurrentCurrent
(channel=1)¶ Read the current current from device and return the result.
Parameters: channel (int) – the channel to use. Shall always be 1. Returns: the current current. Return type: float
-
getCurrentVoltage
(channel=1)¶ Read current voltage from device and return the result.
Parameters: channel=1 (int) – the channel to use. Shall always be 1. Returns: the current voltage. Return type: float
-
getStatus
()¶ Read device status and return a dictionary.
Returns: - the status dictionary containing the keys “ch1 mode”, “ch2 mode”, “tracking mode”, “beep”,
- ”lock” and “output”.
Return type: dict
-
query
(query, lengthOfAnswer=None, retries=3)¶ Send a command and wait for the answer.
Parameters: Returns: the answer.
Return type: Raises: TimeoutException
– if a communication time-out occured.
-
sendCommand
(command)¶ Directly send a command to the power supply unit.
Parameters: command (str) – the command to be sent.
-
setCurrent
(current, channel=1)¶ Set the output current for a given channel.
Parameters: Raises: SetCurrentException
– if current was not set.
-
setVoltage
(voltage, channel=1)¶ Set the output voltage for a given channel.
If
voltage
is None the output is disabled. Ifvoltage
is not None the output is enabled. Ifvoltage
changes the output is first disabled, changed, and then enabled again.Parameters: Raises: SetVoltageException
– if voltage was not set.
-
-
exception
htf.powersupply.korad_ka3005p.
SetCurrentException
¶ Exception that is raised if current was not set.
-
exception
htf.powersupply.korad_ka3005p.
SetOutputException
¶ Exception that is raised if the output was not set.
-
exception
htf.powersupply.korad_ka3005p.
SetVoltageException
¶ Exception that is raised if voltage was not set.
-
exception
htf.powersupply.korad_ka3005p.
TimeoutException
¶ Exception that is raised if a communication time-out occurred.