10-14-2011 04:11 AM
Hello,
I do not succed in using the USB6009 on Windows Seven whereas I succed it in on Windows XP and OpenSuse 11.2
I wrote a short C++ software to monitor temperatures:
- I installed the lastest NI drivers using the NI install tools (for Windows and Linux) and used the DAQmx and DAQmxbase sources.
My software works properly for days on Windows XP and Linux.
Unfortunalty, it crashs on Windows Seven after tens of minutes !
I got the DAQmxReadAnalogF64 Error Code: -200284 (Timeout 5seconds, No Trigger, Clock as "") and DAQmxResetDevice Error Code -200220
Step by step the DAQmxReadAnalogF64 is not able to send (or read) the all samples.
Do you have any ideas which could help me to solve the problem.
Remarks:
USB6009:
- sampling rate is 1000hz
- Number of sample 10
- TimeOut 5s
- channel "/Dev1/ai0, /Dev1/ai4, /Dev1/ai1, /Dev1/ai6"
- I create the Task.... Read... Stop and Clean the Task each times the user need (for example every 1 minute)
10-14-2011 12:41 PM
One thing that would help is to put the create and destroy task outside of a while-loop and just do the read inside the loop. Creating and destroying tasks leaks memory. Unless there's a good reason to reconfigure the output (change ranges, for example) then open it once and read it as many times as you need to.
Another thing to check is that the device isn't on a USB hub...
And good luck... i'm not impressed with 7... its given me nothing but problems over the past year.
10-24-2011 06:12 AM
Hello,
SnowMule is right. Always create, configure, start and destroy your task out of while loop.
Other thing to test: try chosing 100 samples when acquiring at 1kHz. Keep in mind this equation:
sampling rate = 10 x number of samples
This will work in most cases.
If it does not solve the issue, try to set a "DAQmxGetReadAttribute (TaskHandle, DAQmx_Read_AvailSampPerChan)" in the while loop to see if the board's buffer is getting to be full or not. That's for error -200284.
For error -200220, look at the name of the board in MAX. Is it still named Dev1?
Hope this helps.
Best Regards,
Jean-Philippe C.
National Instruments France
10-24-2011 06:16 AM
Thank you for you both.
I will modify my soft and test it. But those days I am on the field, not in my office.
Merci, je vous tiens au courant.
Cordialement,
Francois