Problem in using: dqpsk_mod() with gr.top_block

Hi,

I am new in using GNURadio. I try to test the dqpsk_mod() function and
have always this error:

ValueError: unable to coerce endpoint

Could anyone tell me what wrong I have made?
Thanks so much.

Program:

#no GUI
#source: stream from file_source
#connect with DQPSK: input: byte stream, output:complex
#change it to 2 parts:imagine and Real
#connect with gr.complex_to_real or gr.complex_to_imag

class my_top_block(gr.top_block):

def init(self):
gr.top_block.init(self)

src_data = (1,1,0,1,1,1,0,0)
src = gr.vector_source_b (src_data)

#input: unsigned char, output: complex
qpsk = blks.dqpsk_mod(self,2,.35,True, False, False)
self.connect (src,qpsk)

real = gr.complex_to_real()
imag = gr.complex_to_imag()
self.connect(qpsk,real)
self.connect(qpsk,imag)

sink1 = gr.vector_sink_f()
sink2 = gr.vector_sink_f()

self.connect(real,sink1)
self.connect(imag,sink2)

if name == ‘main’:
try:
my_top_block().run()
except KeyboardInterrupt:
pass

It lacks the beginning part, so I paste again my program:

#!/usr/bin/env python

from gnuradio import gr
from gnuradio import blks

#no GUI
#source: stream from file_source
#connect with DQPSK: input: byte stream, output:complex
#change it to 2 parts:imagine and Real
#connect with gr.complex_to_real or gr.complex_to_imag

class my_top_block(gr.top_block):

def init(self):
gr.top_block.init(self)

src_data = (1,1,0,1,1,1,0,0)
src = gr.vector_source_b (src_data)

#input: unsigned char, output: complex
qpsk = blks.dqpsk_mod(self,2,.35,True, False, False)
self.connect (src,qpsk)

real = gr.complex_to_real()
imag = gr.complex_to_imag()
self.connect(qpsk,real)
self.connect(qpsk,imag)

sink1 = gr.vector_sink_f()
sink2 = gr.vector_sink_f()

self.connect(real,sink1)
self.connect(imag,sink2)

if name == ‘main’:
try:
my_top_block().run()
except KeyboardInterrupt:
pass

ValueError: unable to coerce endpoint

On Sun, Jun 15, 2008 at 06:19:06PM +0200, Van Tran wrote:

ValueError: unable to coerce endpoint

Seeing the full trace back would be useful. It usually provides a
clue as to where the problem is.

Eric

You are using the new top_block with the old blks dqpsk modulator.

Replace blks with blks2, also change “blks.dqpsk_mod(self,2,.35,True,
False, False)” to “blks2.dqpsk_mod(2,.35,True, False, False)” and see
what happens.

-Josh

Josh B. wrote:

You are using the new top_block with the old blks dqpsk modulator.

Replace blks with blks2, also change “blks.dqpsk_mod(self,2,.35,True,
False, False)” to “blks2.dqpsk_mod(2,.35,True, False, False)” and see
what happens.

-Josh

I have done like this and have no more this error.

Thank you all for helping me.