Reads the specified number of bytes from the device or interface specified by VISA resource name and returns the data in read buffer.


icon

Inputs/Outputs

  • cvsrn.png VISA resource name

    VISA resource name specifies the resource to be opened. The VISA resource name control also specifies the session and class.

  • cu32.png byte count

    byte count is the number of bytes to be read.

  • cerrcodeclst.png error in (no error)

    error in describes error conditions that occur before this node runs. This input provides standard error in functionality.

  • ivsrn.png VISA resource name out

    VISA resource name out is a copy of the VISA resource name that VISA functions return.

  • istr.png read buffer

    read buffer contains the data read from the device.

  • iu32.png return count

    return count contains the number of bytes actually read.

  • ierrcodeclst.png error out

    error out contains error information. This output provides standard error out functionality.

  • This function might return less than the number of bytes requested if the function reaches the end of the buffer, reaches a termination character, or if a timeout occurs. The output error cluster indicates if a timeout has occurred.

    Whether the data is read synchronously or asynchronously is platform-dependent. Right-click the node and select Synchronous I/O Mode»Synchronous from the shortcut menu to read data synchronously.

    When you transfer data from or to a hardware driver synchronously, the calling thread is locked for the duration of the data transfer. Depending on the speed of the transfer, this can hinder other processes that require the calling thread. However, if an application requires that the data transfer as quickly as possible, performing the operation synchronously dedicates the calling thread exclusively to this operation.

    Note In most applications, synchronous calls are slightly faster when you are communicating with 4 or fewer instruments. Asynchronous operations result in a significantly faster application when you are communicating with 5 or more instruments. The LabVIEW default is asynchronous I/O.

    Examples

    Refer to the following example files included with LabVIEW.

    • labview\examples\Instrument IO\Serial\Continuous Serial Write and Read.vi
    • labview\examples\Instrument IO\VISA\USB\USB RAW - Bulk.vi
    • labview\examples\Instrument IO\GPIB\GPIB with VISA functions.vi