Dec-15-2017, 03:29 PM
I'm trying to send series of bits to the signal generator (agilent 81150) by using the code below, and i'd like to represent them to the scope connected to the signal generator.
But its not working, someone know whats got wrong?
import visa
import time,os,math
import random
size_of_memory=5000
rm=visa.ResourceManager()
list_of_instruments=rm.list_resources()
funcgen_inst=rm.open_resource(list_of_instruments[0])
bits = [1,1,0,0,1,0,1,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,0]
funcgen_inst.write('*RST')
funcgen_inst.write('DATA:DEL:ALL')
bits_for_funcgen_inst=':DATA:DAC VOLATILE'
# Writing the sequence to the 81150
for i in range(len(bits)):
bits_for_funcgen_inst=bits_for_funcgen_inst+', '+str(bits)
funcgen_inst.write(bits_for_funcgen_inst)
funcgen_inst.write(':DATA:COPY ARB_1')
# choosing the output in the 81150
funcgen_inst.write(':FUNC1:USER ARB_1')
tau_c = "0.2"
funcgen_inst.write(':APPL1:USER ' + tau_c + ', 5, 0')
But its not working, someone know whats got wrong?
import visa
import time,os,math
import random
size_of_memory=5000
rm=visa.ResourceManager()
list_of_instruments=rm.list_resources()
funcgen_inst=rm.open_resource(list_of_instruments[0])
bits = [1,1,0,0,1,0,1,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,0]
funcgen_inst.write('*RST')
funcgen_inst.write('DATA:DEL:ALL')
bits_for_funcgen_inst=':DATA:DAC VOLATILE'
# Writing the sequence to the 81150
for i in range(len(bits)):
bits_for_funcgen_inst=bits_for_funcgen_inst+', '+str(bits)
funcgen_inst.write(bits_for_funcgen_inst)
funcgen_inst.write(':DATA:COPY ARB_1')
# choosing the output in the 81150
funcgen_inst.write(':FUNC1:USER ARB_1')
tau_c = "0.2"
funcgen_inst.write(':APPL1:USER ' + tau_c + ', 5, 0')