# How to add a new block

**URL:** <https://www.ruby-forum.com/t/how-to-add-a-new-block/243240>\
**Category:** GNU Radio\
**Created:** [September 3, 2015, 12:57pm UTC](https://www.ruby-forum.com/t/how-to-add-a-new-block/243240 "2015-09-03T12:57:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sadaf\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@Sadaf\_N](https://www.ruby-forum.com/u/Sadaf_N)\
**Post date:** [September 3, 2015, 12:57pm UTC](https://www.ruby-forum.com/t/how-to-add-a-new-block/243240/1 "2015-09-03T12:57:24Z")

</div>

ubuntu@ubuntu:~/gr-howto$ gr\_modtool makexml square\_ff  
GNU Radio module name identified: howto  
Warning: This is an experimental feature. Don’t expect any magic.  
Searching for matching files in lib/:  
Making GRC bindings for lib/square\_ff\_impl.cc…  
Traceback (most recent call last):  
File “/usr/local/bin/gr\_modtool”, line 47, in   
main()  
File “/usr/local/bin/gr\_modtool”, line 39, in main  
modtool.run()  
File  
“/usr/local/lib/python2.7/dist-packages/gnuradio/modtool/modtool\_makexml.py”,  
line 66, in run  
(params, iosig, blockname) = self.\_parse\_cc\_h(f)  
File  
“/usr/local/lib/python2.7/dist-packages/gnuradio/modtool/modtool\_makexml.py”,  
line 165, in \_parse\_cc\_h  
return (parser.read\_params(), parser.read\_io\_signature(), blockname)  
File  
“/usr/local/lib/python2.7/dist-packages/gnuradio/modtool/parser\_cc\_block.py”,  
line 81, in read\_io\_signature  
iosig[‘in’] =  
\_figure\_out\_iotype\_and\_vlen(iosig\_match.group(‘incall’),  
AttributeError: ‘NoneType’ object has no attribute ‘group’

---

<div class="post-metadata">

**Author:** ![Bala\_vishnu\_J](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/aeb1de/32.png) [@Bala\_vishnu\_J](https://www.ruby-forum.com/u/Bala_vishnu_J)\
**Post date:** [September 3, 2015, 5:04pm UTC](https://www.ruby-forum.com/t/how-to-add-a-new-block/243240/2 "2015-09-03T17:04:01Z")

</div>

Hi Bala,

are you using an old gr\_modtool that you found somewhere online?  
You should never do that. When you install GNU Radio, it will install a  
version of gr\_modtool that works with your GNU Radio version.

Best regards,  
Marcus

---

<div class="post-metadata">

**Author:** ![Bala\_vishnu\_J](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/aeb1de/32.png) [@Bala\_vishnu\_J](https://www.ruby-forum.com/u/Bala_vishnu_J)\
**Post date:** [September 3, 2015, 6:49pm UTC](https://www.ruby-forum.com/t/how-to-add-a-new-block/243240/3 "2015-09-03T18:49:11Z")

</div>

On 03.09.2015 08:00, Marcus M. wrote:

> are you using an old gr\_modtool that you found somewhere online?  
> You should never do that. When you install GNU Radio, it will install a  
> version of gr\_modtool that works with your GNU Radio version.

Also, you’re just posting output without any question or additional  
information. Please read  
[http://gnuradio.org/redmine/projects/gnuradio/wiki/ReportingErrors](http://gnuradio.org/redmine/projects/gnuradio/wiki/ReportingErrors),  
it’ll help you get feedback.

M

---

<div class="post-metadata">

**Author:** ![Bala\_vishnu\_J](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/aeb1de/32.png) [@Bala\_vishnu\_J](https://www.ruby-forum.com/u/Bala_vishnu_J)\
**Post date:** [September 23, 2015, 11:06am UTC](https://www.ruby-forum.com/t/how-to-add-a-new-block/243240/4 "2015-09-23T11:06:21Z")

</div>

Hi,

I have used bootable pendrive for GNURadio and UHD, and while creating a  
new square block following the instructions given in gnuradio wiki. I  
get the following error given below, for the last command “gr\_modtool  
makexml square\_ff”.

Error:  
ubuntu@ubuntu:~/gr-howto$ gr\_modtool makexml square\_ff  
GNU Radio module name identified: howto  
Warning: This is an experimental feature. Don’t expect any magic.  
Searching for matching files in lib/:  
Making GRC bindings for lib/square\_ff\_impl.cc…  
Traceback (most recent call last):  
File “/usr/local/bin/gr\_modtool”, line 47, in   
main()  
File “/usr/local/bin/gr\_modtool”, line 39, in main  
modtool.run()  
File  
“/usr/local/lib/python2.7/dist-packages/gnuradio/modtool/modtool\_makexml.py”,  
line 66, in run  
(params, iosig, blockname) = self.\_parse\_cc\_h(f)  
File  
“/usr/local/lib/python2.7/dist-packages/gnuradio/modtool/modtool\_makexml.py”,  
line 165, in \_parse\_cc\_h  
return (parser.read\_params(), parser.read\_io\_signature(), blockname)  
File  
“/usr/local/lib/python2.7/dist-packages/gnuradio/modtool/parser\_cc\_block.py”,  
line 81, in read\_io\_signature  
iosig[‘in’] =  
\_figure\_out\_iotype\_and\_vlen(iosig\_match.group(‘incall’),  
AttributeError: ‘NoneType’ object has no attribute ‘group’

Thank you

---

<div class="post-metadata">

**Author:** ![Bala\_vishnu\_J](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/aeb1de/32.png) [@Bala\_vishnu\_J](https://www.ruby-forum.com/u/Bala_vishnu_J)\
**Post date:** [October 14, 2015, 5:15pm UTC](https://www.ruby-forum.com/t/how-to-add-a-new-block/243240/5 "2015-10-14T17:15:22Z")

</div>

Hi,  
Can you please help me? I am facing one problem. I am using the below  
version.

mayank@mayank-Vostro-3446:~/gr-howto$ gnuradio-companion --version  
GNU Radio Companion 3.7.9git-171-g77083c5d

This program is part of GNU Radio  
GRC comes with ABSOLUTELY NO WARRANTY.  
This is free software, and you are welcome to redistribute it.

I was adding the very first simple block (given on the gnuradio site)  
in that in very first case I didn’t got any failed test case.

mayank@mayank-Vostro-3446:~/gr-howto/build$ ctest -V -R square  
UpdateCTestConfiguration from  
:/home/mayank/gr-howto/build/DartConfiguration.tcl  
UpdateCTestConfiguration from  
:/home/mayank/gr-howto/build/DartConfiguration.tcl  
Test project /home/mayank/gr-howto/build  
Constructing a list of tests  
Done constructing a list of tests  
Checking test dependency graph…  
Checking test dependency graph end  
test 2  
Start 2: qa\_square\_ff

## 2: Test command: /bin/sh “/home/mayank/gr-howto/build/python/qa\_square\_ff\_test.sh” 2: Test timeout computed to be: 9.99988e+06 2: . 2:

2: Ran 1 test in 0.002s  
2:  
2: OK  
1/1 Test #2: qa\_square\_ff … Passed 0.31 sec

The following tests passed:  
qa\_square\_ff

100% tests passed, 0 tests failed out of 1

Total Test time (real) = 0.31 sec

So I preceded to add xml.  
mayank@mayank-Vostro-3446:~/gr-howto$ gr\_modtool makexml square\_ff

but the error is coming as per follwing:  
mayank@mayank-Vostro-3446:~/gr-howto$ gr\_modtool makexml square\_ff  
GNU Radio module name identified: howto  
Warning: This is an experimental feature. Don’t expect any magic.  
Searching for matching files in lib/:  
Making GRC bindings for lib/square\_ff\_impl.cc…  
Traceback (most recent call last):  
File “/usr/local/bin/gr\_modtool”, line 46, in   
main()  
File “/usr/local/bin/gr\_modtool”, line 38, in main  
modtool.run()  
File  
“/usr/local/lib/python2.7/dist-packages/gnuradio/modtool/modtool\_makexml.py”,  
line 75, in run  
(params, iosig, blockname) = self.\_parse\_cc\_h(f)  
File  
“/usr/local/lib/python2.7/dist-packages/gnuradio/modtool/modtool\_makexml.py”,  
line 174, in \_parse\_cc\_h  
return (parser.read\_params(), parser.read\_io\_signature(), blockname)  
File  
“/usr/local/lib/python2.7/dist-packages/gnuradio/modtool/parser\_cc\_block.py”,  
line 81, in read\_io\_signature  
iosig[‘in’] =  
\_figure\_out\_iotype\_and\_vlen(iosig\_match.group(‘incall’),  
AttributeError: ‘NoneType’ object has no attribute ‘group’

Please help me solving this error.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Bala\_vishnu\_J](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/aeb1de/32.png) [@Bala\_vishnu\_J](https://www.ruby-forum.com/u/Bala_vishnu_J)\
**Post date:** [October 19, 2015, 4:43pm UTC](https://www.ruby-forum.com/t/how-to-add-a-new-block/243240/6 "2015-10-19T16:43:44Z")

</div>

Bala vishnu Jagadeesh wrote in post #1178885:

> Hi,
> 
> I have used bootable pendrive for GNURadio and UHD, and while creating a  
> new square block following the instructions given in gnuradio wiki. I  
> get the following error given below, for the last command “gr\_modtool  
> makexml square\_ff”.
> 
> Error:  
> ubuntu@ubuntu:~/gr-howto$ gr\_modtool makexml square\_ff  
> GNU Radio module name identified: howto  
> Warning: This is an experimental feature. Don’t expect any magic.  
> Searching for matching files in lib/:  
> Making GRC bindings for lib/square\_ff\_impl.cc…  
> Traceback (most recent call last):  
> File “/usr/local/bin/gr\_modtool”, line 47, in   
> main()  
> File “/usr/local/bin/gr\_modtool”, line 39, in main  
> modtool.run()  
> File  
> “/usr/local/lib/python2.7/dist-packages/gnuradio/modtool/modtool\_makexml.py”,  
> line 66, in run  
> (params, iosig, blockname) = self.\_parse\_cc\_h(f)  
> File  
> “/usr/local/lib/python2.7/dist-packages/gnuradio/modtool/modtool\_makexml.py”,  
> line 165, in \_parse\_cc\_h  
> return (parser.read\_params(), parser.read\_io\_signature(), blockname)  
> File  
> “/usr/local/lib/python2.7/dist-packages/gnuradio/modtool/parser\_cc\_block.py”,  
> line 81, in read\_io\_signature  
> iosig[‘in’] =  
> \_figure\_out\_iotype\_and\_vlen(iosig\_match.group(‘incall’),  
> AttributeError: ‘NoneType’ object has no attribute ‘group’
> 
> Thank you

Dear Bala,

I don’t know what’s wrong with makexml utility but you can try the steps  
below:  
go to your gr-howto folder  
then go to grc folder  
open the howto\_square\_ff.xml

edit like following

\<?xml version="1.0"?\> Square ff howto\_square\_ff HOWTO import howto howto.square\_ff() in float out float 

then run the following command  
cd build/  
sudo make install  
sudo ldconfig

if it doesn’t work let me know.
