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: 

Erroneous lines Appearing on XY Graph after initial run

Solved!
Go to solution

After the first time I run my VI, An Erroneous line is drawn between the first and last point on the XY graph. It will become a permanent part of the plot until the vi is restarted. I've tried creating a property node with a value of 0 for the graph as well as changing the vi properties to clear indicators when called.

 

Attached is a screen shot of what I want the graph to look like and what it does look like.

Download All
0 Kudos
Message 1 of 12
(2,717 Views)

Can you attach the vi and the data you are using to make the plot?

0 Kudos
Message 2 of 12
(2,703 Views)

The the VI should load with the values I used to make the plot already filled in.

0 Kudos
Message 3 of 12
(2,698 Views)

Is this your school project?  If it is I will give you a hint........

 

Check the array size between the 1st run and the 2nd run.  I am not even going to comment on the rest of the code at this point....

0 Kudos
Message 4 of 12
(2,695 Views)

I guess I will comment on how you are trying to clear the graph.  You need to make sure it runs before the rest of the code runs.  The first few time I got a blank graph because it would clear the graph after the code ran. 

 

 

0 Kudos
Message 5 of 12
(2,690 Views)

It is, Sorry about all the mess. I wasn't expecting to show it to anyone when I started this.

 

Thanks for the hint! I now know what the problem is, but I don't know how to fix it.

The two charts clear automatically between runs, yet the graph doesnt. Would you mind explaining how that is done?

0 Kudos
Message 6 of 12
(2,689 Views)
Solution
Accepted by topic author ldantin

@ldantin wrote:

It is, Sorry about all the mess. I wasn't expecting to show it to anyone when I started this.

 

Thanks for the hint! I now know what the problem is, but I don't know how to fix it.

The two charts clear automatically between runs, yet the graph doesnt. Would you mind explaining how that is done?


1. What is the problem?  How did you fix it in you while loop?

 

2. Do you want them to clear before the program runs or after?  Data flow......   You have property nodes for 1 chart and 1 graph, what about the other chart?

 

I used to hate when people did this to me, but it does help you learn.

Message 7 of 12
(2,681 Views)

I don't hate it, I really appreciate you taking the time to talk it out with me.

 

I used a case structure to clear the array between runs.

0 Kudos
Message 8 of 12
(2,674 Views)

You have two Feedback Nodes with unwired Initializers, they will remember their values from the previous run and only behave as you expect the first time.  I'd move the initializers one loop out and wire an empty array to them (right-click -> create constant).  Or you could click Ctrl-Run then Run everytime (just kidding do not actually do this.  Actually you can do it a few times to see what happens).

 

Your VI manages to crash LV when I attempt to clean up even a section of your BD, yikes.

 

There is a 2pi constant.  There is a 1/x function,  There is also a compound arithmetic node.

0 Kudos
Message 9 of 12
(2,672 Views)

Seeing the code on a larger monitor now (actually 2 monitors), you can completely remove the Feedback Nodes and simply autoindex the While Loop outputs.  I'd also reconsider writing to the Spreadsheet File every iteration, and using a constants for the file name.

 

You can also Remove the Flat Sequence structure inside the while loop (right-click menu option).

 

Perhaps after cleaning up a bit (and by a bit I mean a lot) you can let the LV Block Diagram Cleanup tool spring into action.  I'd be sure to save first as a crash is probably inevitable.

 

0 Kudos
Message 10 of 12
(2,662 Views)