I'm fairly new to anything but basic .NET projects but am currently attempting to make a test system for use with T & M instruments that communicates using SCPI over various media such as GPIB, USB, etc. I have Keysight IO Libraries installed and have been reading the VISA.NET help documentation therein.
I would like my program to be VISA vendor-neutral (as much as possible) so decided to stick to using the implementation only via the Ivi.Visa
interfaces. I was thinking of coding communications with an instrument something like the following psuedo-code:
//Access implementation only via IVI interfaces to keep things vendor neutral
using Ivi.Visa;
// Get a session from the manager
var Session = (IGpibSession)GlobalResourceManager.Open(Alias, AccessMode, Timeout);
// Use the formatted IO interface of the session
var io = Session.FormattedIO;
// Some communication operations
// UserCommand is some faux type object
io.PrintfAndFlush("%s", UserCommand.ToString);
if (UserCommand.Query)
io.Scanf("%s", out UserCommand.Result);
// Doesn't seem to be any Close method on resource manager, session or interface?
Session.DiscardEvents(EventType.AllEnabled);
Session.Dispose();
I just noted however that while I previously thought that COM examples I saw in other documentation mainly referred to older usage, COM examples are still being referred to (eg Sending SCPI/GPIB commands over USB from C#).
Exploring further in the Visual Studio Reference Manager I see that not only is there the VISA COM type library, there are instrument specific IVI assemblies (eg: IVI Scope Assembly) and similar COM type libraries (eg: IviScope 3.0 Type Library).
I'm somewhat bewildered by what all these are for and which ones I'm supposed to use or not use!
What are they all for? I mean, what are the differences between them or why would I use one over the other? (Maybe there is a source that succinctly explains the difference or general use cases somewhere?).