SCPI command question about ACQ:DATA:FORMAT

Just about everything about Red Pitaya
Post Reply
raptrick
Posts: 2
Joined: Thu Feb 11, 2016 10:03 pm

SCPI command question about ACQ:DATA:FORMAT

Post by raptrick » Fri Feb 12, 2016 9:58 pm

Hello All,

I'm trying to speed up the read out process of a recorded trace. Here I want to avoid ascii read out since it is very inefficient. I'm looking for a binary read. The change in format might bring up some clues.

For the command ACQ:DATA:FORMAT, what is the difference between parameter ASCII and FLOAT?

What is then the precision of FLOAT?

If I read data in ASCII, can I reread the same data in FLOAT for verification purposes?

Thanks in advanced.

Patrick

Nils Roos
Posts: 1441
Joined: Sat Jun 07, 2014 12:49 pm
Location: Königswinter

Re: SCPI command question about ACQ:DATA:FORMAT

Post by Nils Roos » Fri Feb 12, 2016 10:51 pm

Well, it looks like you found another inconsistency in the documentation of the scpi-server.

The actual options for ACQ:DATA:FORMAT are ASCII and BIN.

In ASCII mode, the values are floating point voltages that are calibrated with the DC offset and gain. The precision is that of the C type float.
In BIN mode, the values are 16bit two's complement ADC count values that are calibrated with DC offset only and then clamped to [-8192..8191].

You should be able to read the same data again in the new format after switching.

raptrick
Posts: 2
Joined: Thu Feb 11, 2016 10:03 pm

Re: SCPI command question about ACQ:DATA:FORMAT

Post by raptrick » Fri Feb 12, 2016 11:34 pm

thank you!!

JohnnyMalaria
Posts: 28
Joined: Fri Apr 28, 2017 12:43 am

Re: SCPI command question about ACQ:DATA:FORMAT

Post by JohnnyMalaria » Tue Aug 08, 2017 5:21 pm

I can't get this to work.

If I do this:

Code: Select all

rp_s.tx_txt('ACQ:RST')
rp_s.tx_txt('ACQ:DATA:UNITS RAW')
rp_s.tx_txt('ACQ:DATA:FORMAT BIN')
rp_s.tx_txt('ACQ:DEC 65536')
rp_s.tx_txt('ACQ:TRIG:LEVEL 100')
rp_s.tx_txt('ACQ:TRIG:DLY 8192')
rp_s.tx_txt('ACQ:START')
rp_s.tx_txt('ACQ:TRIG NOW')

while 1:
    rp_s.tx_txt('ACQ:TRIG:STAT?')
    if rp_s.rx_txt() == 'TD':
        break

rp_s.tx_txt('ACQ:SOUR1:DATA?')
buff_string = rp_s.rx_txt()
then it stalls indefinitely at the last SCPI command.

Using

Code: Select all

rp_s.tx_txt('ACQ:DATA:UNITS FLOAT')
instead of RAW (or omitting the ACQ:DATA:UNITS command completely) gives the following error in redpitaya_scpi.py:
File "C:\...\redpitaya_scpi.py", line 35, in rx_txt
chunk = self._socket.recv(chunksize + len(self.delimiter)).decode('utf-8') # Receive chunk size of 2^n preferably

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xae in position 8: invalid start byte
What am I doing wrong?

Thanks,

John.

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 19 guests