psw module
- class psw.Psw
Bases:
objectThis module can control the PSW.
It supports USB interface to use SCPI.
It will scan available instruments on your DSO, then require a Serial Number to specify and connect to it.
Usage:
import psw inst = psw.Psw() inst.connect('<Instrument Serial Number>') print(inst.idn()) inst.close()
- clear_prot()
Clears over-voltage, over-current and overtemperature (OVP, OCP, OTP) protection circuits. It also clears the shutdown protection circuit.
- close()
Close the connection.
- idn()
- is_ocp_on()
Returns the OCP (over-current protection) status.
- is_on()
Returns output status of the instrument.
- is_prot_trip()
Returns the state of the protection circuits (OVP, OCP, OTP).
- max_current
MAX Current for this instrument. You will get it after connection.
- max_voltage
MAX Voltage for this instrument. You will get it after connection.
- meas_current() float
Takes a measurement and returns the average output current
- Returns:
output current
- Return type:
- meas_power() float
Takes a measurement and returns the average output power
- Returns:
output power
- Return type:
- meas_voltage() float
Takes a measurement and returns the average output voltage
- Returns:
output voltage
- Return type:
- min_current
MIN Current for this instrument. You will get it after connection.
- min_voltage
MIN Voltage for this instrument. You will get it after connection.
- opc()
- readline() str
Read a line from the instrument’s communication port and return it as a string.
- Returns:
The string read from the instrument.
- Return type:
- scpi_delay
SCPI delay.
- set_current(value)
Sets the current level in amps.
- Parameters:
value – (float) output current level. (str): MAX or MIN
- set_mode(mode: int)
Sets the PSW output mode.
- Parameters:
mode (int) – 0:’CVHS’, 1:’CCHS’, 2:’CVLS’, 3:’CCLS’,
- set_ocp_off()
Turns OCP (over-current protection) off.
- set_ocp_on()
Turns OCP (over-current protection) on.
- set_off()
Turns the output off.
- set_on()
Turns the output on.
- set_voltage(value)
Sets the voltage level in volts.
- Parameters:
value – (float) output voltage level. (str): MAX or MIN