LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

how to create a time event without having user interface freeze

Solved!
Go to solution

Hi,

 

I am new to labwindows and i am trying to create a time event where every hour for 24 hours i want my program to write somethign in excel. 

 

I tried using function Delay and SyncWait and those functions freezes up the user interface.

 

Any tips/help will be appreciated.

 

Thank You

0 Kudos
Message 1 of 3
(3,891 Views)
Solution
Accepted by topic author Jay_R
If you are new to CVI, a good idea is to look at the examples that ship with CVI. For your case, I would recommend timer.cws and asyncdem.cws. You will find, that you should use a timer, not the delay or syncwait function.
0 Kudos
Message 2 of 3
(3,883 Views)

Many, if not most, CVI developers wind up implementing a delay function for themselves that periodically, during the delay, wakes up and processes events so that the GUI isn't frozen.

 

The idea is to break the wait or delay up into pieces, and process system events in between each piece.

 

A timer works too, you can try the async timer that Wolfgang mentioned, it runs a bit better and on a separate thread, so it lets you do what you normally would with the main thread and the GUI, yet still get timer function.   If you use a smart delay, you still wind up doing nothing a great deal of the time, and events are only processed periodically.

 

 

0 Kudos
Message 3 of 3
(3,842 Views)