LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to exchange data between parallel running subVIs


@crossrulz wrote:

@TomaszCiesla wrote:

here's the example.

Yes it looks like a Global Variable but it's much faster (I've tested the performance)


I would really like to see that benchmark code.  Every time I benchmark with property nodes, they are 1000s of times slower than local variables and global variables.


I actually just updated my race condition benchmark and even with the Defer Front Panel Updates set for the property node benchmark (increases performance by not having the front panel update each time the value property is read and written) the Property Nodes were ~1794 times SLOWER than using Global Variables.  There were a couple of other things that looked interesting that I would like to spend some time investigating before updating my document.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 11 of 14
(541 Views)

Hello TomaszCiesla,

You can try using User events to send data between loops and also to send termination from main vi to all sub vi.


CLD Using LabVIEW since 2013
0 Kudos
Message 12 of 14
(539 Views)

@TomaszCiesla wrote:

so in this scenario I abandon bidirectional approach - the device's while loop can only stream the data to mail while loop. And main while loop communicates with device's while loop using the global variables


1. There is no good bidirectional bus.  Any bidirectional communications will be wrought with race conditions.

2. What I do is have a queue for each instrument.  This allows the main loop to send any message to the instrument loop (Start Collecting, Reset, Stop Collecting, Exit, Change Configuration, etc).  I use the timeout of the queue to limit my loop rate.  And the main loop also has its own queue that every other loop can send their respective data through.  So, in short, if you have 3 loops (2 instruments and 1 main), you should have 3 queues.  Again, go search for Queued Message Handler.  Or you might also want to have a good look at the Delacore Queued Message Handler (DQMH) which is a framework already put together for you and freely available through the LabVIEW Tools Network and VI Package Manager (VIPM).


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 13 of 14
(535 Views)

The problem is that I'll have >10 devices running in parallel and 10 ques = lot of mess 😉

I've made a benchmark, see the attachment, on my PCB the difference is x100 in the favor of global variable and queue, the funny thing is that, there's no difference between speed of execution of queue and global variable - so maybe I should just simply replace everything with global variables? less wires and easier data manipulation?

 

Download All
0 Kudos
Message 14 of 14
(530 Views)