discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss-gnuradio] Incrementing a Variable during Run


From: Paul Opitz
Subject: [Discuss-gnuradio] Incrementing a Variable during Run
Date: Wed, 24 May 2017 16:09:17 +0000 (UTC)

I'm working on a project to test some antennas for relative receive performance. Doing this by transmitting on a HackRF and receiving with another SDR. I have a working GRC flow that allows me to manually step through (using a WX_Slider) a set of test frequencies. I would like to automate this by adding the following code to the top_block.py file:

for chan in range(20,1200,5):
    chan_freq = chan * 1e6
time.sleep(.2)

(i.e. stepping variable chan_freq through 20MHz - 1.2GHz in 5 MHz increments every 200 mS)

I found a reply to a similar question in this list to putting this in the main module between the tb.start() and tb.stop() calls. However, my generated code does not have that. The entirety of my main is:

tb = top_block_cls()
tb.Start(True)
tb.Wait()

I've also tried adding it to the set_chan_freq def, but it never seems to execute. I really thought this would be stupid easy (and it probably is...).

Thanks in advance.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]