# GRCP Monitor and Non-Numbers (C++ rpc register)

**URL:** <https://www.ruby-forum.com/t/grcp-monitor-and-non-numbers-c-rpc-register/231751>\
**Category:** GNU Radio\
**Created:** [August 28, 2014, 1:12am UTC](https://www.ruby-forum.com/t/grcp-monitor-and-non-numbers-c-rpc-register/231751 "2014-08-28T01:12:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [August 28, 2014, 1:12am UTC](https://www.ruby-forum.com/t/grcp-monitor-and-non-numbers-c-rpc-register/231751/1 "2014-08-28T01:12:31Z")

</div>

Hello

I am attempting to get and set strings via ControlPort, but I keep  
getting  
the traceback error below when I right-click to set a value in the  
ControlPort monitor (which I am using to ensure I am setting up the RPC  
calls properly). Getting and setting a number works fine, but strings  
(and  
vectors) keep giving me a traceback; the monitor doesn’t crash, though,  
but  
I still can’t set the string.

rpcbasic\_register\_set\<a\_class, std::string\> get\_some\_string  
rpcbasic\_register\_set\<a\_class, std::string\> set\_some\_string

Traceback (most recent call last):  
File “/opt/gnuradio3.7/bin/gr-ctrlport-monitor”, line 744, in openMenu  
self.parent.propertiesMenu(itemname, self.radio, self.uid)  
File “/opt/gnuradio3.7/bin/gr-ctrlport-monitor”, line 124, in  
propertiesMenu  
pmin = 1.1\*abs(pmin)  
TypeError: bad operand type for abs(): ‘str’

I am not sure if it’s important, but I the setup the polymorphic types  
as  
follows:

pmt::string\_to\_symbol(std::string(“”)) for the getter  
and  
pmt::mp(“”) for the setter

Thank you in advance,  
JT

–  
View this message in context:  
[http://gnuradio.4.n7.nabble.com/GRCP-Monitor-and-Non-Numbers-C-rpc-register-tp50135.html](http://gnuradio.4.n7.nabble.com/GRCP-Monitor-and-Non-Numbers-C-rpc-register-tp50135.html)  
Sent from the GnuRadio mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![JTJTJT](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ec9cab/32.png) [@JTJTJT](https://www.ruby-forum.com/u/JTJTJT)\
**Post date:** [August 28, 2014, 3:59pm UTC](https://www.ruby-forum.com/t/grcp-monitor-and-non-numbers-c-rpc-register/231751/2 "2014-08-28T15:59:11Z")

</div>

On Wed, Aug 27, 2014 at 4:11 PM, JT [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> rpcbasic\_register\_set\<a\_class, std::string\> set\_some\_string  
> follows:
> 
> pmt::string\_to\_symbol(std::string(“”)) for the getter  
> and  
> pmt::mp(“”) for the setter
> 
> Thank you in advance,  
> JT

Ah, yes, that’s an issue with the controlport monitor application. It’s  
trying to get information about the knob that’s exposed with  
controlport,  
including the min and max, but it’s designed around numbers and so  
trying  
to take the abs() of everything. You’ll have to edit gr-ctrlport-monitor  
to  
put a check around line 124 if the value is a number or not. If not,  
don’t  
try and set the min (or max).

Tom
