Re: how to stop the top_block and restart signal transmission

Hi Tom,

Sorry about the question. I tried the method lock() and unlock() to
pause the flow graph that I built, but still shows the continuous signal
wave on the oscilloscope. I cannot see the pause between the signal
waves.The code related to the top_block scheduling is as followed. Could
you help me see what would be the problem which lock/unlock cannot pause
the flow graph for 5 milliseconds? I’m trying to transmit 13-bit through
the USRP board, after this transmission pause the system for 5
milliseconds then repeat this process again. If continuously
transmitting the Barker code, this system works fine. I’m wondering why
lock/unlock method cannot work in this case? What’s the problem here? I
really appreciate your help!

try:
top_block.start()
statr_flag
payload_13barker
=’\x01\x01\x01\x01\x01\x00\x00\x01\x01\x00\x01\00\x01’

while(start_flag == 1):
msg_13bit =gr.message_from_string(payload_13barker)
top_block._ls.msgq.insert_tail(msg_13bit)
eof_msg = gr.message(1)
top_block._ls.msgq.insert_tail(eof_msg)
top_block.lock()
time.sleep(0.005)
top_block.unlock()
top_block.wait()

The top_block that I built:

class tx_bpsk_block(gr.top_block):
def init(self, subdev_spec, freq, verbose, chip_rate,amplitude):
gr.top_block.init(self, “tx_mpsk”)
self._freq = freq
self._verbose = verbose
self._amplitude = amplitude
self._u = usrp_sink_s(0,subdev_spec, chip_rate, self._freq,
self._verbose)
self.in_data = gr.message_source(gr.sizeof_char, 3329)
self.msgq = self.in_data.msgq()
self._constellation = [-1, 1]
self._mapper = gr.chunks_to_symbols_bf(self._constellation)
self._gain = gr.multiply_const_ff(self._amplitude)
self.f2s = gr.float_to_short()
self.connect(self.in_data,self._mapper self._gain,
self.f2s,self._u)

Thank you so much for your help! I really appreciate!

Thanks,
Yan

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs