I am new to C# but have made some GPIB Instrument control in C++ some 10 years ago so I am not a hardcore programmer.
My problem is that I want to open a connection to an instrument and then detect if it is there.
If it is not there then I want exit the function.
I have not been able to figure-out how to get the handle status back.
I have been looking for a handle that is “null” but found nothing.
And I have been looking for “exceptions” and made some “try and error” but without success.
Anyone that can help.
I am using the VisaNS.
public void Get_IDN(int i)
gSession = (GpibSession)ResourceManager.GetLocalManager().Open("GPIB0::20::INSTR");
responseString = gSession.Query("*IDN?\n");
Hej nyc thanks.
I have already been looking on these examples and that was what led me to look for exceptions. More precise I tried to catch "VisaException" but with no luck.
It never registrated any exception though no instrument was connected.
So am I searching in the wrong direction.