07-18-2011 01:36 PM
Greetings,
Hmm, what version of DAQmx are you using?
07-18-2011 02:56 PM
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'
07-19-2011 05:47 PM
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
07-20-2011 10:32 AM
Hi James,
I'm trying to get this example working:
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
07-21-2011 04:00 PM
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.
07-28-2011 09:50 AM
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
08-02-2011 02:07 AM
Thank you so much for sharing. Such a big help!
Let you know once I tried it and works for me. 😄
08-03-2011 08:57 AM
Hmm, out of curiosity which .NET Framework version are you targetting?
08-03-2011 02:22 PM
Target framework: .NET Framework 4.0
08-04-2011 03:20 PM
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