Main Content

readline

Read line of ASCII string data from VISA resource

    Description

    example

    data= readline(v)reads ASCII data from the VISA resourcevuntil the first occurrence of the terminator and returnsdataas 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 aliasCOM4using 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 resourcev. Thereadlinefunction returns data until it reaches a terminator.

    data = readline(v);

    Input Arguments

    collapse all

    VISA resource, specified as avisadevobject.

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

    Introduced in R2021a