Measurement Studio for VB6

Showing results for 
Search instead for 
Did you mean: 

USB-6501 how to realize: fast PWM wave ?


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 ??

0 Kudos
Message 1 of 4

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 ???
OSC.jpgnot stable freq. 2m.. 5m


0 Kudos
Message 2 of 4


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.

0 Kudos
Message 3 of 4

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)



0 Kudos
Message 4 of 4