LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event structure and updating front panel

Hi,
I have a problem with event structure in LabVIEW 6.1.

My problem is referred to time (and date) updating into the front panel of
my main VI while an event structure is active. I don't want set time of
events to get periodic timeout events generation, because I'd like to spend
not too resources of my system.

Now the front panel of my program is updated by events only when someone
move the mouse.

How can I update the current time in the main window of my VI using events
without timer (or another way)?

Thanks in advance.

Best regards.

--
*SBS*
0 Kudos
Message 1 of 6
(3,166 Views)
Hi Emanuele,
let me see if I undersood your problem:
you have a while loop with an event struc. inside with no timeout; on the panel you have indicators for time and date. When no event is generated your indicators are not updated.

In this case you can place the code that updates the time and date indicators in a parallel while loop that does not wait for events, if you place a Wait function with relatively long time delay you won't engage your system resources.

Good luck,

Alberto
0 Kudos
Message 2 of 6
(3,166 Views)
The simplest way is to add a timeout (200 ms or so) to the event structure. This should not tax your cpu resources too much.

Another way is to put the front panel display time in a separate parallel loop. See attached. Of course, it only moves the time-out section to a different loop, it's really pretty much the same thing processor-wise.
0 Kudos
Message 3 of 6
(3,166 Views)
During a dark and stormy night *alberto* wrote:

:: Hi Emanuele,

How can you know my name?
Have you seen it inside another newsgroup? Perhaps TeX...

Do you speak italian?

:: let me see if I undersood your problem:
:: you have a while loop with an event struc. inside with no timeout; on
:: the panel you have indicators for time and date. When no event is
:: generated your indicators are not updated.
::
:: In this case you can place the code that updates the time and date
:: indicators in a parallel while loop that does not wait for events, if
:: you place a Wait function with relatively long time delay you won't
:: engage your system resources.

You have undestood my problem exactly. I have tried your solution without a
wait function, but at its place I h
ave put a metronome set to 500ms. It
doesnt work.

Can you give me your email address, if you are italian, please?
(cut off APPLE from my address)

--
*SBS*
0 Kudos
Message 4 of 6
(3,166 Views)
Era una notte buia e tempestosa e *alberto* disse:

:: Hi Emanuele,
:: let me see if I undersood your problem:
:: you have a while loop with an event struc. inside with no timeout; on
:: the panel you have indicators for time and date. When no event is
:: generated your indicators are not updated.
::
:: In this case you can place the code that updates the time and date
:: indicators in a parallel while loop that does not wait for events, if
:: you place a Wait function with relatively long time delay you won't
:: engage your system resources.

Thank you!
I've tried your advice one more time, and now it works!

Grazie ancora.
Non capisco proprio perché prima non funzionava.

--
*Emanuele*
0 Kudos
Message 5 of 6
(3,166 Views)
Ciao Emanuele,

ebbene si, sono italiano!
Mi fa piacere che hai risolto il problema, la programmazione con while loops paralleli non si trova spesso negli esempi di LV, anche se spesso è il miglior sistema per far 'girare' parti di programma con diverse tempistiche.
Il tuo nome si vede dall'intestazione della tua domanda.
Mi fa piacere che ci siano altri connazionali che frequentano questo forum, puoi contattarmi per uno scambio di opinioni all'indirizzo: altek@tin.it

Saluti,
Alberto
0 Kudos
Message 6 of 6
(3,166 Views)