From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

NI488.2 names not defined

Solved!
Go to solution

I was working fine using Visual Studio 2013, Dot Net 4.5.1, NI.Common  13.0.40.190, NI.DAQmx 9.9.45.39, and NI.NI4882  13.0.45.159.  I need to support XP machines so I downgraded to Dot Net 4.0.  I redefined Dot Net in the solution and restarted only to get NI488.2 errors indicating that NationalInstruments.NI4882  namespace doesn’t contain any public members or cannot be found and undefined name errors like:  NI4882.Device, NI4882.SerialPollFlags, NI4882.TimeoutValue, NI4882.NotifyData, NI4882.GpibStatusFlags

 

There were about 15 errors when the debugger was opened but it jumped to 45 when build was executed. I got rid of the initial debugger errors by changing all NationalInstruments.NI4882. references to just NI4882. references. However, when I build, my 45 errors come back.  I tried going back to Dot Net 4.5.1 and also removing the NI488.2 reference and adding it back in but the errors persisted.

 

Any Ideas?

0 Kudos
Message 1 of 7
(5,274 Views)

Hi DaDud,

 

What version of NI 488.2 do you currently have? Can you post the exact error message that you are seeing?

Kevin S
Applications Engineer
National Instruments
0 Kudos
Message 2 of 7
(5,220 Views)

I believe that I found the problem.  There was a warning message hiding that stated:

 

Warning 1 The primary reference "NationalInstruments.NI4882, Version=13.0.45.159, Culture=neutral, PublicKeyToken=4febd62461bf11a4, processorArchitecture=MSIL" could not be resolved because it was built against the ".NETFramework,Version=v4.5" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.0".

 

So, apparently this version of NI488.2 does not work with .Net 4.0. even though the manual for this version states on page 4-2

 

NI-488.2 Application Interfaces

You can use an application interface if your program is written in Microsoft

Visual C/C++ (6.0 or later), Borland C/C++ (5.02 or later), Microsoft

Visual Basic (6.0), or any .NET programming language. Otherwise, you

must access the dynamic link library directly.

 

So then the question is:  What is to most recent version of NI488.2 that works with dotNet 4.0 and what versions of Common and DAQmx should be associated with that version?

 

0 Kudos
Message 3 of 7
(5,214 Views)

@DaDud wrote:

I believe that I found the problem.  There was a warning message hiding that stated:

 

Warning 1 The primary reference "NationalInstruments.NI4882, Version=13.0.45.159, Culture=neutral, PublicKeyToken=4febd62461bf11a4, processorArchitecture=MSIL" could not be resolved because it was built against the ".NETFramework,Version=v4.5" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.0".

 

So, apparently this version of NI488.2 does not work with .Net 4.0. even though the manual for this version states on page 4-2

 

NI-488.2 Application Interfaces

You can use an application interface if your program is written in Microsoft

Visual C/C++ (6.0 or later), Borland C/C++ (5.02 or later), Microsoft

Visual Basic (6.0), or any .NET programming language. Otherwise, you

must access the dynamic link library directly.

 

So then the question is:  What is to most recent version of NI488.2 that works with dotNet 4.0 and what versions of Common and DAQmx should be associated with that version?

 

It states very clearly that you need to change the currently targeted framework. Do you even understand what that means????

0 Kudos
Message 4 of 7
(5,207 Views)

I asked a question and so far the only answer I have received is flames that I consider unprofessional, immature, and a cheap shot.  So I will rephrase the final question.

 

This software runs on several fixtures of which two are still on Windows XP computers that cannot be upgraded at this time.  Since Windows XP won’t support a .Net framework higher than 4.0, I need to downgrade my software from .Net 4.5.1 to .Net 4.0.  The latest version of NI488.2 was compiled under .Net 4.5 and will not run under 4.0.  So my questions are:

  1. What is the latest version of NI488.2 that will run with .Net 4.0?
  2. Since DAQmx and NI488.2 both use Common.dll and they each want a version of Common that matches their version, what versions of NI488.2, DAQmx, and Common match each other and will run under .Net 4.0?
0 Kudos
Message 5 of 7
(5,166 Views)

Hi DaDud,

 

Check out these two knowledge base articles:

 

Why am I Getting Missing Namespace Errors In My .NET Project?

http://digital.ni.com/public.nsf/allkb/1F49C992147C063586257AF700751B40

 

Why Does the NationalInstruments.Common.dll Have an Exclamation Point Next to it?

http://digital.ni.com/public.nsf/allkb/46DE00265283A71586256FC000797682

 

Also, the readme's for the NI 488.2 will let you know which version of .NET Framework they support. Version NI 488.2 3.1.1 supports both .NET Framework 4.0 and 4.5

Kevin S
Applications Engineer
National Instruments
0 Kudos
Message 6 of 7
(5,136 Views)
Solution
Accepted by topic author DaDud

Kevin,

 

Thaks for your help.  I checked the ReadMe for 3.1.2 (the version I have installed) and says that it supports .Net 3.5, 4.0 and 4.5 but it did not work with 4.0.  So per your suggestion I will install 3.1.1 and try that.  If it doesn't work, I will just keep installing older releases until I find the one that does.

 

Thanks again for your help.  This thread can be closed.

0 Kudos
Message 7 of 7
(5,127 Views)