Using the acquisition channels as a trigger for generating pulses
Posted: Thu Mar 09, 2023 4:13 pm
Hi!
I'm new to working with the Red Pitaya and am currently having some issues with the trigger for the signal generator. I want to generate a signal from OUT1 based on a 10 Hz trigger-input on IN2.
I've tried the following however the time between input and output seems very large and not consistent (10-30 ms). Am I doing something wrong or is there another way of doing this?
I'm new to working with the Red Pitaya and am currently having some issues with the trigger for the signal generator. I want to generate a signal from OUT1 based on a 10 Hz trigger-input on IN2.
I've tried the following however the time between input and output seems very large and not consistent (10-30 ms). Am I doing something wrong or is there another way of doing this?
Code: Select all
rp_s.tx_txt('GEN:RST')
rp_s.tx_txt('SOUR1:FUNC ARBITRARY')
rp_s.tx_txt('SOUR1:TRAC:DATA:DATA ' + waveform_ch_1)
rp_s.tx_txt('SOUR1:FREQ:FIX ' + str(freq))
rp_s.tx_txt('SOUR1:VOLT ' + str(Amp))
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('OUTPUT1:STATE ON')
#rp_s.tx_txt('SOUR1:TRIG:INT')
rp_s.tx_txt('ACQ:RST')
rp_s.tx_txt('ACQ:DATA:FORMAT ASCII')
rp_s.tx_txt('ACQ:DATA:UNITS VOLTS')
rp_s.tx_txt('ACQ:DEC 1')
rp_s.tx_txt('ACQ:TRIG:LEV 0.5')
rp_s.tx_txt('ACQ:START')
rp_s.tx_txt('ACQ:TRIG CH2_PE')
t1_start = time.perf_counter()
while 1:
rp_s.tx_txt('ACQ:TRIG:STAT?')
if rp_s.rx_txt() == 'TD':
t1_stop = time.perf_counter()
print("Elapsed time between trigs:",(t1_stop-t1_start))
# Trigger output
rp_s.tx_txt('SOUR1:TRIG:INT')
#Prepare ACQ
rp_s.tx_txt('ACQ:START')
rp_s.tx_txt('ACQ:TRIG CH2_PE')
print('Trigger happened!')
t1_start = time.perf_counter()