class documentation

class DG2052(pyvisa.resources.MessageBasedResource):

Constructor: DG2052(port)

View In Hierarchy

This is an object representing the Rigol DG2052 function generator. This object uses the SCPI protocol for communicating with the Rigol DG2052 function generator.

Method __init__ Initializes the DG2052 object
Method get_output_impedance Undocumented
Method get_output_load Undocumented
Method get_output_signal Undocumented
Method get_output_state Undocumented
Method get_output_volt_limits Gets the output volt limits of the specified channel
Method is_output_on Undocumented
Method set_dc Undocumented
Method set_frequency Undocumented
Method set_output Sets the output channel ON or OFF
Method set_ramp Undocumented
Method set_sine_wave Undocumented
Method set_square_wave Undocumented
Method set_sweep Undocumented
Method toggle_output Undocumented
Method trigger_sweep Undocumented
Method whoami shows the identification of the connected instrument
Instance Variable comm The communication method used (either TCPIP or USB)
Instance Variable port The SCPI port describing the device, consists of a communication method and device port followed by the "::INSTR" keyword. communication method: can be either USB or TCPIP (other communication methods are not supported for this device) device port: either COMM4 or /dev/USB0 for USB in windows and posix systems respectively or the IP Address for TCPIP...
Instance Variable rm The resource manager object for pyvisa (for future use)
def __init__(self, port: str):

Initializes the DG2052 object

Parameters
port:str

The SCPI port describing the device, consists of a communication method and device port followed by the "::INSTR" keyword. communication method: can be either USB or TCPIP (other communication methods are not supported for this device) device port: either COMM4 or /dev/USB0 for USB in windows and posix systems respectively or the IP Address for TCPIP

format: "communication method::device port::INSTR"

example: "TCPI::192.168.1.11::INSTR" or "USB::COMM4::INSTR"

def get_output_impedance(self, channel: Literal[1, 2]) -> float:

Undocumented

def get_output_load(self, channel: Literal[1, 2]) -> float:

Undocumented

def get_output_signal(self, channel: Literal[1, 2]) -> str:

Undocumented

def get_output_state(self, channel: Literal[1, 2]) -> str:

Undocumented

def get_output_volt_limits(self, channel: Literal[1, 2]) -> tuple[float, float]:

Gets the output volt limits of the specified channel

Parameters
channel:Literal[1, 2]The output channel of the device (either 1 or 2)
Returns
tuple[float, float]The low voltage limit and the hight voltage limit
def is_output_on(self, channel: Literal[1, 2]) -> bool:

Undocumented

def set_dc(self, channel: Literal[1, 2], offset: float):

Undocumented

def set_frequency(self, channel: Literal[1, 2], freq):

Undocumented

def set_output(self, channel: Literal[1, 2], state: bool):

Sets the output channel ON or OFF

Parameters
channel:Literal[1, 2]The output channel of the device (either 1 or 2)
state:boolThe state of the output channel
def set_ramp(self, channel: Literal[1, 2], freq: float = 1000.0, amp: float = 5, offset: float = 0, phase: int = 0):

Undocumented

def set_sine_wave(self, channel: Literal[1, 2], freq: float = 1000.0, amp: float = 5.0, offset: float = 0.0, phase: int = 0):

Undocumented

def set_square_wave(self, channel: Literal[1, 2], freq: float = 1000.0, amp: float = 5.0, offset: float = 0.0, phase: int = 0):

Undocumented

def set_sweep(self, channel: Literal[1, 2], amp: float = 5, offset: float = 0, phase: int = 0, signal_type: SweepSignalType = SweepSignalType.SINE, htime_start: float = 0, htime_stop: float = 0, freq_start: float = 100, freq_stop: float = 1000.0, marker: bool = False, freq_marker: float = 550, rtime: float = 0, time: float = 1, spacing: SweepSpacing = SweepSpacing.LIN, step: int = 2, trigger_slope: SweepTriggerSlope = SweepTriggerSlope.POSITIVE, trigger_source: SweepTriggerSource = SweepTriggerSource.INTERNAL):

Undocumented

def toggle_output(self, channel: Literal[1, 2]):

Undocumented

def trigger_sweep(self, channel: Literal[1, 2]):

Undocumented

def whoami(self) -> str:

shows the identification of the connected instrument

Returns
strThe identification of the connected instrument

The communication method used (either TCPIP or USB)

port: str =

The SCPI port describing the device, consists of a communication method and device port followed by the "::INSTR" keyword. communication method: can be either USB or TCPIP (other communication methods are not supported for this device) device port: either COMM4 or /dev/USB0 for USB in windows and posix systems respectively or the IP Address for TCPIP

format: "<communication method>::<device port>::INSTR"

example: "TCPI::192.168.1.11::INSTR" or "USB::COMM4::INSTR"

rm: ResourceManager =

The resource manager object for pyvisa (for future use)