LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RS232 questions...

please your advise..
i am using now the trial version..(labview#7)
when i run the application few times
all indicators preserve last response/status
and it is not good for beginning the next RUN...
how can i PRESET or CLEAR my controls on front panel
to a default value/status?
0 Kudos
Message 1 of 8
(3,355 Views)
Put an initialization step into your code. If you want a numeric indicator to start at zero, create a local variable and wire in a zero. Same for strings and booleans. Just wire in the default values. Put all your initialization code inside a sequence structure. Wire Error In (or anything else) to pass into and out of the sequence so that the sequence gets executed before any other code.
- tbob

Inventor of the WORM Global
0 Kudos
Message 2 of 8
(3,355 Views)
Before you run the vi, or at the end of the run, From the menu "Operate", select "Reinitialize All to Default"
or, you may create local variables and property nodes that initializes all the controls and indicators to the proper settings.
0 Kudos
Message 3 of 8
(3,355 Views)
Using VI server, open a reference to itself, then use the method, ReInitialize All to Default. See the image.

Joe
Message 4 of 8
(3,355 Views)
i am new to LBV, can you be more specific about
"...may create local variables and property nodes that initializes all ..."

what you mean?
0 Kudos
Message 5 of 8
(3,355 Views)
see attached vi
it uses local variables and property nodes.
also data are passed from one varibale to the other thru local variables and property node (value)

there should some examples that ship with the LabView software illustrating the concepts.
0 Kudos
Message 6 of 8
(3,355 Views)
Great idea!!! Smart and Speedy way to clear panel. Thanks Joe!!!
0 Kudos
Message 7 of 8
(3,355 Views)
The only catch to this method is
if for instance, the normal desired setting for a control is ENABLED, and during the vi run, it is set to DISABLED, and the vi is saved (before the method is called). The default setting will be DISABLED assuming that the vi is then closed.
When the vi is later loaded, the control will be DISABLED (by default). With Proper programming, one can avoid that.
Another thing, this method did not work with stand-alone LV executables under LabView 6. I think it works now under version 7.

Just a thought.
0 Kudos
Message 8 of 8
(3,355 Views)