Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Error -200474 in USB-6218

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?

 

 

0 Kudos
Message 1 of 19
(11,507 Views)

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:

 

16935i40708177652706ED

 

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.

Regards,

Sara Lewandroski
Applications Engineer | National Instruments
Message 2 of 19
(11,487 Views)

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?

0 Kudos
Message 3 of 19
(11,483 Views)

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

 

0 Kudos
Message 4 of 19
(11,444 Views)

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?

0 Kudos
Message 5 of 19
(11,435 Views)

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?

0 Kudos
Message 6 of 19
(11,424 Views)

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.

0 Kudos
Message 7 of 19
(11,421 Views)

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?

0 Kudos
Message 8 of 19
(11,377 Views)

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,

John Passiak
0 Kudos
Message 9 of 19
(11,364 Views)

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? 😞

0 Kudos
Message 10 of 19
(11,358 Views)