A reference to an object that contains arbitrary state Object information of interest to the calling program, and related to the asynchronous operation. This allows the asynchronous operation to provide the reference back to the calling program (as context) when the operation is complete. This is particularly useful when callbacks are used. Note that the object is not used by the asynchronous operation. Return Value Description Type return value An object that implements IVisaAsyncResult IVisaAsyncResult, which represents the status of an asynchronous operation. The object is constructed by this method. The meaning of members in IVisaAsyncResult this context is listed below: A reference to the state object passed as a parameter .AsyncState Object to this method. This will be if no state object null was passed to this method. A handle that can be used to wait for the read to .AsyncWaitHandle WaitHandle complete. if the read operation completed synchronously, true Boolean otherwise false. if the asynchronous operation is complete, true .IsCompleted Boolean otherwise false. is always when returned by this .IsAborted false Boolean IsAborted method since this method begins the asynchronous read operation. Undefined. .Buffer Byte[] Undefined. .Count Int64 Some exceptions (such as argument exceptions) are thrown immediately from this method. Errors that occur during an asynchronous read request, such as an instrument communication failure during the IO request, occur on the thread pool thread and become visible upon a call to EndRead. If a call by a session class to the callback method fails, the failure may be ignored. VISA.NET I/O implementations should not assume a client callback will return in any timeframe. Calling programs may execute blocking waits from callbacks. If a VISA.NET I/O resource component calls a callback, and the callback blocks in the same thread on which the callback was called, the callback will not return until the block completes. The and parameters are allowed to be callback state null. If is when this method returns, shall also be CompletedSynchronously true IsCompleted true.
state A reference to an object that contains arbitrary information of interest to the calling program, and related to the asynchronous operation. This allows the asynchronous operation to provide the reference back to the calling program (as context) when the operation is complete. This is particularly useful when callbacks are used. Note that the object is not used by the asynchronous operation. Object Return Value Description Type return value An object that implements IVisaAsyncResult, which represents the status of an asynchronous operation. The object is constructed by this method. The meaning of IVisaAsyncResult members in this context is listed below: IVisaAsyncResult .AsyncState A reference to the state object passed as a parameter to this method. This will be null if no state object was passed to this method. Object .AsyncWaitHandle A handle that can be used to wait for the read to complete. WaitHandle true if the read operation completed synchronously, otherwise false. Boolean .IsCompleted true if the asynchronous operation is complete, otherwise false. Boolean .IsAborted IsAborted is always false when returned by this method since this method begins the asynchronous read operation. Boolean .Buffer Undefined. Byte[] .Count Undefined. Int64 Some exceptions (such as argument exceptions) are thrown immediately from this method. Errors that occur during an asynchronous read request, such as an instrument communication failure during the IO request, occur on the thread pool thread and become visible upon a call to EndRead. If a call by a session class to the callback method fails, the failure may be ignored. VISA.NET I/O implementations should not assume a client callback will return in any timeframe. Calling programs may execute blocking waits from callbacks. If a VISA.NET I/O resource component calls a callback, and the callback blocks in the same thread on which the callback was called, the callback will not return until the block completes. The callback and state parameters are allowed to be null. If CompletedSynchronously is true when this method returns, IsCompleted shall also be true.
vpp436_2015-02-11.docx