Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

visa com libraries

I'm having problems with the VISA-Com Libraries to communicate with a Keysight (N6700B) power supply.

I have some C# Code i am compiling in Visual Studio 2015, and it does not work. However, if i compile the same code in Visual Studio 2012, then it works.

Basically i am just doing simple communication with the device

 

using Ivi.Visa.Interop;
//...
string address = "USB0::2391::2311::MY54002380::0::INSTR";
ResourceManager rm = new ResourceManager();
FormattedIO488 myDmm = (IMessage)rm.Open(address , AccessMode.NO_LOCK, 2000, "");
myDmm.WriteString("*RST"); // reset the device
myDmm.WriteString("*IDN?"); // request the IDN string;
string IDN = myDmm.ReadString(); // This is where it fails, returning: "VI_ERROR_TMO: A timeout occurred"

 

 

Also, the power supply has an error state of:

Error -420, Query UNTERMINATED

 

The code does not work with VS2015, but it DOES work with VS2012.
(In VS2012 i get no errors at all.)

I have tried downloading the latest drivers from KeySight, and it still does not work.
(www.keysight.com/find/iosuitedownload)

 

Does anyone have any idea why it would be breaking with VS2015 but work with VS2012?

I've looked up "Quere Unterminated" and some say that it could be a missing Termination character "\n", i've tried adding the "\n" to both writeStrings, and it still fails.

I've also tried:

myDmm.IO.TerminationCharacterEnabled = true; // before the write string

// and

myDmm.IO.TerminationCharacterEnabled = false; // before the write string

// and

myDmm.FlushWrite(true); // after the write string

// and

myDmm.FlushWrite(false); // after the write string

// and

myDmm.WriteString("*IDN?" + myDmm.IO.TerminationCharacter); 


None of the above was necessary in VS2012, but i'm just trying different things with VS2015

0 Kudos
Message 1 of 3
(4,921 Views)

Are you saying that the drivers won't work on VS2015, because they only have listed: VS2008, VS2010, VS2012?

I would think VS2015 would still work, since i can compile with the .NET 4.5 that it says it supports.

0 Kudos
Message 3 of 3
(4,909 Views)