GRC bug in Variable Sink

Josh,

I believe I’ve uncovered a bug in the Variable Sink block.
It seems to work fine when the input type is “float”,
but fails to function correctly when the input type is
either “int” or “short”. The flowgraph continues to
run, but the variable is either set to zero of does
not change at all.

I’m trying to use it to add a “command port” to a
flowgraph that receives a single “int” or “short”
from an external application (via a UDP Source block),
and uses it to tune a doppler correction.

@(^.^)@ Ed

Forgot to mention I’m using GRC 0.69 and GnuRadio 3.1.1

@(^.^)@ Ed

Ed Criscuolo wrote:

but fails to function correctly when the input type is
either “int” or “short”. The flowgraph continues to
run, but the variable is either set to zero of does
not change at all.

Ed,

Its seems that the variable sink casts the number to a float:
numpy.fromstring (s, numpy.float32) regardless of the input type. I
admit that I didnt know 100% what i was doing when I made this variable
sink…

So, only use the variable sink as a float input type, and place a short
to float converter between the udp sink and the variable sink. (there is
currently no int to float converter in gnuradio) I hope that works!

Since it seems to be useful, I will make a shiny new variable sink in
the grc trunk. BTW, there is a converter script now for older flow
graphs if you are willing to try it out.

-Josh

I just checked in a new variable sink today (trunk). It takes complex,
float, int, short, byte, and vectors of said types. So, you could
potentially send an array of filter taps over udp source -> variable
sink, and the variable sink would call set_taps on your filter. :slight_smile:

Yes, that’s what I’ve been doing. It works. I’ve also written
the missing gr_int_to_float and gr_float_to_int blocks, as well as a
gr_network_to_host_ii byte order swapper block. If there’s general
interest in these blocks, I can submit them for inclusion in GnuRadio.

int to/from float would be great. There is gr_host_to_network_ii as
well?

Since it seems to be useful, I will make a shiny new variable sink in
the grc trunk. BTW, there is a converter script now for older flow
graphs if you are willing to try it out.

Sure. How do I get to it?

The converter script works automatically when you open flow graphs from
0.70 and below.

-Josh

Josh B. wrote:

Yes, that’s what I’ve been doing. It works. I’ve also written
the missing gr_int_to_float and gr_float_to_int blocks, as well as a
gr_network_to_host_ii byte order swapper block. If there’s general
interest in these blocks, I can submit them for inclusion in GnuRadio.

Since it seems to be useful, I will make a shiny new variable sink in
the grc trunk. BTW, there is a converter script now for older flow
graphs if you are willing to try it out.

Sure. How do I get to it?

@(^.^)@ Ed