Hi Luis,

that is a very GNU Radio-centric question; hence, I've taken the freedom
to include the discuss-gnuradio mailing list. I'd recommend signing up
[1] for that, and discussing further things on there.
Generally, you should easily be able to integrate that functionality
into any block, by altering its work function. I recommend getting to
know GNU Radio programming by following GNU Radio's guided tutorials
[2]. In essence, every block is a class in C++ or python, and can hold
state (such as count of times the work function was called with input)
internally.

Please be aware, though, that this is not how GNU Radio is supposed to
be used: The scheduler will offer you how many items (samples)  are
ready for input, and will allow you to produce as many as there is space
to do so. If you need constant workload size, I'd recommend using
set_output_multiple [3] and a sync block[4].

Best regards,
Marcus

[1] https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
[2] https://gnuradio.org/redmine/projects/gnuradio/wiki/Guided_Tutorials
[3]
http://gnuradio.org/doc/doxygen/classgr_1_1block.html#a63d67fd758b70c6f2d7b7d4edcec53b3
[4]
https://gnuradio.org/redmine/projects/gnuradio/wiki/Guided_Tutorial_GNU_Radio_in_Python#331-Choosing-a-Block-Type

On 03/25/2015 10:00 AM, Luis urday via USRP-users wrote:
> Hello,
>
> How can i count the number of times that a block Receives a packet in
> gnuradio ?
> I tried to make a variable that increments but this variable is
> reinitialized every Time that the flowgraph restart automatically and
> a new packet is received by the block .
> I use B210 from ettus .
>
> Regards
>
> Luis
>
>
> _______________________________________________
> USRP-users mailing list
> usrp-us...@lists.ettus.com
> http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com

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

Reply via email to