Hello,
I have written some DAQmx code in LabWindows/CVI 8.0 with NI-DAQ
8.0 which creates and starts a Task for finite samples AO generation.
The code uses function DAQmxWaitUntilTaskDone() to wait for data
generation completion and then performs subsequent jobs before
restarting the same task for a novel AO generation. The program runs
perfectly with a PCI-6259 M-Series multifunction card.
During the time the code waits for the task end, any user interface management either is not possible or is very slow.
In order to be able to speed-up the UIR responsivity even during the AO
finite sample generation, I tried to re-write the code in order to use
function DAQmxRegisterDoneEvent to register a callback responding when
the finite sample generation terminates. Really I am not sure this is
the best way to obtain a better UIR handling, but nevertheless I tried.
The problem I am encountering is that the code enters into the
registered callback with an apprently random timing. This is easy to
check since I have put a numeric counter into the UIR which is updated
with an increased number as soon as the program enters into the
callback. The behaviour is the following:
1) the numeric waits for a certain time to get increased the first time
2) if I do NOT interact with the UIR setting other controls, the
numeric gets increased slower than using the "old code" where it was
updated after each DAQmxWaitUntilTaskDone, thus indicating that the AO
generation is no longer optimized
3) surprisingly to me, if I do interact with the UIR, the numeric gets
increased at a rate near that expected (that of the old code).
Apparently the more frequently I act on the UIR, the faster is
the numeric update, i.e. the rate of calls to the callback.
Can anybody help me understanding this issue and how to optimize my code ?
Thanks in advance,
Marco