メインコンテンツ

writeline

Write line of ASCII data to VISA resource

    Description

    writeline(v,data) writes the ASCII text data followed by the terminator to the VISA resource v. The function suspends MATLAB® execution until the data and terminator are written.

    example

    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" and write a string of ASCII data to the VISA resource v. The writeline function automatically appends the terminator to the data.

    configureTerminator(v,"CR/LF")
    writeline(v,"START")

    Input Arguments

    collapse all

    VISA resource, specified as a visadev object.

    Example: writeline(v,data) writes ASCII data to the VISA resource v.

    ASCII data to write, specified as a character vector or string scalar of text.

    Example: writeline(v,"helloworld") writes the ASCII data "helloworld".

    Data Types: char | string

    Version History

    Introduced in R2021a