Re: TDMA question

Eric

So, currently, among time stamping, isn’t latency in configuring the
blocks a
limitation? Perhaps the m-blocks will help with that, but I wasn’t
sure. And
I am assuming that you have to do some kind of hardware change (for a
TDMA
case) while the flow graph is running (at the very least turning a
transmitter
on / off, or changing the frequencies periodically). in some systems it
might
be appropriate to “give up” some slots to reconfig, but is this what you
had in
mind? Is the plan still to have m-blocks around in December?
Currently, I have
been thinking about reconfiguration using the GNU Radio blocks as they
are (e.g.
changing frequency, turning the transmitter on / off, etc.),and I found
that the
latency was up to 1ms to turn the transmitter on using the ‘set_enable’
command
(meaning the latency between setting the enable
and moving on to other Python functions with GNU radio set to the
highest
priority). Does this sound reasonable? Is is processor/OS dependent?
The
code I used to test just turning the transmitter on and off is below. I
am
also getting a warning with the destructor of the flex boards (The
output of
the code is below) Could someone please help?

Thanks for your comment in advance,

David S.

from gnuradio import usrp, gr
import time

#print “directory”, dir(usrp)
class benchmark_test(gr.flow_graph):
def init(self):
gr.flow_graph.init(self)

	#USRP RX
	self.decim = 128
	self.rx_u = usrp.source_c()
	adc_rate = self.rx_u.adc_rate()
    	self.rx_u.set_decim_rate(self.decim)
    	rx_subdev_spec = (0,0)
    	self.rx_subdevice = usrp.selected_subdev(self.rx_u, 

rx_subdev_spec)
self.rx_subdevice.set_auto_tr(True)
print “Using RX d’board %s” %
(self.rx_subdevice.side_and_name(),)
self.rx_u.set_mux(usrp.determine_rx_mux_value(self.rx_u,
rx_subdev_spec))
self.rx_u.tune(self.rx_subdevice._which, self.rx_subdevice,900e6)
self.null = gr.null_sink(gr.sizeof_gr_complex)

	#USRP TX
	self.tx_u = usrp.sink_c ()
	dac_rate = self.tx_u.dac_rate();
	tx_usb_rate = 500e3
	usrp_interp = int(dac_rate // tx_usb_rate)
	self.tx_u.set_interp_rate(usrp_interp)
	tx_subdev_spec = (0,0)
    	self.tx_sd = usrp.selected_subdev(self.tx_u, tx_subdev_spec)
	self.tx_sd.set_auto_tr(True)
	print "Using TX d-board", self.tx_sd.name()
	self.tx_u.set_mux(usrp.determine_tx_mux_value(self.tx_u, 

tx_subdev_spec))
self.tx_u.tune(self.tx_sd._which, self.tx_sd,900e6)
self.tx_sd.set_enable(False)

	#High Priority
		r = gr.enable_realtime_scheduling()
		if r != gr.RT_OK:
    		print "Warning: failed to enable realtime scheduling"

	#Cosine
	self.tx_sig = gr.sig_source_c(50e3, gr.GR_COS_WAVE, 6500, 1.0)

	#Connect
	self.connect(self.rx_u, self.null)
	self.connect(self.tx_sig, self.tx_u)

def main():
fg = benchmark_test()
fg.start

time.sleep(0.5)
#raw_input("Press Enter To reset the Frequency")
start = time.time()
fg.tx_sd.set_enable(True)
stop  = time.time()
time.sleep(0.5)
fg.tx_sd.set_enable(False)
print "It took", stop - start, "seconds to set transmit."


time.sleep(1.5)
#raw_input("Press Enter To reset the Frequency")
start = time.time()
fg.tx_sd.set_enable(True)
stop  = time.time()
time.sleep(0.5)
fg.tx_sd.set_enable(False)
print "It took", stop - start, "seconds to set transmit."


time.sleep(1.5)
#raw_input("Press Enter To reset the Frequency")
start = time.time()
fg.tx_sd.set_enable(True)
stop  = time.time()
time.sleep(0.5)
fg.tx_sd.set_enable(False)
print "It took", stop - start, "seconds to set transmit."


time.sleep(1.5)
#raw_input("Press Enter To reset the Frequency")
start = time.time()
fg.tx_sd.set_enable(True)
stop  = time.time()
time.sleep(0.5)
fg.tx_sd.set_enable(False)
print "It took", stop - start, "seconds to set transmit."

raw_input("Press Enter to stop the flow graph.")
fg.stop

if name == “main”:
main()

HERE IS THE OUTPUT FROM THE TERMINAL:
Using RX d’board A: Flex 900 Rx
Using TX d-board Flex 900 Tx
SCHED_FIFO enabled with priority = 49
It took 0.000350952148438 seconds to set transmit.
It took 0.000610828399658 seconds to set transmit.
It took 0.00086784362793 seconds to set transmit.
It took 0.0011248588562 seconds to set transmit.
Press Enter to stop the flow graph.
Exception exceptions.ReferenceError: ‘weakly-referenced object no longer
exists’
in <bound method db_flexrf_900_rx.del of
<gnuradio.db_flexrf.db_flexrf_900_rx object at 0xb7d9814c>> ignored
Exception exceptions.ReferenceError: ‘weakly-referenced object no longer
exists’
in <bound method db_flexrf_900_tx.del of
<gnuradio.db_flexrf.db_flexrf_900_tx object at 0xb7335eec>> ignored