discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Problem: Reading a file


From: Tim Meehan
Subject: Re: [Discuss-gnuradio] Problem: Reading a file
Date: Mon, 28 Jan 2008 18:22:51 -0800


Jason,

I think you need to start the flowgraph first. 

For example

fg.connect()
fg.start()
time.sleep(1)
fg.stop()
fg.wait()

now you can grab the data from vector_sink


Because you are have repeat set to false you should also be able to try

fg.connect()
fg.run()

and again grab data from vector_sink





On Jan 23, 2008 9:40 PM, Jason Anders <address@hidden> wrote:


I have a problem reading an ascii file. I tried reading it using gr_file_soucrce and extracted it using gr_vector_sink_f. Then I tried extracting the data by using  <object>.data(); or in short, by using its data member. Unfortunately, I always get an empty list. Why is this so?

Here's a snippet of code to clarify things:

FALSE = bool(0)
yrx1_real = gr.file_source(gr.sizeof_float,{file location},FALSE)
Rx1_real = gr.vector_sink_f()

## FLOW GRAPH CREATION
fg = gr.flow_graph ()
fg.connect (yrx1_real, Rx1_real)
fg.wait()      # Ends the flowgraph... as stated in one of the replies

## Calling the data extracted
Rx1 = Rx1_real.data()
print 'After Data extraction!'
for i in range(0,1):
    print Rx1[i]                      # I always get an empty list here. Why?



_______________________________________________
Discuss-gnuradio mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio



reply via email to

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