Signal Generators#

Rigol#

This module contains the instrument classes for rigol signal generators.

class techconnect.signal_generators.rigol.DG1000[source]#

Class representing the DG1000 signal generator.

Parameters:
None
Attributes:
query_delayint

The delay time (in seconds) for SCPI query commands.

Methods

query_apply(channel)

Queries the signal generator for the current applied settings on the specified channel.

turnOn(channel)

Turns on the output for the specified channel.

turnOff(channel)

Turns off the output for the specified channel.

setupSine(frequency, amplitude_pp, offset=0, phase=0, channel=1)

Sets up the signal generator to produce a sine wave on the specified channel.

setupFunc(func, frequency, amplitude_pp, offset=0, phase=0, channel=1)

Sets up the signal generator to produce a user-defined function waveform on the specified channel.

check_errors()#

Check for errors by querying the SCPI and handling the returned error.

close_device()#

Closes the device.

This function clears the instrument and then closes the connection to the device.

connect(address)#

Connects to an instrument at the specified address.

initialise_device()#

Initializes the device.

This function is responsible for initializing the device. It clears any existing data on the instrument.

list_connections(verbose=True)#

List connections and print the resource information if verbose is True. Otherwise, print only the resource names.

query_SCPI(query: str)#

Execute a SCPI query command and return the response.

query_apply(channel)[source]#

Query applied settings to a specific channel.

Parameters:
channelint

The channel number.

Returns:
str

The query response.

setupFunc(func: str, frequency, amplitude_pp, offset=0, phase=0, channel=1)[source]#

Set up the function parameters for generating a waveform on a specific channel of the instrument.

Parameters:
funcstr

The type of waveform to generate.

frequencyfloat

The frequency of the waveform in Hz.

amplitude_ppfloat

The peak-to-peak amplitude of the waveform in volts.

offsetfloat, optional

The DC offset of the waveform in volts. Defaults to 0.

phasefloat, optional

The phase shift of the waveform in degrees. Defaults to 0.

channelint, optional

The channel number to generate the waveform on. Defaults to 1.

Returns:
None
setupSine(frequency, amplitude_pp, offset=0, phase=0, channel=1)[source]#

Set up the sine wave generator with the specified parameters.

Parameters:
frequencyfloat

The frequency of the sine wave in Hz.

amplitude_ppfloat

The peak-to-peak amplitude of the sine wave in volts.

offsetfloat, optional

The DC offset of the sine wave in volts. Defaults to 0.

phasefloat, optional

The phase of the sine wave in degrees. Defaults to 0.

channelint, optional

The channel number. Defaults to 1.

Returns:
None
turnOff(channel)[source]#

Turns off the specified channel.

Parameters:
channelint

The channel number to turn off. Valid values are 1 and 2.

Returns:
None

This function does not return anything.

turnOn(channel)[source]#

Turn on the specified channel.

Parameters:
channelint

The channel to turn on. Must be either 1 or 2.

Returns:
None
write_SCPI(command: str)#

Writes an SCPI command to the instrument.

write_lines(lines)#

Writes a list of lines to the device.

class techconnect.signal_generators.rigol.DG4000[source]#

Class representing the DG4000 signal generator.

Parameters:
None
Attributes:
query_delayfloat

The delay time (in seconds) for SCPI query commands.

Methods

query_apply()

Query the applied settings on the signal generator.

turnOn(channel)

Turn on the output for the specified channel.

turnOff(channel)

Turn off the output for the specified channel.

setupSine(frequency, amplitude_pp, offset=0, phase=0, channel=1)

Set up the signal generator to produce a sine wave on the specified channel.

setupFunc(func, frequency, amplitude_pp, offset=0, phase=0, channel=1)

Set up the signal generator to produce a user-defined function waveform on the specified channel.

setupSweep(start_frequency, stop_frequency, amplitude_pp, sweep_time, return_time=0, spacing=’LINEAR’, trigger_source=’INTERNAL’, channel=1)

Set up the signal generator to produce a sweep waveform on the specified channel.

setupAM(frequency, function, depth=100, channel=1)

Set up the signal generator to produce an amplitude-modulated waveform on the specified channel.

setupRamp(frequency, amplitude_pp, offset=0, phase=0, channel=1, symmetry=50)

Set up the signal generator to produce a ramp waveform on the specified channel.

check_errors()#

Check for errors by querying the SCPI and handling the returned error.

close_device()#

Closes the device.

This function clears the instrument and then closes the connection to the device.

connect(address)#

Connects to an instrument at the specified address.

initialise_device()#

Initializes the device.

This function is responsible for initializing the device. It clears any existing data on the instrument.

list_connections(verbose=True)#

List connections and print the resource information if verbose is True. Otherwise, print only the resource names.

query_SCPI(query: str)#

Execute a SCPI query command and return the response.

query_apply()[source]#

Query applied settings to a specific channel.

Parameters:
channelint

The channel number.

Returns:
str

The query response.

setupAM(frequency, function, depth=100, channel=1)[source]#

Sets up the amplitude modulation (AM) for a specific frequency, function, depth, and channel.

Parameters:
frequencyfloat

The frequency of the AM signal.

functionstr

The function used for the AM modulation.

depthfloat, optional

The depth of the AM modulation. Defaults to 100%.

channelint, optional

The channel number. Defaults to 1.

Returns:
str
The applied AM settings.
setupFunc(func: str, frequency, amplitude_pp, offset, phase, channel, delay=0)[source]#

Set up the function parameters for generating a waveform on a specific channel of the instrument.

Parameters:
funcstr

The type of waveform to generate, (‘SIN’, ‘RAMP’, ‘HARMONIC’, ‘NOISE’, ‘PULSE’, ‘SQUARE’ or ‘CUSTOM’).

frequencyfloat

The frequency of the waveform in Hz.

amplitude_ppfloat

The peak-to-peak amplitude of the waveform in volts.

offsetfloat

The DC offset of the waveform in volts.

phasefloat

The phase shift of the waveform in degrees.

channelint

The channel number to generate the waveform on.

delayfloat, optional

The delay time (in seconds) for a pulse waveform. Defaults to 0.

Returns:
str

The applied settings.

setupRamp(frequency, amplitude_pp, offset=0, phase=0, channel=1, symmetry=50)[source]#

Set up a ramp waveform on the specified channel.

Parameters:
frequencyfloat

The frequency of the ramp waveform in Hz.

amplitude_ppfloat

The peak-to-peak amplitude of the ramp waveform in volts.

offsetfloat, optional

The DC offset of the ramp waveform in volts. Defaults to 0.

phasefloat, optional

The phase offset of the ramp waveform in degrees. Defaults to 0.

channelint, optional

The channel number to set up the ramp waveform on. Defaults to 1.

symmetryint, optional

The symmetry percentage of the ramp waveform. Defaults to 50.

Returns:
str

The applied ramp settings.

setupSine(frequency, amplitude_pp, offset=0, phase=0, channel=1)[source]#

Set up the sine wave generator with the specified parameters.

Parameters:
frequencyfloat

The frequency of the sine wave in Hz.

amplitude_ppfloat

The peak-to-peak amplitude of the sine wave in volts.

offsetfloat, optional

The DC offset of the sine wave in volts. Defaults to 0.

phasefloat, optional

The phase of the sine wave in degrees. Defaults to 0.

channelint, optional

The channel number. Defaults to 1.

Returns:
str

The applied sine wave settings.

setupSweep(start_frequency, stop_frequency, amplitude_pp, sweep_time, return_time=0, spacing='LINEAR', trigger_source='INTERNAL', channel=1)[source]#

Sets up a sweep on a specified channel of the instrument.

Parameters:
start_frequencyfloat

The start frequency of the sweep.

stop_frequencyfloat

The stop frequency of the sweep.

amplitude_ppfloat

The peak-to-peak amplitude of the sweep.

sweep_timefloat

The duration of the sweep.

return_timefloat, optional

The return time of the sweep. Defaults to 0.

spacingstr, optional

The spacing of the sweep. Defaults to ‘LINEAR’.

trigger_sourcestr, optional

The trigger source of the sweep. Defaults to ‘INTERNAL’.

channelint, optional

The channel to set up the sweep on. Defaults to 1.

Returns:
str

The applied sweep settings.

turnOff(channel)[source]#

Turns off the specified channel.

Parameters:
channelint

The channel number to turn off. Valid values are 1 and 2.

Returns:
None

This function does not return anything.

turnOn(channel)[source]#

Turn on the specified channel.

Parameters:
channelint

The channel to turn on. Must be either 1 or 2.

Returns:
None
write_SCPI(command: str)#

Writes an SCPI command to the instrument.

write_lines(lines)#

Writes a list of lines to the device.

Agilent#

This module contains the instrument classes for Agilent signal generators.

class techconnect.signal_generators.agilent.Agilent33250A(gpib_address)[source]#

Class representing the Agilent 33250A signal generator.

Parameters:
gpib_addressint

The GPIB address of the signal generator.

Attributes:
query_delayfloat

The delay time (in seconds) for SCPI query commands.

gpib_addressint

The GPIB address of the signal generator.

Methods

query_apply()

Query the applied settings on the signal generator.

turnOn()

Turn on the output of the signal generator.

turnOff()

Turn off the output of the signal generator.

setupSine(frequency, amplitude_pp, offset=0, phase=0)

Set up the signal generator to produce a sine wave.

setupFunc(func, frequency, amplitude_pp, offset=0, phase=0)

Set up the signal generator to produce a user-defined function waveform.

check_errors()#

Check for errors by querying the SCPI and handling the returned error.

close_device()#

Closes the device.

This function clears the instrument and then closes the connection to the device.

connect(address)#

Connects to an instrument at the specified address.

initialise_device()#

Initializes the device.

This function is responsible for initializing the device. It clears any existing data on the instrument.

list_connections(verbose=True)#

List connections and print the resource information if verbose is True. Otherwise, print only the resource names.

query_SCPI(query: str)#

Send a query to the SCPI instrument and return the response.

query_apply()[source]#

Retrieves the current signal generator configuration by sending the SCPI command “APPLY?”.

Returns:
str

The response from the signal generator containing the current configuration.

setupFunc(func: str, frequency, amplitude_pp, offset=0, phase=0, channel=1)[source]#

Sets up a function on the instrument.

Parameters:
funcstr

The function to be set up.

frequency

The frequency of the function in Hz.

amplitude_pp

The peak-to-peak amplitude of the function in volts.

offsetfloat, optional

The DC offset of the function in volts. Defaults to 0.

phasefloat, optional

The phase offset of the function in degrees. Defaults to 0.

Returns:
str

The applied settings.

setupSine(frequency, amplitude_pp, offset=0, phase=0, channel=1)[source]#

Set up a sine wave function with the given parameters.

Parameters:
frequencyfloat

The frequency of the sine wave.

amplitude_ppfloat

The peak-to-peak amplitude of the sine wave.

offsetfloat, optional

The DC offset of the sine wave. Defaults to 0.

phasefloat, optional

The phase offset of the sine wave. Defaults to 0.

Returns:
str

The applied sine wave settings.

turnOff(channel=1)[source]#

Turns off the device.

Parameters:
None
Returns:
None
turnOn(channel=1)[source]#

Turns on the device.

Parameters:
None
Returns:
None
write_SCPI(command: str)#

Writes an SCPI command to the instrument.

write_lines(lines)#

Writes a list of lines to the device.