2014년 10월 5일 일요일

[DAQmx] When an error occurred in USB DAQ, the method to restart it programmatically

You often find the error -50405 or -50808 when you use a USB DAQ device. This error is related to the usb transaction. The main reason for it is a communication fail between the PC and USB Device. 

According to a different DAQmx version, you can find an other error. We should check it to resolve the error.

Error -50405 : It occurred when you used DAQmx 9.3.5 or below.
Error -50808 : It occurred when you used  DAQmx 9.4 or above.

This error occurs again after it. National Instruments provides the solution for it like it.

  1. The user who uses DAQmx 9.8 can call the Device Reset.
  2. Windows Users can configure whether the USB device can be used or not.
  3. The user can reconnect the USB Device.

Above three methods are to solve the error -50405, -50808.
Number 2 and 3 is the method which is manually processed by user.

But you should take a process for Number 1 programmatically. This article is going to show the example for it. When occurred this error, You should make a code like a below picture.




This is a simple  description for the above code.
1) DAQ Assistant can make a DO signal. And the first While Loop is closed when you push the Stop Button or Some Error is occurred.
2) When error is occurred, the second while loop can make a reset to the USB device.
3) When you set the true to a Stop Button, this program is exited.

To resolve it, you should use  DAQmx Reset Device.vi. This VI is the method to reset the USB Device. I made code to reset the device and make a DO signal again.

You can make a code easily to resolve the error.

[Related Works]
Why Do I Receive Error -50405 or Error -50808 Using an NI USB DAQ Device When Inserting or Removing an Additional Device?

댓글 없음:

댓글 쓰기