public VisaSession NewSession() { VisaSession newSession = new VisaSession(); Int32 lockMode; AgVisa32.viGetAttribute(mSession, AgVisa32.VI_ATTR_RSRC_LOCK_STATE, out lockMode); if (lockMode != AgVisa32.VI_NO_LOCK) { // Unlock the old session so it can be shared. AgVisa32.viUnlock(mSession); } // Open a new session with the same resource descriptor // and simulation mode as the old session. newSession.Open(mViDesc, mTimeout, IsSimulated, false); return(newSession); }
/// <summary> /// Unlock the underlying driver. Driver may have been locked by LockSession() or /// if opened exclusively by Open() /// </summary> public void UnlockSession() { CheckStatus(AgVisa32.viUnlock(mSession)); IsSessionLocked = false; }