Hi Jonathan!
Thank you for your interest!!!
I've solved! My problem was a little bit messy...
I'm creating a dll, in which I have functions called from another sw (read, write, configure, etc....), and in the same dll, when the first function is called, I start an infinite loop, in which I continuously read data from input ports (that's for emulating interrupt lines.....), so, it can be that two "read" functions are called "same time", and they execute in 2 threads. But that's not the problem with NIDAQmx (actually, it works!). I was told that NIDAQmx allowss reading-writing on same tassks from different thread (great!).
My problem was that the endless loop, ( while(1) .... readDigitalLines.....) was launched in a thread with
THREAD_PRIORITY_TIME_CRITICAL, that's why my system hang!!!!!!
Formerly, the system didn't hang because I didn't started the task (DAQmxStartTask...), so DAQmxRead function performed slowly. Nice, yep?
I solved setting
SetThreadPriority(th,
THREAD_PRIORITY_NORMAL);
Now it's really good!
Thank you again for caring about thiss matter! Have a nice day!
graziano