Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Status code -50150 on DaqSystem.LoadTask(), Windows 7, USB-6008

Hi all.

 

I'm having a weird problem with a C# application using the Daqmx interface over .NET 4.5.2.

 

I have two PCs running my software without any problems. On a third PC though, the application crashes as soon as I invoke the following call:

 

DaqSystem.Local.LoadTask("ControlTask");

 

which is the first call I'm invoking from the NI Platform services.

 

I'm getting an exception thrown w/status code=-50150 (NI Platform Services: The software has entered an unknown state - usually as a result of a cascafed failure induced by an unexpected series of state inputs [...])

 

The resulting stack trace is attached.

A few notes:

 

One of the PCs where the application works is the same make and model than the one where the issue is observed;

The same DaqMx package is installed on all three PCs (NIDAQ970f0.exe)

The same OS (Windows 7 w/all updates) is installed on all three PCs

The same version of .NET (4.5.2) is installed on all three PCs

I have tried uninstalling and re-installing the DaqMx drivers;

I have re-importing my tasks into NI MAX;

I am able to execute all my tasks (include "ControlTask") without any problems using NI MAX on the problematic PC;

I am building 32 bit executables, running on 64 bit Windows.

 

I am out of solutions - what can I do next?

 

Thanks!

 

0 Kudos
Message 1 of 6
(5,134 Views)

@psavard wrote:

Hi all.

 

I'm having a weird problem with a C# application using the Daqmx interface over .NET 4.5.2.

 

I have two PCs running my software without any problems. On a third PC though, the application crashes as soon as I invoke the following call:

 

DaqSystem.Local.LoadTask("ControlTask");

 

which is the first call I'm invoking from the NI Platform services.

 

I'm getting an exception thrown w/status code=-50150 (NI Platform Services: The software has entered an unknown state - usually as a result of a cascafed failure induced by an unexpected series of state inputs [...])

 

The resulting stack trace is attached.

A few notes:

 

One of the PCs where the application works is the same make and model than the one where the issue is observed;

The same DaqMx package is installed on all three PCs (NIDAQ970f0.exe)

The same OS (Windows 7 w/all updates) is installed on all three PCs

The same version of .NET (4.5.2) is installed on all three PCs

I have tried uninstalling and re-installing the DaqMx drivers;

I have re-importing my tasks into NI MAX;

I am able to execute all my tasks (include "ControlTask") without any problems using NI MAX on the problematic PC;

I am building 32 bit executables, running on 64 bit Windows.

 

I am out of solutions - what can I do next?

 

Thanks!

 


I don't see NI-DAQmx 9.7. I do see that 14.2 is the newest version.

Are you using Visual Studio 2012?

0 Kudos
Message 2 of 6
(5,124 Views)

I'm using Visual Studio Community 2013.

 

In my mind though - if the compiler was a fault, I wouldn't I get an issue consistently (i.e. on all three PCs)?

 

The two PCs that work, work consistenty well.

 

I'm thinking that something in the environment is broken, but I can't seem to pointpoint what the issue is. 

 

 

0 Kudos
Message 3 of 6
(5,118 Views)

If it was me, I would be updating to the newest NI-DAQmx drivers 14.2

You're using the newest software, and yet for some unknown reason you've decided to stick with drivers from 2013. Go figure.

0 Kudos
Message 4 of 6
(5,113 Views)

I've updated the drivers to the latest version. For some reason I was under the impression I had the latest version installed.

 

Doing this didn't change anything though...

 

I continued my investigation by building a simple C# console app that would invoke the "LoadTask" call. I ran it on the problematic PC and it worked! I figured that my original application was at fault then.

 

My original application is a WPF app, and the "LoadTask" call is done from a "click" event on a button. If I moved the call away from the event handler: no crash.

 

I then realized that if add call from the NI DaqMx API prior to the call in the button handler (e.g. in a constructor), I also did not see a problem.

 

So I proceeded to build a very simple WPF app, which would do exactly what my original application did: call the LoadTask from a "click" event. On the problematic PC, I get the -50150 error. If I add a call to load another task in the in the "MainWindow" constructor, I don't get any crashes.

 

I attached my VS solution to the issue... maybe there is a sync issue somewhere? Can I force some kind of initialization to prevent this?

 

 

 

 

0 Kudos
Message 5 of 6
(5,079 Views)

Hi psavard,


I tried your test WPF application and was not able to reproduce the error. It could be a problem with the task in MAX that is being loaded. Perhaps the task was corrupted at some point. You may want to try deleting and recreating that task in MAX to see if it will solve the problem.

0 Kudos
Message 6 of 6
(5,048 Views)