Keysight VISA.NET Help
Reading

Reading

The Raw I/O read operation reads data and returns it immediately in either an array of bytes or a string.

Reading Data

The Raw I/O Read methods read data until the read operation completes. The data is returned in an array of bytes or a string.

A Raw I/O read operation completes successfully if one or more of the following conditions is met:

It is possible to have one, two, or all three of these conditions satisfied at the same time.

Only one synchronous read operation can occur at a time. However, multiple asynchronous read methods may be queued for execution, and will execute in the order in which the calls were made.

Reading Strings

Because instruments normally return strings as 8-bit ASCII characters and .NET strings are all 16-bit UNICODE characters, VISA.NET provides ReadString methods that read strings from an instrument and convert them to UNICODE strings.

Reading Bytes

When string conversion is not required, VISA.NET provides Read methods that read bytes from an instrument and return them in an array of bytes.

To avoid needless in-memory copies of data, VISA.NET provides an overload of Read that returns a pointer to a byte array. This enables Read to avoid a performance penalty for copying the byte array on a boundary between managed and unmanaged code. Since .NET cannot bounds-check an array passed as a pointer, these read methods are unsafe.

 

 


© Keysight Technologies 2015-2025