Hi
I'm having a problem discarding asynchronous timers under CVI8.5. After creating and discarding async timers a couple of times I always get to the stage where discarding the timer fails. I had a look in the source code and think I found a problem with NewAsyncTimer() or DiscardAsyncTimer(). DiscardAsyncTimer() assumes that the list of timers is in ascending order of Id but NewAsyncTimer() always adds the new timer at the end of the list. This means that I can't do
NewAsyncTimer() // get timer Id 1
EnableAsyncTimer(1)
NewAsyncTimer() // get timer Id 2
EnableAsyncTimer(2)
DisableAsyncTimer(1)
DiscardAsyncTimer(1) // discard timer Id 1
NewAsyncTimer() // get timer Id 1 again - has Id 1 but is added to the end of the async timer list.
EnableAsyncTimer(1)
DisableAsyncTimer(1)
DiscardAsyncTimer(1) // !! fails to discard timer Id 1 because it is in the list after 2!
DisableAsyncTimer(2)
DiscardAsyncTimer(2) // discard timer Id 2.
Any suggestions on the best way to fix this?
Thanks