Write line of ASCII data to serial port
writeline(device,data)
example
writeline(device,data) writes the ASCII text data, followed by the terminator, to the specified serial port device. The function blocks MATLAB and waits until the data and terminator are written to the port.
device
data
collapse all
Write an instrument identification query string to a serial instrument. writeline automatically includes the defined terminator.
writeline
s = serialport("COM3",9600); configureTerminator(s,"CR") ⋮ writeline(s,"*IDN?")
serialport
Serial port, specified as a serialport object.
Example: serialport()
serialport()
ASCII data to write to serial port, specified as a string or character vector of text.
Example: "IDN?"
"IDN?"
Data Types: char | string
char
string
configureTerminator
readline
write