Main Content

readbinblock

Read one binblock of data from VISA resource

    Description

    example

    data = readbinblock(v) reads a binblock of data from the VISA resource v and 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 by datatype. 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 alias COM4 using the VISA-Serial interface.

    v = visadev("COM4");

    Read a binblock of uint8 data from the VISA resource v.

    data = readbinblock(v);

    Input Arguments

    collapse all

    VISA resource, specified as a visadev object.

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

    Size and format of each value, specified as a character vector or string. datatype determines 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

    Introduced in R2021a