Re: [Discuss-gnuradio] Get a pointer to UHD Sink from other block in flow graph

2014-10-16 Thread Koslowski, Sebastian (CEL)

On 10/16/2014 12:41 PM, David Halls wrote:
 Is there any way to get a pointer to a UHD sink block from another
 block in a flow graph, such that I can read from the time registers of
 a USRP?

Depends how you're building your flow-graph: In Python, simply pass a
reference to your UHD block object to your block.
In GRC, there is no way to reference another block id in a block's
params. Try this patch, if you want that [0]. Else, you could
assume a fixed uhd sink block id and add that to your blocks XML's make
template.

Sebastian

[0]
https://github.com/skoslowski/gnuradio/commit/c90e2ddf1cea38ee2400ef56b234758048d980bf

-- 
Karlsruhe Institute of Technology (KIT)
Communications Engineering Lab (CEL)

Dipl.-Ing. Sebastian Koslowski
Research Associate

Kaiserstraße 12
Building 05.01
76131 Karlsruhe, Germany

Phone: +49 721 608-46275
Fax:   +49 721 608-46071
Email: sebastian.koslow...@kit.edu
Web:   http://www.cel.kit.edu/

KIT – University of the State of Baden-Wuerttemberg and National Research 
Center of the Helmholtz Association




signature.asc
Description: OpenPGP digital signature
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Get a pointer to UHD Sink from other block in flow graph

2014-10-16 Thread Tom Rondeau
On Thu, Oct 16, 2014 at 8:54 AM, Marcus Müller mar...@hostalia.de wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 ... and in C++ you can just use the sptr that you normally use when
 using the uhd sink.

 But: since Martin added the message ports to the UHD blocks, things
 have gotten easier; you can just add an output message port to your
 block and connect it to the message port of the UHD sink, and send
 commands there without needing to care about objects, pointers, race
 conditions...

 also, if you want to do things like defining starts and ends of burst,
 you might do so using the good ol' stream tags.

 So many possibilities!

 Greetings,
 Marcus



Yes, Marcus is right. Use the message ports and stream tags to manipulate
other blocks. Passing them around as references is bad practice because of
lifecycle concerns of the block's use inside the scheduler. You want to
communicate through interfaces, not the objects themselves.

Tom




 On 16.10.2014 13:11, Koslowski, Sebastian (CEL) wrote:
 
  On 10/16/2014 12:41 PM, David Halls wrote:
  Is there any way to get a pointer to a UHD sink block from
  another block in a flow graph, such that I can read from the time
  registers of a USRP?
 
  Depends how you're building your flow-graph: In Python, simply pass
  a reference to your UHD block object to your block. In GRC, there
  is no way to reference another block id in a block's params. Try
  this patch, if you want that [0]. Else, you could assume a fixed
  uhd sink block id and add that to your blocks XML's make template.
 
  Sebastian
 
  [0]
 
 https://github.com/skoslowski/gnuradio/commit/c90e2ddf1cea38ee2400ef56b234758048d980bf
 
 
 
 
  ___ Discuss-gnuradio
  mailing list Discuss-gnuradio@gnu.org
  https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
 
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1

 iQEcBAEBAgAGBQJUP7/8AAoJEAFxB7BbsDrLmCsH/Rq2P5TH2/Xe4+oAdmS5WoH+
 VxOa5+DhfOPCGjzUgb/zyzMUBN+nj6rLwNNXCBL2y4zH5VYlnhNE2z9yCPnqGZRd
 ELyJ0irEuviYSUCx9SMfYxfWyYlnQnj94t3A49DPrXhECZoa2lZDoJBuFQpTawvG
 rk/A27B0PfLhbYfTQ+D50EmgFbzwm8a3I7ChAi0kL8SIHtCQi5fYunYBVjlzDh07
 NnC7Xjcgx3HGhwTN1Q+YVEFRgBT6FfR45jhkmSS/GqwZa+Bz8KCjIF890qM//omi
 3SmQT9pK8haqJWcHSTuX3sZeiM1zdwnjvPr5KscAZDH9FZni6IJYjs3JWq0BKL8=
 =IAbe
 -END PGP SIGNATURE-

 ___
 Discuss-gnuradio mailing list
 Discuss-gnuradio@gnu.org
 https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Get a pointer to UHD Sink from other block in flow graph

2014-10-16 Thread David Halls
Thanks Sebastian,

My solution in the end was to use a UHD source, which generates rx_time, I then 
created a block which reads in this rx_time tag and sends it as a message to a 
block just before my UHD sink which converts this to a tx_time based on the 
number of bursts sent, and the burst interval that I desire.

Note that if you are transmitting MIMO, i.e. multiple USRPs in one UHD sink, 
you also have to use multiple USRPs in the UHD source to produce the rx_time 
(although they multiple rx_times will be equal).

Regards,

David

-Original Message-
From: Koslowski, Sebastian (CEL) [mailto:sebastian.koslow...@kit.edu]
Sent: 16 October 2014 12:12
To: David Halls; discuss-gnuradio@gnu.org
Subject: Re: [Discuss-gnuradio] Get a pointer to UHD Sink from other block in 
flow graph


On 10/16/2014 12:41 PM, David Halls wrote:
 Is there any way to get a pointer to a UHD sink block from another
 block in a flow graph, such that I can read from the time registers of
 a USRP?

Depends how you're building your flow-graph: In Python, simply pass a reference 
to your UHD block object to your block.
In GRC, there is no way to reference another block id in a block's params. Try 
this patch, if you want that [0]. Else, you could assume a fixed uhd sink block 
id and add that to your blocks XML's make template.

Sebastian

[0]
https://github.com/skoslowski/gnuradio/commit/c90e2ddf1cea38ee2400ef56b234758048d980bf

--
Karlsruhe Institute of Technology (KIT)
Communications Engineering Lab (CEL)

Dipl.-Ing. Sebastian Koslowski
Research Associate

Kaiserstraße 12
Building 05.01
76131 Karlsruhe, Germany

Phone: +49 721 608-46275
Fax:   +49 721 608-46071
Email: sebastian.koslow...@kit.edu
Web:   http://www.cel.kit.edu/

KIT – University of the State of Baden-Wuerttemberg and National Research 
Center of the Helmholtz Association





NOTE: The information in this email and any attachments may be confidential 
and/or legally privileged. This message may be read, copied and used only by 
the intended recipient. If you are not the intended recipient, please destroy 
this message, delete any copies held on your system and notify the sender 
immediately.

Toshiba Research Europe Limited, registered in England and Wales (2519556). 
Registered Office 208 Cambridge Science Park, Milton Road, Cambridge CB4 0GZ, 
England. Web: www.toshiba.eu/research/trl
---
 This email has been scanned for email related threats and delivered safely by 
Mimecast.
 For more information please visit http://www.mimecast.com
---
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio