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.