USRP Software Radio

cancel
Showing results for 
Search instead for 
Did you mean: 

How to run a TX and an RX subVI in a parallel way?

Dear all,

 

Thank you for reading this.

 

We hope to run a TX subVI and an RX subVI simultaneously in a parallel way in a VI to perform some distributed algorithms. However the test results show that they always work one after another. Does anyone have some ideas about how to perform several subVIs in a parallel way?

 

Thanks for your kind assistance.

0 Kudos
Message 1 of 5
(5,954 Views)

Can you post a VI snippet of the relevant code to look at?

0 Kudos
Message 2 of 5
(5,946 Views)

Sure, see this fig.

screen.png

 

In this fig, PSK Demodulater.vi is a subVI acting as a receiver, monitoring the spectrum and receiving packets, and Tx_PSK_PHY is a subVI acting as a transmitter. Unfortunately these two VIs will not work simultaneously. In fact, PSK Demodulater will run first and Tx_PSK_PHY follows. 

0 Kudos
Message 3 of 5
(5,939 Views)

The transmit and recieve VIs can run at the same time.  There is nothing preventing this.

 

VI's have many options, one is to run the VI in normal mode and the same VI in memory runs in each call.  If you choose Reentrant then you have options for running the same function at the same time.  Each copy then uses its own memory space.

 

VI Prop.png

0 Kudos
Message 4 of 5
(5,932 Views)

That is because you introduced a data dependency between the two blocks. A VI/SubVI in LabVIEW only runs when all inputs have data from the previous blocks. The green wire that you connected from the output of the "decoder filter" to the case-structure causes the case structure to only start executing when there is data on this wire. This is only the case after "decoder filter" has run which in turn depends on the "PSK Demodulater". Therefore, with your current setup, "Tx_PSK_PHY" will always run after the "PSK Demodulater".

 

A little example to make this more clear:

 

timing1.png

 

This snippet has a similar situation to yours. If you run it, it will take 200ms, because the top case struct waits until the boolean input has data from the bottom case struct. If you remove the connection between the two case-structs, the VI will run in 100ms because now there is no data dependency between the structs.

 

The green wire in your VI does not seem to do anything, is it required? Also, after removing the green wire the VIs can run in parallel. But it does not necessarily mean that they do. So if some form of synchronized execution is required, this has to be enforced explicitly.

 

Regards,

 

Jan D.

Vodafone Chair

TU-Dresden

Message 5 of 5
(5,894 Views)