Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx hangs up when attempting to create task

I am developing a .NET application with visual studio in C# using a USB-6008 device. Previously (more than a month ago), I had everything working with the NI-DAQmx 9.7.0 Core driver along with the libraries included with the full NI-DAQmx installation. The included libraries at the time of correct operation were NationalInstruments.Common.dll, NationalInstruments.Common.Native.dll, and NationalInstruments.DAQmx.dll.

 

A few days ago, I fired up some of the code that was previously fine (DAQmx 9.7.0 Core driver installed, device connected and visible in windows device manager) and the program hung up on creating a task. I installed the NI-DAQmx 9.8.0 f3 Core driver which resulted in the same issue. Then I installed the full NI-DAQmx 9.8.0 f3 Full driver, added the new .net libraries, and I am still having the same issue.

 

So, here is the task issue in detail...

The code I am running:

 

Console.WriteLine("Starting");

try
{
     Task myTask = new Task();
}
catch (DaqException exception)
{
     MessageBox.Show("Exception: " + exception.Message);
     throw;
}

Console.WriteLine("Done");

 

When I run the above code, I get the console output of "Starting", and then nothing happens for a while. Visual Studio just sits there running until my firewall pops up with NI software trying to access the internet. Sometimes the debug output will state that "A first chance exception of type 'NationalInstruments.DAQmx.DaqException' occurred in NationalInstruments.DAQmx.dll", but nothing is coming out of the exception in code.

 

Any ideas what is going on here?

 

Thank you,

Matt

 

0 Kudos
Message 1 of 3
(5,489 Views)

Update: After re-imaging my OS, installing the DAQmx 9.8.0 Core driver only, and using the libraries included in the DAQmx 9.8.0 full driver, the visual studio debugger now moves to the "throw" portion of the catch statement, and this messagebox pops up:

 

Messagebox

0 Kudos
Message 2 of 3
(5,476 Views)

Update: I found some info on the reported error code indicating that the problem might be caused by a firewall/antivirus. If my firewall asks for permission to allow the application to access the internet, and I allow it, the task is created. If I do not allow access, it does not create it. Two questions: Why on earth do the drivers/libraries need to access the internet in order to run, and is there any workaround to this?

0 Kudos
Message 3 of 3
(5,472 Views)