LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modify Event Structure to Have Continuous Data Acquisition Shown on Graphs

Solved!
Go to solution

Hi Everyone,

 

I have asked a similar question before with the same VI I wrote, and it seems like I didn't frame my question correctly. I will explain it more clearly, and I am attaching my VI below.

 

So when I am running my VI, the graph updates every N samples. Let's say I set "Samples per loop" to 10000 and the "sample rate" to 1000, the graphs will update every 10 seconds, and the x is a 10 seconds frame. I want the graphs to be continuously updating and x (t) will increase all the time. Because I am building my VI on the basis of an example, the event in the event structure is "Every N samples acquired into buffer". And I think this is exactly why the graphs only update when it has "N samples". 

 

Is there a way to restructure the "Event structure" to make the graphs update continuously, not every 10 secs even with a large "samples per loop"?

 

Thank you very much.

0 Kudos
Message 1 of 6
(3,051 Views)

When you get your samples you can put them in a queue. In a separate loop, you can dequeue the samples and wire to a chart.

 

0 Kudos
Message 2 of 6
(3,029 Views)

I'm not even seeing a point in the Event Structure in your example.  You can just tell the DAQmx Read to read your desired number of samples and let that limit your loop rate.


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 3 of 6
(3,011 Views)

Thank you for replying. To be honest, I don't even see the point of using a Event Structure as well. But I started building the VI on top of an existing example, it already had an Event Structure. And actually, this VI worked well on data acquisition, it's just that I want it to do better at live data readings (graphing). 

 

And the weird thing is that when I eliminate the event structure completely, the VI doesn't work properly.

 

Could you advise me on how to take out the event structure?

 

Thank you very much.

 

0 Kudos
Message 4 of 6
(2,971 Views)
Solution
Accepted by topic author tingggggg

Here is a cleaned up version of your code without the event structure.


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 5 of 6
(2,964 Views)

Thank you so much Crossrulz! This does make perfect sense, I will test it out!

 

Have a great day.

 

0 Kudos
Message 6 of 6
(2,960 Views)