Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Re: nimxdfk.dll causes blue screen

Brad,

 

>By "exception handling" do you mean that this is a .NET application? The DAQmx .NET API reports errors as .NET exceptions, which cause the application to terminate unless they are caught. This should not crash the entire system, and the fact that it does indicates the presence of a bug in some of the DAQmx cleanup code.

 

This is a .NET application (C#). We usually put a Try/Catch around the DAQmx calls, but in this one case that was not implemented yet. You are correct in that it should cause the application to terminate if not caught. It seems that this is the case as I get a dialog asking me if I want to submit the problem to Microsoft. When I click on the "Don't send" button, the dialog closes, and so does the rest of the system.

 

As for the sample program, it is in Visual Studio 2008. Let me know if you have any issues. For the most part, it is reading from the device in a separate thread and when a error occurs, it does not stop. I put in the try/catch around the reading calls, but commented them out so the problem remains. To get it to fail, I go to Edit->Settings and set the Sample Rate to 25,000 and then click start. It pretty much fails right away.

0 Kudos
Message 11 of 15
(1,610 Views)

Brad,

 

Have you been able to reproduce the crashing on your end? I had another crash today on another computer, however I did not have the command you gave me running. Any updates yet?

 

Thanks,

sledstorm

0 Kudos
Message 12 of 15
(1,579 Views)

Hi sledstorm,

 

I was able to reproduce the unhandled DaqException (status code -200141: Data was overwritten before it could be read by the system...). On my system, the DaqException was not followed by a system crash, but that doesn't mean that there isn't a problem. There are differences between your setup and my test system that may have prevented me from getting a system crash: Windows XP versus Server 2008 R2, 8 logical processors vs. 2 logical processors, etc.

 

Anyway, I will forward all of this information to the team that owns the nicdcck component, and hopefully they will have a fix in a future version of NI-DAQmx. In the meantime, since you have confirmed that the workaround does work, please use it.

 

Here's an alternative way to deploy the workaround: use the registry instead of running the "net start" command. Change HKLM\SYSTEM\CurrentControlSet\services\nicdcck\Start from 3 (manual) to 2 (automatic). This way, the nicdcck service will get loaded shortly after the system boots, and it should not get unloaded when your program crashes.

 

Also, I looked at the code you posted to see if it clears tasks. NationalInstruments.DAQmx.Task implements IDisposable, and disposing of the Task object is the equivalent of the DAQmx Clear Task function in the LabVIEW and C APIs. If you leave this up to the garbage collector, it may never happen, which may leave device resources reserved when another Task object needs them.

 

Brad

---
Brad Keryan
NI R&D
0 Kudos
Message 13 of 15
(1,563 Views)

>Here's an alternative way to deploy the workaround: use the registry instead of running the "net start" command. Change HKLM\SYSTEM\CurrentControlSet\services\nicdcck\Start from 3 (manual) to 2 (automatic). This way, the nicdcck service will get loaded shortly after the system boots, and it should not get unloaded when your program crashes.

 

Thanks!! I was trying to figure out how to do this!

 

>Also, I looked at the code you posted to see if it clears tasks. NationalInstruments.DAQmx.Task implements IDisposable, and disposing of the Task object is the equivalent of the DAQmx Clear Task function in the LabVIEW and C APIs. If you leave this up to the garbage collector, it may never happen, which may leave device resources reserved when another Task object needs them.

 

We will implement this as well. Thanks for the tip.

 

0 Kudos
Message 14 of 15
(1,560 Views)

NI-DAQmx 9.5 has been released, and it incorporates a fix for this crash: http://joule.ni.com/nidu/cds/view/p/id/2888/lang/en

 

Brad

---
Brad Keryan
NI R&D
0 Kudos
Message 15 of 15
(1,485 Views)