LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

data in different loop

Solved!
Go to solution

Dear all,

i am working on an application where i need to acquire data from the H/W, process it, display it on the graph, and the user later can do some modifications(like changing the senstivity, sweep speed, or filter values) on the plotted data.

 

I am using producer Consumer architecture to implement my program.

In the producer loop i have an event strucutre which has a timeout event(10 ms) where i acquire data from the H/W and in the Consumer loop i process the data.

So all the data i recieve from my H/W is processed and loops around in the Consumer loop.

And all the events of change in Senstivity, Sweep, Filter are in Producer loop. So where these events are occured, i need to operate on the data which is lying in the Consumer loop.

 

I just need to know how can i process on data which is lying in another loop. Do i need to use Variables, Graph values, or is there any more efficeint way to operate on the data?

 

 

Thanks,

Ritesh 

0 Kudos
Message 1 of 3
(2,706 Views)
Solution
Accepted by topic author LVCoder

In Producer/Consumer Design Pattern that Labview has, it uses a queue to transfer the data to the other loop.

So there is one answer. Use a queue.

 

You didn't say how big are your data or what type are those. So i will just say this: Another solution, i usually use, is to store the data in a function global (or action engine)

All your actions should start reading this, and at the end write the new value back at the function global, so it will be ready to be read by the next action

Message 2 of 3
(2,701 Views)

Hi Pnt,

Thanks a lot for your reply.

Action Engines are indeed great structures to work with. And the link to that Nugget is simply awesome for any beginner to the topic like me .

 

 

Ritesh 

0 Kudos
Message 3 of 3
(2,662 Views)