05-09-2013 04:43 AM
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.
05-09-2013 10:18 AM
Can you post a VI snippet of the relevant code to look at?
05-09-2013 11:52 AM
Sure, see this fig.
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.
05-09-2013 12:48 PM
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.
05-16-2013 10:32 AM - edited 05-16-2013 10:38 AM
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:
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