Slow control external hardware

Hello,

I need to control a RF synthesizer from within a GNURadio flowchart
updating some parameters on the base of some measurements obtained from
processing data collected by an USRP.

The synthesizer is connected through a RS232 serial port, thus is quite
slow, but the bandwidth of the control is also very small, < 1Hz. One of
the parameters that needs to be controlled is the output power, and it
can be adjusted only in discrete steps of 0.01 dB, therefore I need to
correctly take care of the discretization.

What is the best strategy to do that? Should I simply implement a sink
block? Would be better to implement the discretization in a sink block
that then sends messages to another block that handles the communication
with the synthesizer?

As far as my experimentation goes, there are no blocks using messages in
the standard GNURadio distribution (version 3.7.2), therefore I don’t
really have examples of use cases for it.

Thanks. Cheers,
Daniele

On 29/07/2014 16:57, Martin B. wrote:

Daniele,

there’s loads of blocks that use messages, as well as manual pages for
that. And I would recommend you use them for this case. Create a block
that talks to the serial port, and give it a message port.

Hello Martin,

thank for your answer. Can you please point me to an example of such
blocks from which I can take inspiration? I would like to code it in
python, therefore if a python block that uses the message passing
infrastructure exists, it would be great. Meanwhile I’m going to grep
through the code distribution…

Thanks! Cheers,
Daniele

Daniele,

there’s loads of blocks that use messages, as well as manual pages for
that. And I would recommend you use them for this case. Create a block
that talks to the serial port, and give it a message port.

M

http://gnuradio.org/doc/doxygen/page_python_blocks.html

$ git grep self.set_msg_handler **/*.py[19:20:26]
gr-blocks/python/blocks/qa_python_message_passing.py

M

On 29/07/2014 19:29, [email protected] wrote:

writing/maintaining custom blocks when the functionality doesn’t
really require real-time access to the sample stream…

Hello,

well, writing a block that listens to messages or that emits messages
takes less than 20 lines of python all included. I would hardly call
this an “headache” to maintain :slight_smile:

Cheers,
Daniele

There are rather a lot of ways to choke this particular cat, writing a
block is just one of them.

I do “control external device” things from within GRC without custom
blocks, using “helper code” and a polling function at a low rate

that drives a simple state machine. I use this for controlling a serial
device that turns calibration sources on/off. It can get data out

of the flow-graph if it needs to, with low-rate “probe” blocks. Some
might call this inelegant, I call it saving the headache of

writing/maintaining custom blocks when the functionality doesn’t really
require real-time access to the sample stream…

On 2014-07-29 13:20, Martin B. wrote:

http://gnuradio.org/doc/doxygen/page_python_blocks.html [1]

$ git grep self.set_msg_handler **/*.py[19:20:26]
gr-blocks/python/blocks/qa_python_message_passing.py

M

On 07/29/2014 05:02 PM, Daniele N. wrote:
On 29/07/2014 16:57, Martin B. wrote: Daniele, there’s loads of blocks that
use messages, as well as manual pages for that. And I would recommend you use them
for this case. Create a block that talks to the serial port, and give it a message
port. Hello Martin, thank for your answer. Can you please point me to an example
of such blocks from which I can take inspiration? I would like to code it in
python, therefore if a python block that uses the message passing infrastructure
exists, it would be great. Meanwhile I’m going to grep through the code
distribution… Thanks! Cheers, Daniele M On 07/29/2014 02:55 PM, Daniele N.
wrote: Hello, I need to control a RF synthesizer from within a GNURadio flowchart
updating some parameters on the base of some measurements obtained from processing
data collected by an USRP. The synthesizer is connected through a RS232 serial
port, thus is quite slow, but the bandwidth of the control is also very small, <
1Hz. One of the parameters that
needs to be controlled is the output power, and it can be adjusted only
in discrete steps of 0.01 dB, therefore I need to correctly take care of
the discretization. What is the best strategy to do that? Should I
simply implement a sink block? Would be better to implement the
discretization in a sink block that then sends messages to another block
that handles the communication with the synthesizer? As far as my
experimentation goes, there are no blocks using messages in the standard
GNURadio distribution (version 3.7.2), therefore I don’t really have
examples of use cases for it. Thanks. Cheers, Daniele
_______________________________________________ Discuss-gnuradio mailing
list [email protected]
Discuss-gnuradio Info Page [2]
_______________________________________________ Discuss-gnuradio mailing
list [email protected]
Discuss-gnuradio Info Page [2]
_______________________________________________ Discuss-gnuradio
mailing list [email protected]
Discuss-gnuradio Info Page [2]


Discuss-gnuradio mailing list
[email protected]
Discuss-gnuradio Info Page [2]

Links:

On 07/30/2014 07:40 AM, Daniele N. wrote:

Some might call this inelegant, I call it saving the headache of

It’s a big universe, there’s room for different design choices…


Marcus L.
Principal Investigator
Shirleys Bay Radio Astronomy Consortium