LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

clearing the indicators before the program starts.

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
0 Kudos
Message 1 of 11
(4,455 Views)
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.
0 Kudos
Message 2 of 11
(4,455 Views)
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.
0 Kudos
Message 3 of 11
(4,455 Views)
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.
0 Kudos
Message 4 of 11
(4,455 Views)
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
0 Kudos
Message 5 of 11
(4,455 Views)
You can setup the VI Properties to do this.
From the VI's window, goto File >> VI Properties >> Category >> Execution >> Clear Indicators When Called.
Message 6 of 11
(4,455 Views)
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
0 Kudos
Message 7 of 11
(4,455 Views)
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
0 Kudos
Message 8 of 11
(4,455 Views)
> 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.

Greg McKaskle
0 Kudos
Message 9 of 11
(4,455 Views)
This works at least in LabView 6 and 7.
0 Kudos
Message 10 of 11
(4,455 Views)