Hi, I am trying to use the SimpleAsynchronousReadWrite examle for reading data asynchronously from a serial resource using "SerialSession" instead of "MessageBasedSession". I am able to read some data but after a while I get the following exception.
Managed Debugging Assistant 'CallbackOnCollectedDelegate' has detected a problem in 'C:\Users\Public\Documents\National Instruments\NI-VISA\Examples\.NET\SimpleAsynchronousReadWrite\bin\Debug\SimpleAsynchronousReadWrite.vshost.exe'.
Additional information: A callback was made on a garbage collected delegate of type 'NationalInstruments.Visa!NationalInstruments.Visa.Internal.VisaDllEventHandler::Invoke'. This may cause application crashes, corruption and data loss. When passing delegates to unmanaged code, they must be kept alive by the managed application until it is guaranteed that they will never be called.
Can you please help me. I am using NI VISA verion 15.5.