Main Content

readbinblock

读数据来回binblock之一m VISA resource

    Description

    example

    data= readbinblock(v)reads a binblock of data from the VISA resourcevand returns the data as a row vector of doubles. The function suspends MATLAB®execution until the number of values specified in the binblock is read or a timeout occurs.

    data= readbinblock(v,datatype)reads a binblock of data interpreted as the type specified bydatatype. For numeric types, the data is returned as a row vector of doubles. For text types, the data is returned as a character vector or string, as specified.

    Examples

    collapse all

    Create a connection to a VISA resource. This example shows a connection to a device with the aliasCOM4using the VISA-Serial interface.

    v = visadev("COM4");

    Read a binblock ofuint8data from the VISA resourcev.

    data = readbinblock(v);

    Input Arguments

    collapse all

    VISA resource, specified as avisadevobject.

    Example:readbinblock(v)reads a binblock of data from the VISA resourcev.

    Size and format of each value, specified as a character vector or string.datatypedetermines the number of bytes to read for each value and the interpretation of those bytes as a MATLAB data type.

    Example:readbinblock(v,"double")reads a binblock of double data.

    Data Types:char|string

    Version History

    Introduced in R2021a