AX3003P package API documentation¶
AX3003P Programmable Power Supply control library.
-
class
AX3003P.AX3003P.AX3003P(device)¶ Bases:
objectAX3003P Programmable Power Supply control class.
Parameters: device (Str) – Path to the serial port file. example: ‘/dev/ttyUSB0’ -
connect()¶ Connect to the power supply over the serial interface. Connects to the power supply over the serial interface.
Raises: SerialException – If there is a problem with the serial port.
-
disableOcp()¶ Disable overvoltage protection.
-
disableOutput()¶ Disable the power supply output.
-
disableOvp()¶ Disable overvoltage protection.
-
disconnect()¶ Disconnect from the power supply. Closes serial connection to the power supply.
-
enableOcp()¶ Enable overvoltage protection.
-
enableOutput()¶ Enable the power supply output.
-
enableOvp()¶ Enable overvoltage protection.
-
measureCurrent()¶ Measure voltage on the power supply output. Function returns the current flowing througth the power supply terminals. in Amps. It returns None if the read operation has failed.
Returns: Output current. Return type: Float
-
measurePower()¶ Measure power delivered by the power supply output. Function returns the current power consumed by the load connected to the power supply termonals in Watts. It returns None if the read operation has failed.
Returns: Output power. Return type: Float
-
measureVoltage()¶ Measure voltage on the power supply output. Function returns the voltage across the power supply terminals in Volts. It returns None if the read operation has failed.
Returns: Output voltage. Return type: Float
-
ocpTripped()¶ Check if overcurrent protection has tripped. Returns True if overcurrent protection has tripped. Returns False if it hasn’t tripped. Returns None if error occured while checking the ovp state.
Returns: True if ocp has tripped, False if it is not. Return type: Boolean
-
outputEnabled()¶ Check if output is enabled. Returns the state of the power supply output. If output is enabled, True is Returned, if not, False is returned. None is returned if the read operation has failed.
Returns: Power supply state. Return type: Boolean
-
ovpTripped()¶ Check if overvoltage protection has tripped. Returns True if overvoltage protection has tripped. Returns False if it hasn’t tripped. Returns None if error occured while checking the ovp state.
Returns: True if ovp has tripped, False if it is not. Return type: Boolean
-
resetOcp()¶ Reset overcurrent protection.
-
resetOvp()¶ Reset overvoltage protection.
-
sendReadCommand(command, timeout=1000)¶ Send command and read response. Sends command to the power supply and reads the respinse. Timeout parameter can be used to determine how long shall te function wait for the response. If no response is received before the time runs out the function returns None. Otherwise the string containing response is returned. If timeout is set to None the function will wait until some data are received. This however can cause the program to freeze if no response is received due to for example communication error.
Parameters: - command (Str) – Command
- timeout (Int) – Timeout in ms
Returns: Response or None if there is no response.
Return type: Str
-
sendWriteCommand(command)¶ Send command to the power supply. Sends command to the power supply.
Parameters: command (Str) – Command
-
setCurrent(current)¶ Set output current.
Parameters: current (Float) – Output current in Amps.
-
setOcpTreshold(currentThreshold)¶ Set overcurrent protection threshold.
Parameters: currentThreshold (Float) – Current treshold in Amps.
-
setOvpTreshold(voltageThreshold)¶ Set overvoltage protection threshold.
Parameters: voltageThreshold (Float) – Voltage treshold in Volts.
-
setVoltage(voltage)¶ Set output voltage.
Parameters: voltage (Float) – Output voltage in Volts.
-
-
AX3003P.AX3003P.connect(device)¶ Open connection to the AX3003P. Connects to the AX3003P and returns the Power Supply control object. over the serial port. Path to the serial port file is given as device.
Parameters: device (Str) – Path to the power supply. Returns: AX300P object. Return type: AX3003P Raises: SerialException – If there is a problem with the serial port.