From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple runs on a single graph

Solved!
Go to solution

Hi, 

 

 Just a quick question. I am using a Voltage Source meter that spits out an 2 arrays of data after it has done its measurement. I then plot the arrays with respect to each other using an Express XY graph. I have put the code in a for loop so that it does multiple measurements or multiple runs. So if a single run gives me a plot that looks like a straight line, 5 runs would give me 5 straight lines. My problem is that the graph, connects the last value of the previous run to the first value of the next run. I want it to plot each run independently but overlapping them in the same graph so that I can look for deviations. The XY graph is inside the for loop, so I would imagine, that when the instrument spits our the next set of data, it would be plotted in the same graph independently. 

Any Suggestions?

0 Kudos
Message 1 of 6
(2,367 Views)
Solution
Accepted by topic author thentangler

Add an extra NaN value after each iteration.

Message 2 of 6
(2,362 Views)

Thanks for the quick  response Altenbach. So would I be getting 2 columns with 11 elements in each column?

Does Labview just ignore the nan?

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

I have no idea if you would be getting 11 point, because you did not give enough information. But yes, any point having a NaN will be skipped and replced by a gap in the xy graph.

0 Kudos
Message 4 of 6
(2,344 Views)

Sorry,

In my previous post I meant to say, that if I had 2 columns with 10 elements each originally, I would then have 11 elements in the new 2 columns. I would have to be careful though, since I have a mathscript also inside the code, that does some operations with the 10 elements. Would including the NaNs cause a problem in the mathscript operation?

 

0 Kudos
Message 5 of 6
(2,340 Views)

Ah, I never saw the number 10 anywhere. 😄

 

You don't need to process the NaN with mathscript. It is sufficient to add the NaN to the data going to the graph terminal. Even if mathscript gets an NaN, you can probably test how it is handled.

What does the mathscript node actually do? If it is just doing some scaling, it probably will not matter, but if it would do e.g. a linear regression, it would probably give unexpected results.

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