External trigger pin DIO0_P
Posted: Tue May 23, 2023 1:50 pm
Hi guys,
I would be happy if you help me with this problem. I want to trigger and synchronised the Output1 triangle pulse with 20hz frequency by the external trigger in STEAMlab125_10(14). So, I chose the external trigger positive edge Mose for my output1 in rigger section, then I connected the pin3 (DIO0_P) pin to the function generator that makes a square pulse in 1Khz with almost 3 volt amplitude and 9 micro second pulse width. I wrote the below code ignorer to synchronise them but it did not work. Could you please help me to solve it.
Thanks
import redpitaya_scpi as scpi
import sys
rp_s = scpi.scpi(sys.argv[1])
rp_s.tx_txt('GEN:RST')
rp_s.tx_txt('DIG:PIN:DIR IN,DIO0_P')
rp_s.tx_txt('ACQ:TRIG:DIO:EDGE DIO0_P,EXT_PE')
rp_s.tx_txt('SOUR1:FUNC TRIANGLE')
rp_s.tx_txt('SOUR1:FREQ:FIX 500')
rp_s.tx_txt('SOUR1:VOLT 1')
rp_s.tx_txt('OUTPUT1:STATE ON')
rp_s.tx_txt('SOUR1:TRIG EXT_PE')
pulse_count = 0
while True:
# Check GPIO status
gpio_status = rp_s.tx_txt('DIG:PIN? DIO0_P')
print("GPIO Status:", gpio_status)
trigger_status = rp_s.tx_txt('ACQ:TRIG:STAT?')
print("Trigger Status:", trigger_status)
# Check if trigger occurred
if gpio_status == '1':
pulse_count += 1
if pulse_count >= 50:
pulse_count = 0
rp_s.tx_txt('SOUR1:BURS:NCYC 1')
rp_s.tx_txt('SOUR1:BURS:STAT BURST')
rp_s.close()
I would be happy if you help me with this problem. I want to trigger and synchronised the Output1 triangle pulse with 20hz frequency by the external trigger in STEAMlab125_10(14). So, I chose the external trigger positive edge Mose for my output1 in rigger section, then I connected the pin3 (DIO0_P) pin to the function generator that makes a square pulse in 1Khz with almost 3 volt amplitude and 9 micro second pulse width. I wrote the below code ignorer to synchronise them but it did not work. Could you please help me to solve it.
Thanks
import redpitaya_scpi as scpi
import sys
rp_s = scpi.scpi(sys.argv[1])
rp_s.tx_txt('GEN:RST')
rp_s.tx_txt('DIG:PIN:DIR IN,DIO0_P')
rp_s.tx_txt('ACQ:TRIG:DIO:EDGE DIO0_P,EXT_PE')
rp_s.tx_txt('SOUR1:FUNC TRIANGLE')
rp_s.tx_txt('SOUR1:FREQ:FIX 500')
rp_s.tx_txt('SOUR1:VOLT 1')
rp_s.tx_txt('OUTPUT1:STATE ON')
rp_s.tx_txt('SOUR1:TRIG EXT_PE')
pulse_count = 0
while True:
# Check GPIO status
gpio_status = rp_s.tx_txt('DIG:PIN? DIO0_P')
print("GPIO Status:", gpio_status)
trigger_status = rp_s.tx_txt('ACQ:TRIG:STAT?')
print("Trigger Status:", trigger_status)
# Check if trigger occurred
if gpio_status == '1':
pulse_count += 1
if pulse_count >= 50:
pulse_count = 0
rp_s.tx_txt('SOUR1:BURS:NCYC 1')
rp_s.tx_txt('SOUR1:BURS:STAT BURST')
rp_s.close()