Head block in GRC

Hi,
Â
I am trying to use the head block in GRC to limit the amount of dat
written to a file. Currently I have a very basic configuration set up in
GRC with a file source(text data) set to repeat going into the head
block going into a throttle to control the sampling rate and going into
a file sink.
Â
For the head block I have played around with the Number of Items and
Vector Size parameters. I have been able to get it to work with some
combinations of numbers but they didn’t seem to follow any logical
pattern. For example if I set the head block input to bytes, Num Items
to 50, and Vector Size to 1 I would have thought I would geta 50 byte
output file but the file was blank (0 bytes). Any idea on what could be
causing this?
Â
Thanks,
Dave

[…] very basic configuration set up in GRC with a file source(text data)
set to repeat going into the head block going into a throttle to control
the sampling rate and going into a file sink.

For the head block I have played around with the Number of Items and
Vector Size parameters. […] Any idea on what could be causing this?

I’m not sure about the internals of these file sources and sinks, but
playing around with custom blocks I’ve found that the function
‘message_from_string’ does not work properly if the size is set to one
byte (e.g. type = byte, vec_size = 1, when size = type*vec_size). No
throughput is generated by this, as far as my experience goes.

  • Martin