discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] [use of gr.vector_source_b]


From: Eric Blossom
Subject: Re: [Discuss-gnuradio] [use of gr.vector_source_b]
Date: Sat, 6 Jun 2009 21:46:05 -0700
User-agent: Mutt/1.5.18 (2008-05-17)

On Thu, Jun 04, 2009 at 05:50:03AM -0700, Rita's pfc wrote:
> 
> Thanks Eric.
> But now, I want to print, or just simply get into a vector or file the
> result of coding. I use the subfunction, vector_sink_x.data() . The code I
> have is:
> 
>  
>                 s='asdf'
>               cadena = map(ord, s)
>               src = gr.vector_source_b(cadena,False)
>               tre = trellis.encoder_bb(f,0)
>               sink_cod_vector = gr.vector_sink_b()
>               sin = gr.file_sink(gr.sizeof_char,"fichero.log")
>               self.connect(src, tre)
>               self.connect(tre, sink_cod_vector)
>               self.connect(tre, sin)
>               print "...               ", sink_cod_vector.data()
>               print "datas cod len     ", len(sink_cod_vector.data())
> 
> 
> and the output was:
> 
> ...                ()
> datas cod len      0
> 
> but it creates the file fichero.log whose size is 4 bytes, what is normal (4
> chars to code)

The vector_sink is empty because you have not yet run the graph.
Take a look at pretty much any of the qa_*.py files for examples.

Eric




reply via email to

[Prev in Thread] Current Thread [Next in Thread]