Unable to set/readout decimation factor
Posted: Tue Mar 07, 2017 5:19 pm
Hi,
I am reading some voltage and it is perfectly working fine!
But I am unable to change the decimation factor or read it out...
As soon as I want to do any of these options the script hangs..
Do I have to define the source?
This is not working for all parameters (or at least I tested some...)
Additionally can I handle the decimation factor as a variable (also in the code below).
Here is my code:
import sys
import redpitaya_scpi as scpi
import matplotlib.pyplot as plot
rp_s = scpi.scpi(sys.argv[1])
rp_s.tx_txt('ACQ:START')
rp_s.tx_txt('ACQ:TRIG NOW')
#set decimation factor
#rp_s.tx_txt('ACQ:DEC8')
#would this be possible for a defined variable?:
#rp_s.tx_txt('ACQ:DEC'+str(DecimationFactor))
#readout decimation factor
rp_s.tx_txt('ACQ:DEC?')
dec = rp_s.rx_txt()
print(dec)
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()
buff_string = buff_string.strip('{}\n\r').replace(" ", "").split(',')
buff = list(map(float, buff_string))
plot.plot(buff)
plot.ylabel('Voltage')
plot.show()
maybe one can help me!
Thanks
I am reading some voltage and it is perfectly working fine!
But I am unable to change the decimation factor or read it out...
As soon as I want to do any of these options the script hangs..
Do I have to define the source?
This is not working for all parameters (or at least I tested some...)
Additionally can I handle the decimation factor as a variable (also in the code below).
Here is my code:
import sys
import redpitaya_scpi as scpi
import matplotlib.pyplot as plot
rp_s = scpi.scpi(sys.argv[1])
rp_s.tx_txt('ACQ:START')
rp_s.tx_txt('ACQ:TRIG NOW')
#set decimation factor
#rp_s.tx_txt('ACQ:DEC8')
#would this be possible for a defined variable?:
#rp_s.tx_txt('ACQ:DEC'+str(DecimationFactor))
#readout decimation factor
rp_s.tx_txt('ACQ:DEC?')
dec = rp_s.rx_txt()
print(dec)
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()
buff_string = buff_string.strip('{}\n\r').replace(" ", "").split(',')
buff = list(map(float, buff_string))
plot.plot(buff)
plot.ylabel('Voltage')
plot.show()
maybe one can help me!
Thanks