# Conditional switching between two subroutines in real-time

**URL:** <https://www.ruby-forum.com/t/conditional-switching-between-two-subroutines-in-real-time/232967>\
**Category:** GNU Radio\
**Created:** [November 7, 2014, 2:27pm UTC](https://www.ruby-forum.com/t/conditional-switching-between-two-subroutines-in-real-time/232967 "2014-11-07T14:27:40Z")\
**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:** [November 7, 2014, 2:27pm UTC](https://www.ruby-forum.com/t/conditional-switching-between-two-subroutines-in-real-time/232967/1 "2014-11-07T14:27:40Z")

</div>

Hi,

In GRC, I need to switch back and forth (in real time) between two  
subroutines based on some conditional ‘IF’ statement. For example,  
‘after’  
some preset lapse of time. Is it possible to do that?

Please note that I need the conditional switching to take place in  
real-time while the USRP is running, without turning the USRP off and  
on.

Thanks in advance.

Best regards,  
Khalid

---

<div class="post-metadata">

**Author:** ![khalide](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/3bc359/32.png) [@khalide](https://www.ruby-forum.com/u/khalide)\
**Post date:** [November 7, 2014, 5:33pm UTC](https://www.ruby-forum.com/t/conditional-switching-between-two-subroutines-in-real-time/232967/2 "2014-11-07T17:33:49Z")

</div>

On 11/07/2014 02:26 PM, khalid.el-darymli wrote:

> Hi,
> 
> In GRC, I need to switch back and forth (in real time) between two  
> subroutines based on some conditional ‘IF’ statement. For example,  
> ‘after’ some preset lapse of time. Is it possible to do that?

Not quite. What do you mean by subroutines? Streaming paths?  
You could use matrix\_multiply to mux streams around and send it messages  
in an timed fashion.

M
