02-12-2007 07:43 AM
02-12-2007 08:01 AM
You forgot to attach your example!
The easiest way to exchange data between loops is to simply wire the data going in. You can also use local variables.
02-12-2007 08:22 AM
Many ways to do this.
1. Locals : beware race conditions unless you use a one writer one (or many) readers. Also potential lost data due to no buffering.
2. Globals: Same issues as the Locals.
3. Queues - my prefered method. solves many of the concurrency issues.
4. Shared variables- newer technique, I hear this is a great method but I have not used it extensively. Not avaliable in older LV versions.
5. Other communication protocols- TCPIP, other message protocols ...
This should give you a quick list of where to start.
Paul
02-12-2007 10:35 AM
@Steve.Briggs wrote:
The easiest way to exchange data between loops is to simply wire the data going in.
A wire creates a data dependency between the two loops. Dataflow dictates that a diagram object will (1) start executing once all inputs contain data and (2) will only produce data on the outputs once the entire object has finished.
This means in practical terms that if there is a wire going from loop A (output tunnel) to loop B (input tunnel), Loop B must wait until loop A has finished. If you have wires going from loop A to B AND back from loop B to A you create a deadlock and broken code. You cannot "exchange" data between two parallel loops using wires.
02-12-2007 11:12 AM
He never really specified what he'd like.
In essence, what is being transferred from loop A to loop B is still data. It's the same principle of a local variable. You can't just jump to loop B if the variable isn't defined. Rather than including a variable which is defined in loop A into loop B, you can just wire the output from loop A into the input of loop B. In most cases one can assume that what is inside of loop A would usually come before what is needed inside loop B or that the calculations/programming being done inside loop B contains information from loop A, not vice versa.
02-12-2007 11:23 AM
@Steve.Briggs wrote:
In essence, what is being transferred from loop A to loop B is still data.
There is a fine line between "transfer" and "exchange". In my book, the word "exchange" would imply bidirectionality. 🙂 Transfer is typically unidirectional.
02-12-2007 11:30 AM
02-13-2007 02:27 AM
02-13-2007 03:16 AM - edited 02-13-2007 03:16 AM
02-13-2007 03:27 AM