[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] Building blocks of gnuradio-companion - GR file s
Re: [Discuss-gnuradio] Building blocks of gnuradio-companion - GR file sink
Fri, 21 Sep 2012 09:42:41 -0400
On Thu, Sep 20, 2012 at 11:05 PM, Hussain, Mushabbar
> We are trying to build a simulated model using the building blocks of
> gnuradio-companion tool. In the GRC model one of the blocks is the GR file
> sink block which is intended for storage of the data. Now the issue is that
> if the program is run for a longer period of time(say 40-60m mins) the data
> file size would grow huge(may be in GB), somehow we want to
> prevent/restrict the data file size to a few MB’s – like a fixed size
> circular buffer. Is there any way GRC API which would allows us to set the
> filesize? Another harder way is to write code to check file size and if that
> exceeds certain limit, we can backup the data and flush the file to restart
> storing again.
> Please comment what would be an easier way to achieve this?
Just to be clear, do you want to run the program indefinitely but only
save the last N samples into a file?
Or do you want to just run the program long enough to generate a file
of N samples?
The the latter, you can easily use the gr.head (just look for Head in
the 'Misc' section in GRC).
If you want the former, there's nothing in GNU Radio that will do this
out of the box, so you'll have to write your own block (unless someone
has one already that does this).