Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 /// <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;
 }