ni.com is currently experiencing issues.

Support teams are actively working on the resolution.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

plotting dynamic data but plot showing previous acquired data too

Solved!
Go to solution

Hi, I am trying to plot a voltage-signal graph simultaneously, as it is being acquired by the computer from the SR830 lock-in amplifier. I have used a X-Y plot and placed it inside the for loop where the data is being acquired. <It only shows me the last point instead of all the points acquired earlier too. I want to retain the earlier data plot as well instead of just the last data point but want to update the graph as the data are acquired sequentially. If I put the x-y plot outside the loop. it will acquire a set of data before plotting which is not desirable in my case, as data has to be plotted dynamically. Can u guys please suggest me a way. Am I doing something wrong? thanks in advance.

 

Please find the VI attached. 

0 Kudos
Message 1 of 9
(4,644 Views)

You are close, but not quite.

Right before you use the 'Build XY Graph' express function, you turn a double precision value into a 1D array.

I'm assuming you are doing that to try to build an array, but thats a little incorrect.

I do not have the two subVI's that you use so I cannot run your VI.

However, please try to run the modified version of your VI and let me know if it works.

Cory K
Message 2 of 9
(4,637 Views)

The "built xy graph" express VI has a "reset?" input. Wire a true to it to reset the internal data. In your particular case do a "=0" on the iteration terminal of the inner for loop and wire it to the reset input.

0 Kudos
Message 3 of 9
(4,633 Views)

 


@altenbach wrote:

The "built xy graph" express VI has a "reset?" input. Wire a true to it to reset the internal data. In your particular case do a "=0" on the iteration terminal of the inner for loop and wire it to the reset input.


Now I'm confused. Does he want to keep the previous data or not?
He made it sound like he is only getting 1 point in the graph, but he wants to keep all of the data in the graph

 

Cory K
0 Kudos
Message 4 of 9
(4,624 Views)

I am sorry about the title it should read like "plotting dynamic data but not plot showing previous acquired data". My plot is only showing the most recent data but not the previous ones ... I want them too in my plot.

0 Kudos
Message 5 of 9
(4,620 Views)

This should work

 

Some things to consider:

 

1. Look into the producer consumer architecture.

2. Have the write to file done in a different loop.

Tim
GHSP
0 Kudos
Message 6 of 9
(4,619 Views)
Solution
Accepted by topic author mssrb

 


@cory K wrote:

 


@altenbach wrote:

The "built xy graph" express VI has a "reset?" input. Wire a true to it to reset the internal data. In your particular case do a "=0" on the iteration terminal of the inner for loop and wire it to the reset input.


Now I'm confused. Does he want to keep the previous data or not?
He made it sound like he is only getting 1 point in the graph, but he wants to keep all of the data in the graph

 


 

Sorry, my message was incomplete. You need to double-click the "build xy graph" express VI and un-check "clear data on each call".  Easy enough? 😄

 

 

Whenever you want to start over, wire a true to the reset input to clear the history.

Message 7 of 9
(4,612 Views)

 


@altenbach wrote:

 

 

Sorry, my message was incomplete. You need to double-click the "build xy graph" express VI and un-check "clear data on each call".  Easy enough? 😄

 


Normally, I would say unchecking a box would be easy.

However, I dare not risk navigating through an express VI, we've lost too many good men in those dangerous waters Smiley Very Happy

 

Cory K
Message 8 of 9
(4,596 Views)

Thank you mate. That did the work. Thank you again.

0 Kudos
Message 9 of 9
(4,593 Views)