Hi fellas, after the first run of the labview program, the numbers and graphs that appear on the frontpannel indicators are still displayed at the start of the second run until the program goes through a few sequences when these indicator values are replaced by new ones. is there a way to clear the indicators of any data at the beginning of the program? Roshan Shrestha
Yes. Use local variables or property nodes. For example, to clear a graph you can wire an empty array to the graph's local variable and to clear a chart, wire an empty array to the chart's History Data property node.
I'm sure there could be better ways of doing this, but I usually just add another frame to the sequence (as the last frame) which changes all the values back to zero, or whatever condition you'd prefer to see at startup. This can be quite easy, with using local variables and writing the desired values to them in that last frame. Hope that helps.
You could use local variables. Wire an inital value into the local variable, and place it on the diagram so it will execute before the main loop. Local variables are created by right clicking on a control or indicator on the block diagram, and selecting Create>Local Variable. To change a local from Read to Write, right click on the local and select the item you want. Use these with caution, locals inside a loop or structure can slow the performance of a VI.
Before you save the VI, right click on the indicators to select DATA OPERATION. If it's a chart then click CLEAR chart. If it's a numeric indicator, then type in a 0. Then go to Operate/make current values default. Then SAVE again. (important!)
That should do the trick.
eric
Eric P. Nichols P.O. Box 56235 North Pole, AK 99705
thanks ya'll for your info. but I read in one of the threads that if you go to VI properties, and click on execution, you will have an option to clear all indicators when executing. this seems to be the most "non-complicated" way of doing it.! eric, I have 20 zillion indicators that is why going around clicking data operation would be a little less feasible. thanks again. Roshan
thanks ya'll for your info. but I read in one of the threads that if you go to VI properties, and click on execution, you will have an option to clear all indicators when executing. this seems to be the most "non-complicated" way of doing it.! eric, I have 20 zillion indicators that is why going around clicking data operation would be a little less feasible. thanks again. Roshan
> Hi fellas, after the first run of the labview program, the numbers and > graphs that appear on the frontpannel indicators are still displayed > at the start of the second run until the program goes through a few > sequences when these indicator values are replaced by new ones. is > there a way to clear the indicators of any data at the beginning of > the program?
You already have a number of responses, most of which will work fine. If using a recent version of LV, you can open the VI Properties and go to the Execution page. There will be an option to clear indicators before running. Turn this on for panels that you want this feature on. If not using such a recent version, you can use local variables.