Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot obtain copy of DAQmx.dll targetting 4.5 // The type 'NationalInstruments.ISynchronizeCallbacks' is defined in an assembly that is not referenced.

Solved!
Go to solution

I have inherited a software project that utilizes the NationalInstruments.DAQmx.dll library. I currently have the 13.0.40 32bit version of the library. I am rewriting the project in 64bit .NET 4.5 and have found some issues when using the 13.0.40 version. Namely the two errors below

 

Error    1    The type 'NationalInstruments.ISupportSynchronizationContext' is defined in an assembly that is not referenced. You must add a reference to assembly 'NationalInstruments.Common, Version=13.0.40.190...
Error    2    The type 'NationalInstruments.ISynchronizeCallbacks' is defined in an assembly that is not referenced. You must add a reference to assembly 'NationalInstruments.Common, Version=13.0.40.190...

From searching the errors online I think the issue is that my current DAQmx.dll targets the .NET 4.0 framework and my new project targets .NET 4.5.

I have gone to the NI support website and downloaded the NI DAQmx 15.1 "downloader" (found here http://www.ni.com/download/ni-daqmx-15.1/5617/en/). This executable, when ran, then downloads ~1.7GB of zipped files, once unzipped there are a huge number of softwares and documentation present. After speaking with a NI application engineer on the phone he instructed me to run the NI DAQmx setup found in the top level folder of the unzipped files. This then installed what I'd like to call the NI Suite of softwares... (Jumping ahead, after I did an uninstall the uninstaller notified me that I was removing 224 pieces of software. Thus why I call it the NI Suite).

After the installation I was instructed to look in the installation directory for a folder similar to MStudio//DAQmx//DotNET//Assemblies//Current for the newest version of the DAQmx.dll but only found dlls starting with NationalInstruments.Common and nothing ending in DAQmx. I also did a search over the entire install directory for dlls and did not find NationalInstruments.DAQmx.dll. I decided to try the .Common.dll thinking that the naming convention might had changed, to no avail.

(Just some extra info) Finally, I went to the machine that has the older version of the NI Software Suite on it (I am developing on a seperate machine from the one using my NI instrument), and looked under the same folder I mentioned above. Under that folder I did locate a NationalInstrument.DAQmx.dll though this is the one I am currently using. I also located a 64bit version of the 13.0.40 dll, which is nice, but still has the same issues as the 32 bit version.

So I guess my questions are now,

  • Am I correct thinking that I need a newer dll? One with the naming convention XX.XX.45 (Hopefully 15.1.45)?
  • If so, does a DAQmx.dll that targets 4.5 exist from NI?
  • If it does exist, where can I find it? ...

 

0 Kudos
Message 1 of 8
(5,638 Views)

I humbly apologize for my oversight NYC, I will be sure to always check the readme files in the future.


 


After reviewing the documentation it does look like there is a DAQmx.dll that supports DotNET 4.5, and it is indeed obtained from NI. After NYCs help I am only left with one question, but rephrased.

Where can I find the newest verion of the NationalInstrument.DAQmx.dll? I will look again in the installation directory given to me by the NI Application Engineer to make sure it is not there, but assuming this is not the correct location, is there another anyone could recommened? Is there any direct download link for only the dll and none of the other softwares?

0 Kudos
Message 3 of 8
(5,618 Views)

I have no idea what you are doing but for me, the NI example programs for .NET 4.5.1 are located in C:\Users\Public\Documents\National Instruments\NI-DAQ\Examples\DotNET4.5.1 and they reference the DAQmx DLL located at C:\Program Files\National Instruments\MeasurementStudioVS2012\DotNET\Assemblies\Current\NationalInstruments.DAQmx.dll

 

I am able to build the project without errors using Visual Studio Express 2013 for Windows Desktop.

 

 

0 Kudos
Message 4 of 8
(5,591 Views)

Yes that is where they are located.

This issue I was having, which I managed to resolve, is that they were not installed. In NIDAQmx 15.1 when given a choice for installation you can select "Typical" which does not install 4.5.1 language support by default. When choosing custom you can select to install it (Support and Examples) but it will not let you unless you have Profession Edition or higher of Measurement Studio.

The final solution was to only install the examples and not the language support. This also installs the dll while getting around not having Measurement Studio.

Thanks for the tough love NYC!

0 Kudos
Message 5 of 8
(5,587 Views)

@kevindckr wrote:

Yes that is where they are located.

This issue I was having, which I managed to resolve, is that they were not installed. In NIDAQmx 15.1 when given a choice for installation you can select "Typical" which does not install 4.5.1 language support by default. When choosing custom you can select to install it (Support and Examples) but it will not let you unless you have Profession Edition or higher of Measurement Studio.

The final solution was to only install the examples and not the language support. This also installs the dll while getting around not having Measurement Studio.

Thanks for the tough love NYC!


Like I wrote before, I don't know what you were doing. It did not make sense to me.

 

I don't use the "Typical" installation. I go in and select the application support that I want.  My employer does not use Measurement Studio so I simply choose the Examples during the "Custom" installation.

 

 

0 Kudos
Message 6 of 8
(5,579 Views)
Solution
Accepted by topic author kevindckr

Well I guess that I have mislead you again NYC. It seems that my issue has not been resolved. I have tried all of the libraries for every Measurement Studio version from 2010 to 2013.

The folder structure that I have is as follows.

\MeasurementStudioVS2010\\DotNET\\Assemblies\\Current\\NationalInstruments.DAQmx.dll
\MeasurementStudioVS2010\\DotNET\\Assemblies\\15.1.40.61\\NationalInstruments.DAQmx.dll

\MeasurementStudioVS2010\\DotNET\\Assemblies (64-bit)\\Current\\NationalInstruments.DAQmx.dll

\MeasurementStudioVS2010\\DotNET\\Assemblies (64-bit)\\15.1.40.61\\NationalInstruments.DAQmx.dll

\MeasurementStudioVS2012\\DotNET\\Assemblies\\Current\\NationalInstruments.DAQmx.dll

\MeasurementStudioVS2012\\DotNET\\Assemblies\\15.1.45.61\\NationalInstruments.DAQmx.dll

\MeasurementStudioVS2012\\DotNET\\Assemblies (64-bit)\\Current\\NationalInstruments.DAQmx.dll

\MeasurementStudioVS2012\\DotNET\\Assemblies (64-bit)\\15.1.45.61\\NationalInstruments.DAQmx.dll

\MeasurementStudioVS2013\\DotNET\\Assemblies\\15.1.45.61\\NationalInstruments.DAQmx.ComponentModel.dll

Obvious all of the directories not marked as 64-bit fail because they are not 64-bit. The directories marked 15.1.40.61 also do not work giving me the original error; because they target DotNET 4.0. Under the VS2013 directories there are no NationalInstruments.DAQmx.dll only NationalInstruments.DAQmx.ComponentModel.dll. The highlighted directories labeled with 15.1.45.61 give the same error, namely


Error    1    The type 'NationalInstruments.ISupportSynchronizationContext' is defined in an assembly that is not referenced. You must add a reference to assembly 'NationalInstruments.Common, Version=15.0.40.49154...

Which I assume means that the directory name of 15.1.45 does not coincide with the dll version of 15.0.40. Am I misunderstanding this error, or am I correct that the dlls under 15.1.45 are not what they are labeled as?




For reference here are two snippits of code that I am trying to get working.

using (NationalInstruments.DAQmx.Task analogWriteTask = new NationalInstruments.DAQmx.Task()) // Errors crop up here using Task
{
    string[] channels = DaqSystem.Local.GetPhysicalChannels(PhysicalChannelTypes.AO, PhysicalChannelAccess.External);
    analogWriteTask.AOChannels.CreateVoltageChannel(channels[1], "aoChannel", MIN_VOLTAGE_OUT_THEORETICAL, MAX_VOLTAGE_OUT, AOVoltageUnits.Volts);
    AnalogSingleChannelWriter writer = new AnalogSingleChannelWriter(analogWriteTask.Stream);
    writer.WriteSingleSample(true, commandValue);
}
using (NationalInstruments.DAQmx.Task digitalWriteTask = new NationalInstruments.DAQmx.Task()) // Errors crop up here using Task
{
    string[] channels = DaqSystem.Local.GetPhysicalChannels(PhysicalChannelTypes.DOPort, PhysicalChannelAccess.External);
    digitalWriteTask.DOChannels.CreateChannel(channels[1], "port1", ChannelLineGrouping.OneChannelForAllLines);
    DigitalSingleChannelWriter writer = new DigitalSingleChannelWriter(digitalWriteTask.Stream);
    writer.WriteSingleSampleMultiLine(true, commandValue);
}

EDIT: So the actual issue is that I have not included NationalInstruments.DAQmx.Common.dll into my project.

0 Kudos
Message 7 of 8
(5,571 Views)

 

http://zone.ni.com/reference/en-XX/help/372636F-01/mstudiowebhelp/html/68abc539/

says that NationalInstruments.ISynchronizeCallbacks is found in NationalInstruments.Common.dll  and has nothing to do with DAQmx

 

 

0 Kudos
Message 8 of 8
(5,561 Views)