Instrument Control (GPIB, Serial, VISA, IVI)

Showing results for 
Search instead for 
Did you mean: 

System.AccessViolationException Setting VISA Session Timeout 0xc0000005


We are seeking the community input on an exception with which we have been struggling for a couple of weeks.

The following exception occurs when setting the timeout of the open message-based session causing the application to crash:


System.AccessViolationException at NationalInstruments.Visa.Internal.NativeMethods._SetAttributeUInt64_64(NationalInstruments.Visa.Internal.SafeVisaHandle, Ivi.Visa.NativeVisaAttribute, UInt64)

The hardware and software we are using are:

VISA: 18.0

NI488.2: 17.6

Device: USB-GPIB-HS+
Windows 7 x64
Application: Visual Studio Forms application 
.NET Framework: 4.6.1
Instrument: Electroglass Prober EG2001

The crash occurs with a VISA Message-Based Session open to this particular instrument with service request handling enabled. The session is capable of querying the instrument but crashes when trying to set the timeout.  The service request handler was isolated to just count the number of requests. But, due to the crash, the count is not accessible. 

Per the attached events file:
Faulting module name: ni4882.dll, version:, time stamp: 0x5a329b47

Exception code: 0xc0000005


0 Kudos
Message 1 of 1