AnsweredAssumed Answered

Help: simple and reliable way of connectivity test?

Question asked by buf on Jun 20, 2008
Latest reply on Jun 23, 2008 by odanzy
I have an Agilent E4438C ESG connected to my PC through LAN, and I'm writing a simple remote control utility for it, using C# and VISA-COM. The problem is that if a wrong intrument ip address has been spcified, the ResourceManagerClass.Open() blocks calling thread and UI become not responding...Here is some of my code looks like:

string strInstrIP = "";//wrong ip address
string strInstrAddr = "TCPIP0::" + strInstrIP + "::INSTR";

FormattedIO488Class dev = new FormattedIO488Class();
ResourceManagerClass resMgr = new ResourceManagerClass();

    dev.IO = (IMessage)resMgr.Open(strInstrAddr, AccessMode.NO_LOCK, 4000, "");
    // sending scpi command to e4438c...
catch(exception ex)
    // exception handling

I tried to solve this by doing the ResourceManager.Open() stuff in another thread, seems not working, the new thread just can't being aborted. So, what's the _standard_ way of a connectivity test? Thanks in advance