01-15-2018 05:30 PM
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.
Solved! Go to Solution.
01-15-2018 06:49 PM
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.
01-15-2018 08:28 PM
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.
01-16-2018 12:25 PM
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.
01-16-2018 01:13 PM
Here is a cleaned up version of your code without the event structure.
01-16-2018 01:31 PM
Thank you so much Crossrulz! This does make perfect sense, I will test it out!
Have a great day.