How to write data from analog input to buffer and read it with python

Applications, development tools, FPGA, C, WEB
Post Reply
nebraska
Posts: 1
Joined: Thu Mar 19, 2020 5:04 pm

How to write data from analog input to buffer and read it with python

Post by nebraska » Thu Mar 19, 2020 5:21 pm

I am really confused because I tried to access data from one analog input (AIN0) for hours. The examples in the docs are not working and I cant find examples anywhere else. I am very new to this all, so maybe its just a simple question.

I managed to connect to the redpitaya and with visa I can do the blink example. I can also read one value from the AIN0 with:
query_ascii_values('ANALOG:PIN? AIN0')
But the visa examples are not working with the SCPI commands. So I tried the some commands from the supported ones in the docs. I started acquiring and triggerd. Afterwards I tried to read the buffer:
query('ACQ:SOUR4:DATA?')
But what is it reading? What are the 4 Sources? How can I write Data from AIN0 to buffer and read it afterwards? Is the trigger starting writing in the buffer or is it selecting the reading time?

Thank you very much for reply!

crosepet
Posts: 2
Joined: Mon Feb 08, 2016 12:57 am

Re: How to write data from analog input to buffer and read it with python

Post by crosepet » Fri Mar 27, 2020 2:52 pm

I have the same problem with the Jupyter script and it seems that the problem persist for over a year now. Several users have asked about it and as far as I see the RedPitaya folks do not provide any answers.
Their quickstart guide is 3 years old and refers to commands that seem to no exist any more.

crosepet
Posts: 2
Joined: Mon Feb 08, 2016 12:57 am

Re: How to write data from analog input to buffer and read it with python

Post by crosepet » Sat Mar 28, 2020 12:27 am

Problem solved, I think.

The overlay "mercury.py" has an error in it. The file is located on my machine in the directory:
/home/jupyter/RedPitaya/redpitaya/overlay

In the class analog_in() is a statement
dev = ctx.devices[3]
Change the 3 to 0: dev = ctx.devices[0]

That worked for me.

Post Reply
jadalnie klasyczne ekskluzywne meble wypoczynkowe do salonu ekskluzywne meble tapicerowane ekskluzywne meble do sypialni ekskluzywne meble włoskie

Who is online

Users browsing this forum: No registered users and 40 guests