Hello Lei,
It looks like you may have already done some research on this issue and I appreciate that. NIDaqDelay is a utility function that was first provided with NI-DAQ 5.0. They are provided in DLL form such that they can be called from just about any Windows programming language. Furthermore, this function call utilizes no hardware.
The instance of NIDaqDelay causing some problems when called inside of a loop has come up before in the past. Since the release of these provided functions, the development and support of them has been significantly reduced and removed as NI-DAQmx has no use of them. The issue has been brought to the attention of our development teams, but the only information that they were able to derive is that the crashing/freezing iss
ue is system dependent. Some machines would experience the problems whereas others would not. The only reliable answer that NI is able to provide is that the Windows SDK Sleep function should be used instead if you are experiencing this problem. I was able to find another discussion thread which is directly related to your own. You may find that
here. Regardless of resolution, any type of function call that you are relying on for timed operation will not be as accurate as you want since you are most likely working in a non-real-time environment.
I hope this information helps.
Jared A