06-17-2010 03:02 PM
Hello,
I am using a USB-6218 to measure voltages using a third-party software (Neurobehavioral Systems Presentation).
Most of the time it works well, but every now and then I get the -200474 error.
The Presentation Software allows setting timeout values when acquiring data, I tried various timeouts from 1 to 10 ms, and it does not seem to influence the frequency of the error at all.
The task for the USB-6218 is set to read analog input 9, 10, or 11. Presentation reads them separately, although read of AI10 always occurs soon after read of AI9. The error may occur during any of these reads. (I also disabled reads of AI11 for now to reduce the frequency of the error so I can test other parts of my Presentation code, the error keeps showing up from time to time when reading AI9 or AI10).
The task Acquisition mode is 1 Sample (On Demand).
Any suggestions?
06-18-2010 10:16 AM
Hey,
When this happens, I recommend resetting the device in Measurement and Automation Explorer (MAX) (Start»All Programs»National Instruments»MAX). To reset your device, expand Devices and Interfaces»NI-DAQmx Devices, and then right-click on the USB-6218 and select Reset Device, as shown:
Do you know what version of DAQmx that the third-party software uses? Is this software an executable, or does it give you access to the source code? It's possible that this is just a bug that was encountered in an earlier version of DAQmx.
06-18-2010 12:42 PM
I'll try to find out what version of DAQmx is used by them. I can't see their source code, only the interpreted script code which I write in their system.
How should device reset help? Should it reduce the frequency of the error?
06-21-2010 02:58 PM
Hello,
Resetting the DAQ device performs a hardware reboot of the device. The reset aborts any running tasks and restores the device to its default settings.
Best regards,
Ali M
Applications Engineer
National Instruments
06-21-2010 04:10 PM
Hello,
we got the following information from the other company:
"Presentation [the name of the program] uses the NI-DAQmx version 7.0 header files, and loads the library nicaiu.dll at runtime. This is probably installed in the System32 folder."
Does it help with troubleshooting?
06-21-2010
09:45 PM
- last edited on
06-12-2024
08:12 AM
by
Content Cleaner
Your device (USB 6218) is not supported hardware by DAQmx 7.0. That could be the main issue. See the Readme document of this driver. Also have you contacted the developers of this application to see if they have encountered this issue in the past? How did they resolved it?
06-21-2010 09:55 PM
Yes, I have contacted them - they provided me with the information that the program uses "version 7.0 header files". I am not sure how this is relevant, as I upgraded NI drivers (including, I believe, DAQmx) to the most recent version.
06-23-2010 09:18 AM
I worked with the developer of the other program, and here is what has been determined.
1. Their program should use whichever DAQmx version is installed, in my case it should be the newest one.
2. The program loads nicaiu.dll and uses DAQmxSetReadChannelsToRead and then DAQmxReadAnalogScalarF64.
3. Timing has been tested by measuring current time, reading the NI card (with 5 ms timeout value), measuring current time again.
The time difference typically was between 2 and 3 ms, but sometimes (probably like 0.1-0.01%) it could be as long as 80 ms. Interestingly, it was possible do have time difference of 80ms and no timeout error despite timeout being set to 5 ms. Any explanation for this? From time to time the error would show up, no idea how long did it last in such case because the program would stop on error, and the second time emasurement was not done.
Any suggestions? Is it possible that my NI device acts in this way because it is simply faulty/broken? Is there a way to run internal tests?
06-23-2010 01:22 PM
Both Windows as well as USB are non-deterministic. If Windows decides to allocate your processor use for another task then you could get a very different amount of delay as measured by the software. For DAQmx Read, I usually set a timeout value of 1 or 2 seconds depending on how much data I am trying to acquire--the default timeout for DAQmx Read is actually 10 seconds!
Setting a timeout of 1 to 10 ms is probably not going to always allow enough time for your data to become available with the higher latency and non-determinism of USB.
Best Regards,
06-23-2010 01:52 PM
Thank you. This may be the reason. Unfortunately, we are checking our voltages in a loop that needs to perform other tasks and we don't really want it to stop for a second or two. I am going to run some tests with 150ms timeout, I have not seen delays longer than 80 ms. I guess the only reasonable solution to keep the delay low (like typically <=20-30 ms) is to switch to a PCI interface? 😞