Do While True
bit = 1 - bit
DAQmxErrChk DAQmxWriteDigitalLines(taskHandle2, 1, 1, 5#, DAQmx_Val_GroupByChannel, bit, sampsPerChanWritten, ByVal 0&)
' this need 2m , too slow , how to faster ??
Is there any setting in DAQmx to let USB-6501 faster output ??
then "Next" above should be "Loop"
I found that the freq. is very not stable : the width should is "2m", but "4.2mm" appears !
and how to faster ? such as , the width = 10us , output from USB-6501 ???
I think this post answers your question:
As the USB-6501 relies on a software clock, the timing will not be as accurate as a device with hardware clock.
I looked at the article you recommended, but it was different from my problem.
He wants to control the duty cycle in the way of software cycle, so the software cycle needs very fast cycles.
My problem : when I set up just only one port with the following function:
DAQmxWriteDigitalLines(taskHandle, 1, 1, 5.0, DAQmx_Val_GroupByChannel, 1, sampsPerChanWritten, ByVal 0&)
(the taskHandle is :
DAQmxCreateDOChan(taskHandle, "Dev1/port0/line0", "", DAQmx_Val_ChanPerLine) )
the function takes 2ms to exit, too slow ! and I just set only one IO port . I cannot understand , while USB-6501 need 2000us to complete this function ?? How to reduce the delay ?
I have tried this : (but not pass)
DAQmxCfgSampClkTiming(taskHandle, "", 10000#, DAQmx_Val_Rising, 10123, 1000)