Hello,
I'm trying to use C# to control my GPIB equipment. As long as I use the default timeout, i can read/write/query with no problems. Today I wanted to try to change the timeout so I tried the following command:
mbSession = (MessageBasedSession)ResourceManager.GetLocalManager().Open(visaAlias, AccessModes.NoLock, 10000);
int originalVisaTimeout = mbSession.Timeout;
int newVisaTimeout = 120000;
mbSession.Timeout = newVisaTimeout; // this does not work and changes to either 3000, 180000, or 300000 depending on the values i've tried for the timeout so far
mbSession.Timeout = originalVisaTimeout // this correctly sets the timeout back ot the origianl value.
Am I using the wrong Timeout property to set the GPIB Timeout? The documentation shows the following information.
//
// Summary:
// Gets or sets the minimum timeout value to use in milliseconds when accessing
// the device associated with the session.
//
// Exceptions:
// NationalInstruments.VisaNS.VisaException:
// The property is set to an invalid state.
//
// System.ObjectDisposedException:
// This member is called after the Dispose method is called directly from code
// or indirectly through a finalizer.
//
// System.DllNotFoundException:
// The NI-VISA driver library cannot be found.
//
// System.EntryPointNotFoundException:
// A required operation in the NI-VISA driver library cannot be found.
public int Timeout { get; set; }
Thanks,
Frank