Measurement Studio for .NET Languages

取消
显示结果 
搜索替代 
您的意思是: 

Include NI-VISA .NET API in Visual Studio 2017 project

已解决!
转到解答

This is a follow-up to the question asked here.  How do I go about including a reference to the NI-VISA .NET API in my Visual Studio 2017 C# project?  My earlier projects have used VisaNS.dll, but I gather from the documentation that this has been deprecated in favour of the .NET API.

 

It would be helpful if someone could go through in detail the steps involved in downloading the new API (if necessary) and adding a reference to it in a C# project.  All the documentation I can find on this site still refers to VisaNS.dll.

0 项奖励
1 条消息(共 10 条)
8,514 次查看

Hi,

 

You need to reference assembly "Ivi.Visa" to use the new "IVI-compliant NI-VISA .NET API". See here for more info and the differences between NI VISA .NET  and VisaNS API.

 

Regards,

Kelly

0 项奖励
2 条消息(共 10 条)
8,486 次查看

Kelly, thanks.  There appears to be a link missing from your message.

0 项奖励
3 条消息(共 10 条)
8,482 次查看
0 项奖励
4 条消息(共 10 条)
8,480 次查看

Kelly, thanks.

 

That page links to this page, which states (in Part 3) that the NI-VISA .NET API is "included in the driver installer".  I assume that this is the standard installer for NI-VISA.  Where do I find the Ivi.Visa library, after installing NI-VISA?  If I select ".NET 4.5 Development Support" in the NI-VISA installer, that just installs the old VisaNS.dll.

0 项奖励
5 条消息(共 10 条)
8,476 次查看

IVI.Visa dll is installed here: C:\Program Files (x86)\IVI Foundation\VISA\Microsoft.NET\Framework32\v2.0.50727\VISA.NET Shared Components 5.8.0

 

It should also show up in Visual Studio references see attachment.

 

0 项奖励
6 条消息(共 10 条)
8,466 次查看

cymrieg, thanks.

 

Perhaps I should have asked this question earlier - what's the first version of NI-VISA to include the .NET API?  It may just be that I don't have a new enough version.

0 项奖励
7 条消息(共 10 条)
8,461 次查看

according to this 15.0: https://www.ni.com/pdf/manuals/374899j.html

 

0 项奖励
8 条消息(共 10 条)
8,454 次查看

cymreig, thanks.  I have 15.5 installed on my system, so that isn't the problem.  I'll try uninstalling VISA altogether and re-installing it.

0 项奖励
9 条消息(共 10 条)
8,449 次查看
解答
接受人 Tevildo

Just a quick note to let everyone know that reinstalling NI-VISA fixed the problem.  The required element is .NET 4.0 - 4.5.1 Development Support (IVI).  For some reason, this didn't come up in the "Modify" menu from Control Panel.

0 项奖励
10 条消息(共 10 条)
8,418 次查看