Main Content

readline

Read line of ASCII string data from VISA resource

Since R2021a

    Description

    example

    data = readline(v) reads ASCII data from the VISA resource v until the first occurrence of the terminator and returns data as a string without the terminator. The function suspends MATLAB® execution until it reaches a terminator or a timeout occurs.

    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");

    Set the terminator to "CR/LF".

    configureTerminator(v,"CR/LF")

    Read a string of ASCII data from the VISA resource v. The readline function returns data until it reaches a terminator.

    data = readline(v);

    Input Arguments

    collapse all

    VISA resource, specified as a visadev object.

    Example: readline(v) reads ASCII data from the VISA resource v.

    Version History

    Introduced in R2021a