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