1
\$\begingroup\$

I have a Keysight 33500B signal generator and I would like to remotely program arbitrary (ARB) waveforms that consist of existing signals in the device's library, from a python script.

For example I would like a linear ramp followed by a sine.

I know how to generate the sine and a ramp.

How do I make a combined waveform of the two sub-waveforms, and then trigger the device to generate the combined output?

--

Code:

import time
from scipy import signal
from scipy.signal import chirp
import scipy as sp
import numpy as np 
import array
import matplotlib.pyplot as plt # import matplotlib.pyplot as plot
import visa 

# Waveform Genertor 
rm = visa.ResourceManager()
wavegen = rm.open_resource('TCPIP0::172.31.10.41::inst0::INSTR');

# Admin
wavegen.query("*IDN?")
wavegen.write('*RST;*CLS;*OPC?') #reset instrument
time.sleep(2) #wait 2 seconds for the reset to complete
wavegen.write('SOUR1:DATA:VOL:CLE') #clear volatile waveforms
wavegen.write('SOUR1:FUNC ARB') #tell the instrument to use the arb feature

dataString = "DATA:ARB STACK"

wavegen.write('SOUR1:APPL:SIN 5 KHZ, 3.0 VPP, -2.5 V')

To make a ramp, I can just write:

wavegen.write('SOUR1:APPL:RAMP 1 KHZ, 1 V, 2.5 V')
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.