Variable Sink variable_sink from gnuradio import gr import threading import time gr.vector_sink_$(type.fcn)() def _$(id)_run(): while True: time.sleep(1.0/$samp_rate) data = self.$(id).data() #if $vlen.eval == 0 if data: self.set_$(variable.eval)(data[-1]) self.$(id).clear() #else if len(data) >= $vlen: self.set_$(variable.eval)(data[-($vlen):]) self.$(id).clear() #end if threading.Thread(target=_$(id)_run).start() Type type enum Variable variable string Sample Rate samp_rate 10 real Vec Length vlen 0 int $vlen >= 0 in $type Read samples at from the input stream and write each sample to the variable. The variable must be the id of an existing variable block. When the vector length is 0, the variable will be set to numbers. \ When the vector length is > 0, the variable will be set to vectors.