LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

XY graph plotting issue with repeting data inside loop

Solved!
Go to solution

Thanks but do you noticed the gap in the data plot also. Can that be fixed?

0 Kudos
Message 11 of 18
(1,304 Views)

Sorry I don't see a gap.  The chart is going to draw a line between each data point so there shouldn't be a gap.  

aputman
0 Kudos
Message 12 of 18
(1,300 Views)

Maybe the picture you posted is not clear enough but also in mine I still have the gap between eac data set for each iteration

0 Kudos
Message 13 of 18
(1,290 Views)

Post a picture of your graph so we can see what you are talking about.

0 Kudos
Message 14 of 18
(1,283 Views)
Solution
Accepted by topic author ritch_by_nature

If you are just trying to simulate data to be replaced with actual live data later, here is one way to do it using the Build Waveform node.  This assumes that you have 5sec between each data point (as your data shows).  This code doesn't clear out the graph when the channel is changed (I'll leave that for you).  

 

Also the code errored out for me using your text file.  I had to open the XLSX file and export a CSV file.  My CSV is also attached. 

aputman
Download All
0 Kudos
Message 15 of 18
(1,276 Views)

Here's what I get. I dont know where I went wrong

 

Admin Note - Attachments removed per user's request

0 Kudos
Message 16 of 18
(1,273 Views)

You are generating individual waveforms with different T0's for each one and sending those waveforms to the waveform chart.  LabVIEW is smart enough to treat them as distinctive waveforms and shows them as such.

 

If you look at APutman's VI, you'll see he is just sending the data array to the waveform chart.  The chart then assumes the first element of the next array immediately follows the last element of the previous array (separated by whatever deltaT you defined for the chart) and treats it as one long continuous signal.

 

(Recommendation, start getting rid of those False constants wired to the stop conditions of the while loops now.  Your outer while loop on the lower section is pointless because it will never run more than once due to the infinite inner while loop.  Right now you are forced to abort your VI in order to stop it.)

0 Kudos
Message 17 of 18
(1,246 Views)

Thanks RavensFan

0 Kudos
Message 18 of 18
(1,240 Views)