레이블이 DAQmx인 게시물을 표시합니다. 모든 게시물 표시
레이블이 DAQmx인 게시물을 표시합니다. 모든 게시물 표시

2014년 10월 15일 수요일

The way to solve LNK1123 error




You probably have an experience which is occurred a link error when you use Visual Studio. There are many link errors. 

In this article, I'm going to solve the error related to LNK1123. LNK1123 error occurred many a time if you got the code from other person or a website likes table below. 

fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt

At the beginning to implement a DAQ application for C, C++ using NI's example, you can show this error when you compile an example like a picture below.

I got this error when I compiled DO example.


To solve it, you need to change a property which is associated with Enable Incremental Linking in Visual Studio.

At first, you should click properties menu for it.


After a click, you can see Property Page. you can find a solution in Linker category likes a picture below.
(Path : Configuration Properties - Linker - General)


This property's default is 'Yes(/INCREMENTAL)'. If you change this value to 'No(INCREMENTAL)', you will resolve this error.


This article explained the solution for LNK1123.
Thanks.


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?