10-23-2024 04:03 AM
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.
10-23-2024 07:28 AM
Found my mistake. IOUpdateTimer was static not global.