LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Async Timer GetAsyncTimerAttribute / SetAsyncTimerAttribute doesnt work (CVI2020)

I use CVI 2020 and Async Timers and have problems using the GetAsyncTimerAttribute and SetAsyncTimerAttribute functions. They seem not to work.

 

I create a timer with in main thread:

 

IOUpdateTimer = NewAsyncTimer (0.1, -1, 1, atcbIOUpdate, NULL);

 

The EventFunction atcbIOUpdate() runs every 100ms, that works so far. But if I try to change the interval via the following function in main thread, it doesnt work.

 

dblValue = 0.05;

SetAsyncTimerAttribute(IOUpdateTimer, ASYNC_ATTR_INTERVAL, dblValue);

 

return value = -5 means "Initialization with a call to NewAsyncTimer was not done."

 

If I try to read attributes I get the same error.

0 Kudos
Message 1 of 2
(119 Views)

Found my mistake. IOUpdateTimer was static not global.

0 Kudos
Message 2 of 2
(93 Views)