Python SCPI: binary acquisition

Applications, development tools, FPGA, C, WEB
Post Reply
tttt
Posts: 1
Joined: Wed Apr 25, 2018 4:16 pm

Python SCPI: binary acquisition

Post by tttt » Wed Apr 25, 2018 4:43 pm

I'm trying to acquire data from a fast analog output as continuously as possible using Python and the redpitaya_scpi.py module.
If I acquire ascii data, the delay time between successive acquisitions (with decimation = 1) is 250 ms.
What I do is:

Code: Select all

rp_s.tx_txt('ACQ:RST')
rp_s.tx_txt('ACQ:START')
rp_s.tx_txt('ACQ:TRIG NOW')
rp_s.tx_txt('ACQ:SOUR2:DATA?')
buff_string = rp_s.rx_txt()
buff_string = buff_string.strip('{}\n\r').replace("  ", "").split(',')
buff = list(map(float, buff_string))
I red around that it would be much faster if I could acquire in binary format, but if I read the buffer, the result is a boolean False.

Code: Select all

rp_s.tx_txt('ACQ:RST')
rp_s.tx_txt('ACQ:DATA:UNITS VOLTS')
rp_s.tx_txt('ACQ:DATA:FORMAT BIN')
rp_s.tx_txt('ACQ:START')
rp_s.tx_txt('ACQ:TRIG NOW')
rp_s.tx_txt('ACQ:SOUR2:DATA?')
databin = rp_s.rx_arb()
In fact, if we look inside the function rp_s.rx_arb(), this is returning False if the first bit that the socket return is:

Code: Select all

b'#'
This is indeed the only thing that the socket read in the buffer.

The two sequences are identical, except for the requested data format. Why can I read ascii data and not binary? What am I doing wrong?
Thanks in advance

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: Google [Bot] and 6 guests