10-05-2018 11:16 AM
I am simply reading a csv data from file or getting similar line profile data from image. Then I am plotting its graph inside a while loop and also doing curve fitting ouside the loop.Praogram works fine but on running next time in some graph earlier data is retained. I wish that all the graphs/ charts etc inside this simple while loop should initialize when I run it next. In properity dropdown for these chart/graph clear option is there which I am using each time before rerun but how to activate that clear chart on running the program. I can see some lengthy solution using shift register which I wish to avoid. VI and data file is attched
Solved! Go to Solution.
10-05-2018 11:34 AM
Graphs will clear each time you write to them. Charts will keep the history. To clear a chart, you have to write an empty array to it's History property.
10-05-2018 11:42 AM
Go to "vi properties...execution" and check "clear indicators when called". That's all you need.
10-05-2018 12:03 PM
Thanks and it worked for full VI. Means it will be good if entire VI indicators are initialized what if only a particular while loop or section of program is to be initialized
10-05-2018 12:09 PM
@AjayShankar wrote... what if only a particular while loop or section of program is to be initialized
Use Tim's solution. Have you tried?
10-05-2018 12:26 PM - edited 10-05-2018 12:31 PM
OK, back on a computer and I can look at your code.
So please go back and make a simple demo VI that relates to the question in some way (e.g. actually contains a loop and such)
10-05-2018 01:56 PM
But in while loop curves keep ob blinking . Trying to fix
10-05-2018 02:06 PM
See one portion of code while using Tom solution my graph is blinking. Actually I am using two sinusoidal signals generated from the line profile of an interference pattern as sine and cosine signal . I have to find its quadrature error therefore I will have to plot it individually as well as one against other to see circle fitting. Its only an initial part. I wanted to solve it piece wise so took its line profile, saved it as csv data file and trying to fit curves. Attaching VI to see where I am missing
10-05-2018 02:14 PM - edited 10-05-2018 02:15 PM
Never attach a new VI with the same name of another VI you have attached earlier. Always give it a new name!
Why do you think you need to re-read the same fine 20x per second?
Why do you use a chart instead of a graph?
10-05-2018 02:37 PM
@AjayShankar wrote:
See one portion of code while using Tom solution my graph is blinking. Actually I am using two sinusoidal signals generated from the line profile of an interference pattern as sine and cosine signal . I have to find its quadrature error therefore I will have to plot it individually as well as one against other to see circle fitting. Its only an initial part. I wanted to solve it piece wise so took its line profile, saved it as csv data file and trying to fit curves. Attaching VI to see where I am missing
OK, this does not make a lot of sense and seems overly complicated.