# Questions about get\_tags\_in\_range

**URL:** <https://www.ruby-forum.com/t/questions-about-get-tags-in-range/231425>\
**Category:** GNU Radio\
**Created:** [August 7, 2014, 8:11am UTC](https://www.ruby-forum.com/t/questions-about-get-tags-in-range/231425 "2014-08-07T08:11:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [August 7, 2014, 8:11am UTC](https://www.ruby-forum.com/t/questions-about-get-tags-in-range/231425/1 "2014-08-07T08:11:47Z")

</div>

Hi all:  
I’m reading the source code ofdm\_chanest\_vcvc\_impl.cc.And I  
don’t know this command:  
// Propagate tags  
std::vectorgr::tag\_t tags;  
get\_tags\_in\_range(tags, 0,nitems\_read(0),  
nitems\_read(0)+framesize);

```
   I will try my best to explain my question more clearly.

```

1. I read:  
void ofdm\_chanest\_vcvc\_impl::forecast (int noutput\_items,  
gr\_vector\_int &ninput\_items\_required)  
{  
ninput\_items\_required[0] = (noutput\_items/d\_n\_data\_syms) \*  
(d\_n\_data\_syms + d\_n\_sync\_syms);  
}  
And I think ninput\_items\_required[0] = (1/1) \* (1 + 2)=3.  
Then nitems\_read(0)=3.Is it right?(nitems\_read:Return the number of  
items read on input stream which\_input. )
2. const int framesize = d\_n\_sync\_syms + d\_n\_data\_syms;  
Then framesize=2+1=3.  
3.Then get\_tags\_in\_range(tags, 0,nitems\_read(0),  
nitems\_read(0)+framesize);----\>\>\>get\_tags\_in\_range(tags, 0,3, 6);  
But:  
{0 1 2}—\>\>\>blk—\>\>\>{0}  
It don’t have 3 4 5 item.Can someone explain it to me?Thank you.  
Best regards,  
xd

---

<div class="post-metadata">

**Author:** ![xianda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/b38774/32.png) [@xianda](https://www.ruby-forum.com/u/xianda)\
**Post date:** [August 7, 2014, 9:49am UTC](https://www.ruby-forum.com/t/questions-about-get-tags-in-range/231425/2 "2014-08-07T09:49:24Z")

</div>

Hi Xianda,

On 07.08.2014 08:10, xianda wrote:

> ```
> ninput_items_required[0] = (noutput_items/d_n_data_syms) * (d_n_data_syms 
> 
> ```

- d\_n\_sync\_syms);

> ```
> }
> And I think ninput_items_required[0] = (1/1) * (1 + 2)=3.
> 
> ```

If you say so?! I don’t know the value of any of these variables at the  
time GNU Radio calls this. Usually, the scheduler doesn’t ask for a  
single output item, but for more, so noutput\_items \>\> 1.

> ```
> Then nitems_read(0)=3.Is it right?(nitems_read:Return the number of items 
> 
> ```

read on input stream which\_input. )  
Wrong, nitems\_read(0) is the number of items that have been consumed by  
a block up to now. “read” is past tense, here.

> 1. const int framesize = d\_n\_sync\_syms + d\_n\_data\_syms;  
> Then framesize=2+1=3.  
> this obviously depends on what your instance uses as number of sync  
> symbols and data symbols.  
> 3.Then get\_tags\_in\_range(tags, 0,nitems\_read(0),  
> nitems\_read(0)+framesize);----\>\>\>get\_tags\_in\_range(tags, 0,3, 6);  
> But:  
> {0 1 2}—\>\>\>blk—\>\>\>{0}  
> It don’t have 3 4 5 item.Can someone explain it to me?Thank you.  
> Best regards,  
> xd  
> get\_tags\_in\_range stores the tags in the tag vector you supply as first  
> argument:

get\_tags\_in\_range(tags, 0,nitems\_read(0), nitems\_read(0)+framesize);

The second argument is the input stream number (0), the third is the  
start of the range, in this case the number of items that have already  
been consumed in previous calls to work, which is the number of the  
first item in the current call to work. The third argument is the end of  
the range.

Hope that cleared things up a little!

Greetings,  
Marcus

---

<div class="post-metadata">

**Author:** ![xianda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/b38774/32.png) [@xianda](https://www.ruby-forum.com/u/xianda)\
**Post date:** [August 7, 2014, 10:18am UTC](https://www.ruby-forum.com/t/questions-about-get-tags-in-range/231425/3 "2014-08-07T10:18:00Z")

</div>

Xianda,

if you don’t know commands, you can look them up in the manual.  
[http://gnuradio.org/doc/doxygen/classgr\_1\_1block.html#aa0272555827fe26a1878e53ce4be092c](http://gnuradio.org/doc/doxygen/classgr_1_1block.html#aa0272555827fe26a1878e53ce4be092c)

M

---

<div class="post-metadata">

**Author:** ![xianda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/b38774/32.png) [@xianda](https://www.ruby-forum.com/u/xianda)\
**Post date:** [August 7, 2014, 10:24am UTC](https://www.ruby-forum.com/t/questions-about-get-tags-in-range/231425/4 "2014-08-07T10:24:33Z")

</div>

Hi:  
Thanks Marcus and Martin.So kindly of you.Thanks.  
Now I understand the command get\_tags\_in\_range.Thank you.  
But

> > ```
> > void ofdm_chanest_vcvc_impl::forecast (int noutput_items, gr_vector_int 
> > 
> > ```

&ninput\_items\_required)

> > ```
> > {
> > ninput_items_required[0] = (noutput_items/d_n_data_syms) * 
> > 
> > ```

(d\_n\_data\_syms + d\_n\_sync\_syms);

> > ```
> > }
> > And I think ninput_items_required[0] = (1/1) * (1 + 2)=3.
> > 
> > ```
> 
> If you say so?! I don’t know the value of any of these variables at the  
> time GNU Radio calls this. Usually, the scheduler doesn’t ask for a  
> single output item, but for more, so noutput\_items \>\> 1.

For the block:OFDM Channel Estimation,can I say noutput\_items=1?Because  
I know every time,the block output just one vector(item).Can you explain  
it to me?Thank you so much.  
Best regards,  
xd
