Fast Triggering with Python
Posted: Wed Jun 15, 2022 10:39 am
Hello everyone!
I'm starting to work with my redpitaya, and so far, everything is looking great. For the begining, I'm trying to send a signal on an analog output with an external trig. This is inspired by this example from the main page.
https://redpitaya.readthedocs.io/en/lat ... -exm3.html
All is neat and clean until I ramp up the trigger frequenc. At 5Hz, the redpitaya don't follow all the trig. 5Hz seems quite a low frequency so Im quite sure this is my way of commanding the board that is wrong.
Here is my python code.
Im pretty sure than this line is a key element:
It take around 80ms to compute. But I don't know what is a better way of writing this. Could you help me out?
I'm starting to work with my redpitaya, and so far, everything is looking great. For the begining, I'm trying to send a signal on an analog output with an external trig. This is inspired by this example from the main page.
https://redpitaya.readthedocs.io/en/lat ... -exm3.html
All is neat and clean until I ramp up the trigger frequenc. At 5Hz, the redpitaya don't follow all the trig. 5Hz seems quite a low frequency so Im quite sure this is my way of commanding the board that is wrong.
Here is my python code.
Code: Select all
import redpitaya_scpi as scpi
import sys
wave_form = 'sine'
freq = 100
ampl = 1
rp_s = scpi.scpi(sys.argv[1])
rp_s.tx_txt('ACQ:DEC 1')
rp_s.tx_txt('ACQ:TRIG:LEVEL 1000')
rp_s.tx_txt('ACQ:START')
rp_s.tx_txt('GEN:RST')
rp_s.tx_txt('SOUR1:FUNC ' + str(wave_form).upper())
rp_s.tx_txt('SOUR1:FREQ:FIX ' + str(freq))
rp_s.tx_txt('SOUR1:VOLT ' + str(ampl))
rp_s.tx_txt('OUTPUT1:STATE ON')
while 1:
rp_s.tx_txt('SOUR1:BURS:NCYC 2')
rp_s.tx_txt('SOUR1:BURS:STAT BURST')
rp_s.tx_txt('SOUR1:TRIG:SOUR EXT_PE')
rp_s.tx_txt('ACQ:START')
rp_s.tx_txt('ACQ:TRIG EXT_NE')
while 1:
rp_s.tx_txt('ACQ:TRIG:STAT?')
status = rp_s.rx_txt()
if status == 'TD':
break
Code: Select all
status = rp_s.rx_txt()