12-26-2013 06:40 PM - edited 12-26-2013 06:46 PM
Hi
I have a question about importing Ni Libirary to my VS 2012 project. ( Using visual basic .NET, Windows 7 and VS 2012)
I currently test FindReources(NI-VISA) example project to apply some of function to my project.
Sample project was working fine, it was returnning resource data corrent.
However, when I tried to apply Find Resource function to "My project"
it kept appearing error message such as "ResourceManager is not declared. It may be inaccessible due to its protection level"
What I did was ...
First, I added reference to my project
Second, I imported "Imports NationalInstruments.VisaNS" to my vb file
However, error keep appearing, so I can't use function.
And, When I re-start VS and check Object brower
there is NI-VISA reference and error is gone
However, When I run the project, NI.VisaNS library just disappear ...
I am not really sure what this happen because Sample project from NI is working without any trouble.
Is there any missing step to import and use NI library ?
Thanks
12-27-2013 04:33 PM
pc486,
If I understand you correctly, the VisaNS Class Library disappears when you build your Visual Studio application. Is this true even when creating a new, blank Visual Studio Project and adding the reference? In addition, can you please post the VB .NET code you used in your example?
Thank you
12-30-2013 01:42 AM - edited 12-30-2013 01:43 AM
Hello Bryan
Thanks for Helping me
I created new project and I copy and paste the parts that I wanted to use for my project( i also added the reference )
I was trying to use example in VISA call "FindResources"( I have attached)
Screen capture on the abvoe is the new temp project which I ONLY imported VISA libray and function.
I am currently using Windows 7, Visual Studio 2012 , and .NETFRAMEWORK 4.0.
Is this becuase my current system is using .NETFramework 4.0 ?
If I have to keep 4.0 instead using 4.5, what should i do for using VISA "FindResources" project?
thanks
12-31-2013 12:48 PM
pc486,
Which version of NI-VISA do you have installed on your computer?
12-31-2013 01:30 PM - edited 12-31-2013 01:31 PM
I download visa530full and install in the PC
I think, it is NI-VISA 5.4
Thanks
12-31-2013 04:16 PM
Hi PC486,
I dont think .NET Framework works well with NI-VISA and other NI components. Change your target framework of the Visual Studio project to .NET 4.0 and I think that should fix everything.
Go to Project >> Properties >> Target Framework, Select .NET Framework 4.
Regards,
Gautham
12-31-2013 04:22 PM
Hi Gautham
Thanks for helping my technical problem.
This issue came from this post
I would like to use ResourceManager in the NI VISA library.
However, it required to use 4.5 in order to use ResourceManager.
When I switch to .NET 4.5 in laptop for developing project, it was working fine.
However, after I install my project package to another PC, it became a problem.
I am not really sure how to use .NET language support to other PC or use .NET 4.0 with ResourceManager function in the VISA library.
Thanks
12-31-2013 04:31 PM
Hi pc486,
When you installed the framework did you install the complete version and not the client profile?
Surprised that you had to install it inspite of having VS 2012. Also is that error pop up from Windows or VS?
Regards,
gautham
12-31-2013 05:08 PM
Hello gautham
Thanks for Helping me
There is what I have in the PC
In the programs and Features section I found
In the reg section I found
From http://msdn.microsoft.com/en-us/library/hh925568(v=vs.110).aspx
I assume that Code "378758" suggests .NET Framework 4.5.1 installed on Windows 8, Windows 7 SP1, or Windows Vista SP2
I am not really sure how to solve this issune 😞
thanks
01-02-2014 05:01 PM
I just uninstalled ALL NI Driver and .NET.
then , i just re-install everything.
Now, I am able to select Language support to use feture of .NET 4.5
thanks and Happy New Yea