This seems to be related to some general VB weirdness. It seems that if I step thru the code as it runs, I dont get the overflow, while if I just run the code ( and only the first time), i get this overflow. The culprit seems to be the timeout value. Im not sure why its causing an overflow, but try changing the timeout in the above mentioned function to 10#. Hence a 10 second timeout, instead of infinite. If the data is not written within 10 seconds, something wrong anyway, right?
So the final result will be
DAQmxErrChk DAQmxWriteDigitalLines(taskHandle, 1, 1,
10#, DAQmx_Val_GroupByChannel, writeArray(0), sampsPerChanWritten, 0)
Hope this helps. I'll make sure the example is updated to reflect this.
Bilal Durrani
NI