Python Forum
send bits to the signal generator
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
send bits to the signal generator
#1
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')
Reply
#2
(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.
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply
#3
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 :)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Is it possible to extract 1 or 2 bits of data from MS project files? cubangt 8 1,073 Feb-16-2024, 12:02 AM
Last Post: deanhystad
  How to rotate bits ? korenron 2 1,645 Mar-23-2022, 04:05 PM
Last Post: Larz60+
  From list of bits to PDF drimades 1 1,924 Nov-02-2021, 08:55 PM
Last Post: Gribouillis
Exclamation Help in breaking bytes into bits through masking and shifting kamui123 9 4,598 Jan-11-2021, 07:42 AM
Last Post: kamui123
  rounding floats to a number of bits Skaperen 2 2,324 Sep-13-2019, 04:37 AM
Last Post: Skaperen
  receive from a generator, send to a generator Skaperen 9 5,532 Feb-05-2018, 06:26 AM
Last Post: Skaperen
  Problem with Pycharm 64 bits sylas 12 10,281 Jan-22-2018, 02:19 PM
Last Post: sparkz_alot
  How to convert python files from 32 bits tto 64 bits sylas 2 5,104 Oct-29-2017, 03:51 AM
Last Post: Larz60+
  Facing an issue in doing 'unittest.installHandler()' which will send 'stop' signal to hmarne 3 4,184 Jan-24-2017, 05:03 PM
Last Post: buran
  Why are two similar bits of code giving different results? godmode 10 9,981 Dec-15-2016, 09:53 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020