AnsweredAssumed Answered

SEQuence of waveforms from python script

Question asked by SuperCiocia on Jul 16, 2018

I want to program a SEQuence of "simple" waveforms remotely from a python script.


E.g. to begin with I would like a linear ramp followed by a sine.
I can do this by hand from the signal generator itself, but cannot get it to work from my python 2.7 console.


My code looks like this so far:


import time
import visa


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


# Admin
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

Then I know that I can make a Sine with:
wavegen.write('SOUR1:APPL:SIN 5 KHZ, 3.0 VPP, -2.5 V')

and a linear ramp with:

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

Does anyone know how to stack them into a DATA:SEQuence?