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: 

XY graph plotting issue with repeting data inside loop

Solved!
Go to solution

Hello,

            I have this issue I am having with my plots. Maybe there is a better way to do this.

            I have a set of data that I am using inside a loop. I want the loop to keep reusing the same data over and over. The reason I am doing that is because I want to continuously stream data that loop exactly like the one in my data file and plot it and do other different things with it. My problem is the XY graph is not plotting it properly. I wonder if anyone can help me get the plot working and alo get the data moving accross the waveform XY graph.

Files are attached. Test.vi is the main vi

 

Admin Note - Attachments removed per user's request

0 Kudos
Message 1 of 18
(3,649 Views)

THe glaring problem that i see is you are trying to read from an XLSX file rather than a CSV.  Spreadsheet string to Array reads from a text file.  If you want to read from Excel native format, you need to use the Report Generation toolkit to read the values. 

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 2 of 18
(3,642 Views)

Thanks for replying, but I guess I didnt pay attention to that. But nevertheless it reads it and I get the right data out. Here's a copy in .txt format

 

Admin Note - Attachments removed per user's request

0 Kudos
Message 3 of 18
(3,619 Views)

An XY graph doesn't have history.  If you want the data to "move across the graph" as you add more data, you'll have to use a waveform chart.  Am I understanding your question correctly?

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 4 of 18
(3,614 Views)

Well yea, but when I build a waveform and use a waveform chart I have gaps in my data. Since Im streaming the same set of data, each time the loop iterate I get a new same of the same data but in between there's an empty space. Also if i change the channel, then the previous channel has to be gone of the display before seeing a full view of the then selected channel.

0 Kudos
Message 5 of 18
(3,602 Views)

Replace the XY Graph with a waveform chart and wire as shown.  To clear out the previous history, you'll need to detect a change in value of the listbox.  When a change occurs, wire in an empty array to the History property node for the chart.  

Capture.PNG

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 6 of 18
(3,591 Views)

Thanks for replying but I am alos trying to use the right time stamp for the data im displaying on the plot. Which I noticed you didnt implement in your snipet

0 Kudos
Message 7 of 18
(3,561 Views)

Also that technique did not work.

0 Kudos
Message 8 of 18
(3,557 Views)

@ritch_by_nature wrote:

Also that technique did not work.


You are going to have to explain your requirements better because it works for me (at least my understanding of your requirements).  

Capture.PNG

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 9 of 18
(3,551 Views)

@ritch_by_nature wrote:

Thanks for replying but I am alos trying to use the right time stamp for the data im displaying on the plot. Which I noticed you didnt implement in your snipet


If you want a timestamp on the X-axis, use the build waveform node.  However this won't give you what you are looking for with this sample data, if you want the plot to keep "moving across the graph".   This is because the waveform is going to have the same x values every time.  It's essentially plotting the data on top of the previous plot.  

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 10 of 18
(3,537 Views)