10-17-2021 12:17 PM
Hi there,
I have a mission is "use GPIB control several of instruments"
But I am not good at program and first use GPIB-USB-HS.
My boss only gave me previous project, but it's not work now.
It's show error code "CS0246" in program.
(Of course I have other error, but I think this is the most important)
I tried to add reference but program didn't work too.
(Project>Add reference>choose "National Instruments 488.2" and "NationalInstruments.Common")
using Ivi.Visa;
using NationalInstruments.Visa;
Above is the code with error.
I installed NI 488.2 first and I confirm the connection to instrument is successful (by Ni-VISA Interactive Control)
How to solve error code "CS0246"?
or where can I find sample code?
System: Win10
hardware: GPIB-USB-HS
Visual studio: 2019 community
Project: Windows Forms APP (.NET Framework)
Best regards,
Solved! Go to Solution.
10-17-2021 07:26 PM
You're "using" VISA but never added it as a reference.
Please add a reference to the VISA library
10-17-2021 08:43 PM
Dear Mr. Santhosh
I can't find "Ivi.Visa Assembly" & "National Instruments VISA" in reference.
Did I miss some software?
Thanks for your help.
10-17-2021 09:57 PM
You have the necessary software installed.
The screenshot you posted is from NI Package Manager. You've to include the references in your C# project in Visual Studio and not in NIPM.
10-18-2021 08:22 PM
Dear Mr.Santhosh,
Sorry for reply late.
I mean I can't find "Ivi.Visa Assembly" & "National Instruments VISA" in reference.
Above is VS2019 screenshot.
Page "Projects", "Shared Projects" and "Browse" is empty.
And I actually installed NI VISA.
Did I miss any steps?
10-18-2021 08:47 PM
Try searching just for "VISA" under Assemblies>>Framework
And changing the target framework to 4.0 or 4.5
10-18-2021 10:59 PM
Dear Mr.Santhosh,
You totally solved my question.
Thanks for your help.