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.
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.
09-13-2011 03:55 PM
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.
Solved! Go to Solution.
09-13-2011 04:42 PM
Can you attach the vi and the data you are using to make the plot?
09-13-2011 04:46 PM
The the VI should load with the values I used to make the plot already filled in.
09-13-2011 04:58 PM
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....
09-13-2011 05:10 PM
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.
09-13-2011 05:13 PM
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?
09-13-2011 05:26 PM
@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.
09-13-2011 05:49 PM
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.
09-13-2011 06:00 PM
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.
09-13-2011 07:31 PM
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.