Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

.NET program blew up

Solved!
Go to solution

Greetings,

 

Hmm, what version of DAQmx are you using?

Product Support Engineer
National Instruments
0 Kudos
Message 21 of 40
(1,648 Views)

Hi James,

 

I have both 9.0.40.610 and 9.3.40.219 available to me.

Prior to adding the 'using NationalInstruments.Common;' statement, the errors I would get for both versions would say that I must add

 

'NationalInstruments.Common, Version=9.0.40.610'  

 

 

0 Kudos
Message 22 of 40
(1,644 Views)

Okay so this shouldn't be missing... I'm going to have to dig into this a little more. What specific sort of project are you working? Also, I'm seeing references to a 64 bit driver and a 32 bit target in your original post. Can you clarify that a bit?

 

Thanks,

James Duvall

Product Support Engineer
National Instruments
0 Kudos
Message 23 of 40
(1,624 Views)

Hi James,

 

I'm trying to get this example working:

 

http://home.hit.no/~hansha/documents/microsoft.net/tutorials/data%20acquisition%20in%20csharp/Data%2...

 

I believed that I was supposed to use the dll's from the Assemblies(64-bit) as I have a 64-bit OS.

Changing my reference to come from

 

\MeasurementStudioVS2010\DotNet\Assemblies\Current

 

as opposed to  

 

\MeasurementStudioVS2010\DotNet\Assemblies (64-bit)\9.0.40.610 (or 9.3.40.219 or Current)

 

DID allow the program to run.

However, when I tried to continue with the sample program, the following line had an error as analogOutTask was not available to me.

 

myAOChannel = analogOutTask.AOChannels.CreateVoltageChannel(...)

 

The name 'analogOutTask' does not exist in the current context.

 

As for the target, I don't fully understand it myself.  I was having a similar program and warnings to a person who had posted earlier, and the suggested solution was to change the target CPU of the project to x86.  I believe those warnings did go away at the point when the Platform was changed to Active (x86).

 

Thanks,

 

Seth 

0 Kudos
Message 24 of 40
(1,618 Views)

If you use the 32 bit folder for the DLLs and add using NationalInstruments.Common do you still get the error? I'll look through this example information you've sent and see if I can find a reason why this is still not working. It's strange that the analogoutTask is missing from the context. To me it feels like it can't see DAQmx properly. I'll keep looking.

 

 

 

Product Support Engineer
National Instruments
0 Kudos
Message 25 of 40
(1,608 Views)

Hi James,

 

Sorry for the late reply.  The new error message that comes up using the 32 bit folder and adding 'using NationalInstruments.Common; ' is:

 

The type or namespace name 'Common' does not exist in the namespace 'NationalInstruments' (are you missing an assembly reference?)'.

 

Thanks,

 

Seth 

0 Kudos
Message 26 of 40
(1,593 Views)

Thank you so much for sharing. Such a big help!

Let you know once I tried it and works for me. 😄

0 Kudos
Message 27 of 40
(1,586 Views)

Hmm, out of curiosity which .NET Framework version are you targetting?

Product Support Engineer
National Instruments
0 Kudos
Message 28 of 40
(1,571 Views)

Target framework: .NET Framework 4.0

0 Kudos
Message 29 of 40
(1,566 Views)

Okay, so DAQmx 9.0 is too old to work with the .NET Framework 4.0. However, DAQmx 9.3 is supported on .NET Framework 4 for C Sharp and VB.NET. Lets make sure that those are being used. I'm worried that maybe 9.3 was not installed before Measurement Studio. What I'd like you to do, is make sure that 9.3 was installed with support for .NET. To do this, you may need to go to the control panel for windows and modify the installation, adding .NET support. Though it might be easier to just install DAQmx 9.3 again and insure that you've opted to install .NET support. It feels like this might be missing currently. Please make sure that you're trying to call the 9.3 version of DAQmx and that .NET support was installed.

 

Thanks,

James Duvall

Product Support Engineer
National Instruments
0 Kudos
Message 30 of 40
(1,549 Views)