EndReadByteArray Method

NI-VisaNS .NET Class Library Help for Visual Studio 2010

Edition Date: August 2012

Part Number: 370627F-01

»View Product Info
Download Help (Windows Only)

VxiSession Class See Also


Handles the end of an asynchronous read and returns the read byte array.

Namespace: NationalInstruments.VisaNS

Assembly: NationalInstruments.VisaNS (in NationalInstruments.VisaNS.dll) Version: 13.0.40.167

Syntax

Visual Basic (Declaration)
Public Function EndReadByteArray ( _
	asyncResult As IAsyncResult _
) As Byte()

C#
public byte[] EndReadByteArray(
	IAsyncResult asyncResult
)

Parameters

asyncResult
Type: System.IAsyncResult
An asynchronous result that represents the asynchronous read operation that you want to end.

Return Value

A byte array that contains the read data.

Implements

IMessageBasedSession.EndReadByteArray(IAsyncResult)

Exceptions

ExceptionCondition
VisaException The NI-VISA driver returned an error as a result of calling this method.
ArgumentException

asyncResult has already ended.

-or-

asyncResult is not a read.

-or-

asyncResult did not originate from VisaNS.

ArgumentNullException asyncResult is null (Nothing in Visual Basic).
DllNotFoundException The NI-VISA driver library cannot be found.
EntryPointNotFoundException A required operation in the NI-VISA driver library cannot be found.
ObjectDisposedException This member is called after the Dispose method is called directly from code or indirectly through a finalizer.

Remarks

Call this method to wait for an asynchronous read started with BeginRead. This method blocks execution of the current thread until the read completes or a timeout occurs. If you passed a callback to BeginRead, call this method inside of the callback.
Note: In order to free resources associated with the read, you must always call EndReadString or EndReadByteArray after you call BeginRead, whether in the callback given to BeginRead or in the same thread of execution where BeginRead was called.

See Also

Reference

VxiSession Class

NationalInstruments.VisaNS Namespace

WAS THIS ARTICLE HELPFUL?

Not Helpful