On 11/07/2011 03:50 PM, Yan N. wrote:
Really appreciate your answer, Josh.
I am wondering how to control data streaming from devices to host in
Python, if the stream command issuing approaching cannot work in
Python? What I am trying to do is detecting pps pulse then 2ms later
start receiving data from USRP N200. The received data will feed in
next block of the flowgraph.
Basically, the way python controls streaming is to call tb.start() or
tb.stop(). I realize that isnt a lot of control.
Option 1) Consider making a modification so that the user (you) can
specify the time that the streaming will start. Basically an API call
like uhd.set_stream_time(). Where will be used in the
source block’s start() method… Or more simply, forget the API change,
and hardcode the start-time that you want into the source block.
Option 2) The USRP source already tags the samples with a timestamp. You
dont need to control when streaming begins, because your donwnstream
block can determine the time of any sample using tags (aka packet
Option 3) Post messages into the source block to control streaming. This
is a more advanced feature that isnt yet implemented either in the
source block or from an API perspective. I mention it, because this is
something I may add in the near future once my message passing work gets
Options 1 or 2 are probably most practical for you.