# Error using Sample and Hold

**URL:** <https://www.ruby-forum.com/t/error-using-sample-and-hold/241510>\
**Category:** GNU Radio\
**Created:** [April 10, 2015, 3:42pm UTC](https://www.ruby-forum.com/t/error-using-sample-and-hold/241510 "2015-04-10T15:42:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Detlef\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/58f4c7/32.png) [@Detlef\_R](https://www.ruby-forum.com/u/Detlef_R)\
**Post date:** [April 10, 2015, 3:42pm UTC](https://www.ruby-forum.com/t/error-using-sample-and-hold/241510/1 "2015-04-10T15:42:58Z")

</div>

Hello,

I’m having some troubles when I use the Sample and Hold block. I’ve  
searched and some people say it is a problem in the python code. I am  
new in GNU radio. Please, can ayone help me to solve it?  
I uploaded a printscreen.

The problem is:

Traceback (most recent call last):  
File “/home/pedrogabriel/top\_block.py”, line 61, in   
tb = top\_block()

File “/home/pedrogabriel/top\_block.py”, line 48, in **init**  
self.connect((self.gr\_sig\_source\_x\_1, 0),  
(self.gr\_sample\_and\_hold\_xx\_1, 1))

File “/usr/lib/python2.6/dist-packages/gnuradio/gr/top\_block.py”, line  
124, in connect  
self.\_connect(points[i-1], points[i])

File “/usr/lib/python2.6/dist-packages/gnuradio/gr/top\_block.py”, line  
130, in \_connect  
dst\_block.basic\_block(), dst\_port)

File  
“/usr/lib/python2.6/dist-packages/gnuradio/gr/gnuradio\_swig\_py\_runtime.py”,  
line 1487, in connect  
return \_gnuradio\_swig\_py\_runtime.gr\_top\_block\_sptr\_connect(self,  
\*args)

ValueError: itemsize mismatch: sig\_source\_f(3):0 using 4,  
sample\_and\_hold\_ff(1):1 using 1

Thank you, everybody.
