Hello,

The command port interface can be used to change the gain value. There is
an example of creating messages for tuning included in gr-uhd.
https://github.com/gnuradio/gnuradio/blob/master/gr-uhd/examples/grc/uhd_msg_tune.grc

I've used a function probe to generate coarsely timed "tick" messages to a
custom python block which is correctly formatting the messages before.
Unfortunately I cannot find that GRC file at the moment. The function probe
will run at an approximate interval dependent on your system and GNU
Radio's scheduler. If you don't need exact timing then just use the gain
message and function probe, if you do need exact timing include both time
and gain values in the pmt command message then the gain will be applied at
the specific time based on the radio timestamp. Set the Sync setting to
unknown_pps, which will set the radio timestamp to 0 when the flowgraph
starts, and set the initial timestamp for the command port message to a
second or two in the future to account for the startup time of the
flowgraph.

Regards,
Derek

On Thu, Feb 23, 2017 at 1:36 PM, Qurat-Ul-Ann Akbar <
[email protected]> wrote:

> Hi,
>
> I want to alternate the gain of the USRP between two values after a
> certain period of time. For example after 100 ms it should go from A to B
> and after another 100 ms the value should go from B to A and so on.
>
> Is there an easy way of doing this in the GNU Radio companion or would I
> need to start a timer in python and put an IF condition to keep changing
> the value? Can I do this somehow using the probe block?
>
>
>
> _______________________________________________
> Discuss-gnuradio mailing list
> [email protected]
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>
>
_______________________________________________
Discuss-gnuradio mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to