RD3005 module

Created on Mon Aug 1 12:14:47 2022 The script is taken from https://github.com/uberdaff/kd3005p/blob/master/kd3005p.py and heavily modified by: @author: Martin.Mihaylov @author: Maxim.Weizel

# Copyright 2017 uberdaff # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. # # # Requirement: pyvisa (migrated from pyserial) # # get_idn() - Get instrument identification # set_voltage(voltage) - Set the voltage on the output # get_voltage_setting() - Get the ‘set’ voltage # measure_voltage() - Get a measurement of the voltage # set_current(current) - Set the current limit # get_current_setting() - Get the ‘set’ current limit # measure_current() - Get a measurement of the output current # set_output(state) - Set the state of the output # set_ocp(bool) - Set the state of the over current protection # get_status() - Get the state of the output and CC/CV

class Instruments_Libraries.RD3005.RD3005(resource_str, visa_library='@py', **kwargs)[source]

Bases: BaseInstrument

Parameters:
  • resource_str (str)

  • visa_library (str)

get_current_setting(channel=None)[source]

Returns the set current.

Parameters:

channel (Any, optional) – Ignored for RD3005 as it is a single-channel instrument.

Return type:

float

get_data()[source]

Returns a dictionary with the measured voltage and current.

Return type:

dict[str, float]

get_idn()[source]

Returns instrument identification.

Return type:

str

get_status()[source]

Returns a dictionary with the state of the output and CC/CV.

Return type:

dict[str, str]

get_voltage_setting(channel=None)[source]

Returns the set voltage.

Parameters:

channel (Any, optional) – Ignored for RD3005 as it is a single-channel instrument.

Return type:

float

measure_current(channel=None)[source]

Returns the measured current.

Parameters:

channel (Any, optional) – Ignored for RD3005 as it is a single-channel instrument.

Return type:

float

measure_power(channel=None)[source]

Returns the calculated measured power (voltage * current).

Parameters:

channel (Any, optional) – Ignored for RD3005 as it is a single-channel instrument.

Return type:

float

measure_voltage(channel=None)[source]

Returns the measured voltage.

Parameters:

channel (Any, optional) – Ignored for RD3005 as it is a single-channel instrument.

Return type:

float

query(command, delay=0.05)[source]

Send a query and return the response string. Override for Korad supplies to read buffer without termination characters.

Parameters:
  • command (str)

  • delay (float)

Return type:

str

set_current(channel=None, current=0.0, **kwargs)[source]
Parameters:
  • channel (Any, optional) – Ignored for RD3005 as it is a single-channel instrument. Included for interface compatibility.

  • current (float) – Set the current on the Display

  • **kwargs (dict) – Optional keyword arguments like ‘delay’.

Return type:

None

set_current_limit(channel=None, current=0.0, **kwargs)
Parameters:
  • channel (Any, optional) – Ignored for RD3005 as it is a single-channel instrument. Included for interface compatibility.

  • current (float) – Set the current on the Display

  • **kwargs (dict) – Optional keyword arguments like ‘delay’.

Return type:

None

set_ocp(state)[source]
Parameters:

state (str (ON/OFF)) – Set the state of the overcurrent protection ON and OFF

Return type:

None

set_output(channel=None, state='OFF')[source]
Parameters:
  • channel (Any, optional) – Ignored for RD3005 as it is a single-channel instrument. Included for interface compatibility.

  • state (str (ON/OFF)) – Turn Output ON and OFF

Return type:

None

set_voltage(channel=None, voltage=0.0, **kwargs)[source]
Parameters:
  • channel (Any, optional) – Ignored for RD3005 as it is a single-channel instrument. Included for interface compatibility.

  • voltage (float) – Set the voltage on the Display

  • **kwargs (dict) – Optional keyword arguments like ‘delay’.

Return type:

None