10-24-2018 01:24 AM
Dear Labview users,
Hello. I am now working on transferring data between parallel loops.
The transfer is one-way direction, and the parallel loops have a different update frequency.
The data is transferred from loop with higher frequency to loop with lower frequency.
What is the best way to achieve it, with highest operation speed?
I really appreciate so much for your help.
Best regards
Solved! Go to Solution.
10-24-2018 01:36 AM - edited 10-24-2018 01:37 AM
Hi hkpark,
please define your "best" requirement…
Standard ways to transfer data between loops are queues and notifiers. Recently we got channels. For long time we have variables (local, global, network/shared). Some use functional globals aka action engines.
Pick your choice!
10-24-2018 02:01 AM
Thank you so much for your reply.
I do not know about the following ways, but I've heard that the way through local variables is slow. So, I would like to ask about the way to use queue and notifiers.
10-24-2018 02:10 AM - edited 10-24-2018 02:10 AM
Hi hkpark,
I've heard that the way through local variables is slow.
Who said so? Any evidence?
Local variables are rather fast…
So, I would like to ask about the way to use queue and notifiers.
LabVIEW comes with a huge example library. There you will find example VIs explaining the usage of queues and notfiers!
Did you notice that "Training" section in the header of the LabVIEW board?
10-24-2018 02:35 AM
Get Set (global functional is another way to go.
Benoit
10-24-2018 02:44 AM
Well, it depends. Do you want to keep all the values? In that case the queue is the best choice. Isn't it important? Just grab the last value which could be done with a Local/AE or similar.
/Y
10-25-2018 06:35 AM
@hkpark93 wrote:
The data is transferred from loop with higher frequency to loop with lower frequency.
Based on this statement, I am left to assume you only care about the latest value. If that is the case, then I would just use a Global Variable.
And a shameless plug: Are Global Variables Truly Evil?
10-25-2018 09:49 AM
As others have indicated, you have many options. I like to use queues because of their scalability. Even if I'm only interested in tag based communication (i.e. latest value), by implementing that as a queue with a value of 1 wired to the max queue size input, it becomes an easy edit later to switch to lossless / buffered data transfer if need be. In your situation, where you have your data source executing faster than your data sink, you have the opportunity to reduce apparent noise in the data by enqueuing all of the data points, and then averaging or performing some other signal processing on the dequeued array of values in the slower loop to obtain a single representative value, as opposed to simply previewing or dequeuing the latest value. This, of course, is only applicable if the additional latency doesn't matter.
For values that you are certain will only ever need to be tags, I like functional global variables, or a CVT.
10-26-2018 07:53 AM
Thank all of you for your kind answers. Based on what you have said, and through examples from LabVIEW, I was able to implement the desired function. Again, thank you so much.