LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

refresh Buttonstatus while running while loop

Hello

I have a while loop, which should be aborted when a switch change form true
to false (or vise versa).
The problem is, that the swicth is also needed in an outer case structure so
that it is not possible to place the switch inside the whileloop, but this
is neccessary to refresh the switch status.

So how can I place a switch outside all structures and make sure that the
switch will be refreshed during a running while loops.

Greets
Mathew
0 Kudos
Message 1 of 4
(2,867 Views)
If you are using a version of LabVIEW which supports the Event structure, look into that.

In general the user interface should be in an independent loop. Changes in controls are then passed to the loops which do the main work of the program via queues.

Search the archives for GUI (graphical user interface), queues, and state machines for much information about how to set up such programs.

Lynn
0 Kudos
Message 2 of 4
(2,867 Views)
You could accomplish what you are trying to do with local variables. However, I think that there is a better approach to your problem. Instead of running the while loop inside the case structure I suspect that you could modify your program such that the case structure is actually inside the while loop. This will eliminate the problem that you are having without restorting to local variables or even notifiers or queues. It will also provide additional flexibility of your program as it will be easily transferred into a state machine architecture.
0 Kudos
Message 3 of 4
(2,867 Views)
"MH" wrote in news:2t1n0mF1pkm4iU2@uni-berlin.de:

> Hello
>
> I have a while loop, which should be aborted when a switch change form
> true to false (or vise versa).
> The problem is, that the swicth is also needed in an outer case
> structure so that it is not possible to place the switch inside the
> whileloop, but this is neccessary to refresh the switch status.
>
> So how can I place a switch outside all structures and make sure that
> the switch will be refreshed during a running while loops.
>
> Greets
> Mathew
>
>

Hallo Mathew,

you can create property nodes of all frontpanel objects. Using these, you
can access this objects from as many places and whereever you want in your
sourcecode.

Oliver Friedrich
0 Kudos
Message 4 of 4
(2,867 Views)