In the NI-DAQ function reference, it does not mention if the function is async or sync function. I need to know if there are some problems and the NI-DAQ hanged up, will the following function return after a period of time (i.e. timeout)?
Only the AI_Read() function will return a timeout error code if it does not complete in a set amount of time. The other functions should execute immediately when called.
You can set the "timeout" value by calling the Timeout_Config function.
Let me know if you have further questions.
Sincerely,
Sean C. Applications Engineer National Instruments
I am considering the worst case: if the NI-DAQ or the hardware have some problem, and at that time I call function DIG_In_Line(). Will the function still return in a timed manner? If this function call does not return, it will block the execution of my program.
If there is something wrong with your hardware, your code will immediately return an error. To check this, use an unassigned board number in the DIG_In_Line() function. You will immediately recieve the error -10401. You can then choose to ignore the error, or halt the program. To ignore the error, select Run >> Break On and deselect Library Errors.
Let me know if you have any further questions.
Sincerely,
Sean C. Applications Engineer National Instruments