Python Forum

Full Version: send bits to the signal generator
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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')
(Dec-15-2017, 03:29 PM)liorjo Wrote: [ -> ]But its not working
is never useful information. If you are getting an error, post the error in its entirety (between the error tags). What output are you getting vs output you are expecting. Is the connection to the device working? The more information you can supply, the greater chance you will have of getting a useful response.
i will have an access to the signal generator in the university lab.
now i just need help to write the right script and i'll check it in the university.

help me please :)