Strange results wave generator via scpi

Tell us how your experiment is running with Red Pitaya
Post Reply
matthijsfh
Posts: 7
Joined: Wed Jun 23, 2021 12:09 pm

Strange results wave generator via scpi

Post by matthijsfh » Wed Jun 23, 2021 6:38 pm

Hai,

I'm confused about the results I am getting when trying to make a signal via the AWG (output 1) and reading it back via input 1.

Image is attached.
Image

Code is below and *should* generate a sine with 2 periods. But the measurement goes completely wrong.

Any ideas are welcome!

Greetings Matthijs

Code: Select all

#!/usr/bin/python

import time
import sys
import redpitaya_scpi as scpi
import matplotlib.pyplot as plot

rp_s = scpi.scpi("192.168.3.150")

rp_s.tx_txt('GEN:RST');
rp_s.tx_txt('SOUR1:FUNC SINE');                                                 
rp_s.tx_txt('SOUR1:FREQ:FIX 1000')
rp_s.tx_txt('SOUR1:VOLT 1');  

rp_s.tx_txt('SOUR1:BURS:STAT BURST')
rp_s.tx_txt('SOUR1:BURS:NCYC 1')  
rp_s.tx_txt('SOUR1:BURS:NOR 1')  

rp_s.tx_txt('SOUR1:TRIG:SOUR INT')

rp_s.tx_txt('OUTPUT1:STATE ON')

rp_s.tx_txt('ACQ:RST');
rp_s.tx_txt('ACQ:DEC 64')
rp_s.tx_txt('ACQ:TRIG:DLY 0')
rp_s.tx_txt('ACQ:TRIG:LEV 0')

rp_s.tx_txt('ACQ:START');
rp_s.tx_txt('ACQ:TRIG AWG_PE');

time.sleep(1)
rp_s.tx_txt('SOUR1:TRIG:IMM')


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

time.sleep(1)

rp_s.tx_txt('ACQ:SOUR1:DATA?')
buff_string = rp_s.rx_txt()
buff_string = buff_string.strip('{}\n\r').replace("  ", "").split(',')
buff = list(map(float, buff_string))

rp_s.close()

plot.plot(buff)
plot.ylabel('Voltage')
plot.show()



matthijsfh
Posts: 7
Joined: Wed Jun 23, 2021 12:09 pm

Re: Strange results wave generator via scpi

Post by matthijsfh » Wed Jun 23, 2021 7:02 pm

Oke, this code does work now. Very strange experience.

Code: Select all

rp_s = scpi.scpi("192.168.3.150")

rp_s.tx_txt('GEN:RST');
rp_s.tx_txt('ACQ:RST');

rp_s.tx_txt('SOUR1:FUNC SINE');                                                 
rp_s.tx_txt('SOUR1:FREQ:FIX 100000')
rp_s.tx_txt('SOUR1:VOLT 1');  

rp_s.tx_txt('SOUR1:BURS:STAT ON')
rp_s.tx_txt('SOUR1:BURS:NCYC 2')  

rp_s.tx_txt('ACQ:DEC 32')
rp_s.tx_txt('ACQ:TRIG:DLY 0')
rp_s.tx_txt('ACQ:TRIG:LEV 0')

rp_s.tx_txt('ACQ:START');
time.sleep(1)
rp_s.tx_txt('ACQ:TRIG AWG_PE');
time.sleep(0.1)
rp_s.tx_txt('OUTPUT1:STATE ON')

User avatar
redpitaya
Site Admin
Posts: 535
Joined: Wed Mar 26, 2014 7:04 pm

Re: Strange results wave generator via scpi

Post by redpitaya » Wed Jul 28, 2021 12:27 pm

We suggest using the official example
https://redpitaya.readthedocs.io/en/lat ... -exm3.html

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 1 guest