Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

UNable to mix DAQMX and NI4882 control with visual studio 2010

After recently upgrading from VS2005 to 2010 I can no longer develop programs to work together with DAQMX and GPIB.

I have struggled for a while and found that I can develop individual programs for each but not programs which work with both.

 

For GPIB set up if I use the following configuration it works without errors

target framework 4

NI common.dll Vers 13.0.40.188

NI 4882.dll vers 13.0.40.159

 

For DAQMX set up if I use the following configuration it works without errors

target framework 4

NI common.dll vers 12.0.20.253

DAQMX.dll vers 9.6.20.57

change the app.config file to include the following to avoid an error of mixed mode assembly, not sure what this means but it worked to get it to load.

I guess it means use framework 4 but support legacy framework 2 features based on common dll using Ver2 runtime???

 

<

configuration>

  <

startupuseLegacyV2RuntimeActivationPolicy="true">

   

  <

supportedRuntimeversion="v4.0"sku=".NETFramework,Version=v4.0"/></startup>

</

configuration>

 

Anyway as you can see the difference in the two configurations is the NIcommon.dll version but if i try using any other version in each it falls over at compile time as can be seen in the errors below.

 

running the DAQMX configuration with the V13 common dll gives the following errors

 

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=12.0.20.253, Culture=neutral, PublicKeyToken=4544464cdeaab541'. C:\Users\jdimond1\Documents\Visual Studio 2010\Projects\DAQ set up\DAQ set up\Form1.cs 20 28 DAQ set up

 

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=12.0.20.253, Culture=neutral, PublicKeyToken=4544464cdeaab541'. C:\Users\jdimond1\Documents\Visual Studio 2010\Projects\DAQ set up\DAQ set up\Form1.cs 20 28 DAQ set up

 

 

If I try to use the version 12 common dll with the GPIB set up I get the following errors

 

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.188, Culture=neutral, PublicKeyToken=dc6ad606294fc298'. c:\users\jdimond1\documents\visual studio 2010\Projects\GPIB set up\GPIB set up\Form1.cs 20 43 GPIB set up

 

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.188, Culture=neutral, PublicKeyToken=dc6ad606294fc298'. c:\users\jdimond1\documents\visual studio 2010\Projects\GPIB set up\GPIB set up\Form1.cs 20 43 GPIB set up

 

 My interpretation of these errors is that the common.dll file does not support both functions together but different versions allow independent use of each.

In my previous VS2005 developments the following references never caused a conflict and allowed me to develop programs which control DAQMX and GPIB simultaneously.

 

NI common.dll version 8.7.20.131

NI DAQMX.dll version 8.3.20.13

NI 488.2.dll version 8.0.20.139

 

Please help

 

Thanks

 

John

 

0 Kudos
Message 1 of 4
(4,081 Views)

I seem to have found a solution to the problem.

If I roll back to an earlier NI4882.dll as quoted for my VS2005 configuration (NI 4882.dll version 8.0.20.139) then it allows the common dll version 12.0.20.253 to work with DAQMX and GPIB control without conflict.

 

After my post I realised that I had focused on getting DAQMX to work without noticing the GPIB errors which forced me to update NI488.2 install and updates to the most recent dll for this feature but rolling back the NI4882.dll allows the use of a “common” common.dll

 

Hope this may be of use to others

 

John

0 Kudos
Message 2 of 4
(4,078 Views)

Hello I am having the same problem were can I get these versions of those libraries?

 

JA

0 Kudos
Message 3 of 4
(3,968 Views)

Hi Sorry for a slow reply.

 

My original fix was poor as it needed to run older framework versions.

 

The best way is to download the NI device driver file linked here.

 

http://joule.ni.com/nidu/cds/view/p/id/3802/lang/en

 

If you install the default configuration you then need two further installs the DAQMX and GPIB support.

 

DAQMX

 

1.1.1.        Browse the National Instruments Device Drivers February 2013 package and open up the ‘Products’ folder.  Inside the Products folder you should find a product called ‘MStudioDAQFx40 Support’.  Open this folder.

1.1.2.        Run the installer (DAQFx40Support.msi).

You must enable all features of this product.  Even though you may enable the top-level
feature, the subsequent levels do not necessarily get enabled.  You must expand the feature tree and enable
them all.

 

When done, support for DAQmx should be available
within Visual Studio 2010.  To check if
it has been successful you can start Visual Studio 2010, open up a .NET 4 forms
project (or start a new one) and browse to the solutions explorer.

Right-Click in the References section and select ‘Add Reference’ to bring up
the References dialogue box. 

Select the .NET tab.  The box will begin
to populate with all of the available .NET references.  Give it some time to complete and then click
on the ‘Component Name’ column to sort the results alphabetically by name.  Scroll through to the NI references and, if
your installation has completed successfully, you should have a .NET V4.0.x
DAQmx reference available

 

next you need to install the GPIB driver

 

1.1.1.        Browse back to the ‘Products’ folder of the National Instruments Device Drivers February 2013 package.

1.1.2.        Open the folder titled ‘MStudioGpib2010’.  This product enables support for GPIB under .NET Framework 4.  Start the installer (MStudioGpib.2010.msi)

Accept any relevant licence agreements and progress to the features selection screen.  As with the DAQmx installer, ensure that all features are enabled. 

 

Once done, NI4882 support for .NET Framework 4 should
be enabled within Visual Studio 2010.  As
with the DAQmx instructions you can test that the installation has been
successful by opening VS2010, start a new .NET 4 forms project, and then browse
to the Solutions Explorer.  Right-Click
inside the References section and select ‘Add Reference’ from the context menu
to bring up the References dialogue box.

Select the .NET tab.  The box will begin
to populate with all of the .NET references. 
Once it has finished populating, select the ‘Component Name’ tab to
filter the results alphabetically. 
Scroll down to the NI section and, if the installation was successful,
you should now have a .NET Framework 4.0.x version of the NI4882 reference
available for use

 

 

** you must remove the old DAQ, GPIB and common references and replace them with the new references and convert your project to .net framework 4 for this to work***

The new references in the linked drivers file are

 

 

DAQMX 9.6.40.292

Common 13.0.40.188

NI4882 13.0.40.159

 

Best of luck

 

John

 

0 Kudos
Message 4 of 4
(3,892 Views)