User`s manual

Writing and Reading Data
8-35
Note that the ValuesSent property value includes the terminator since each
occurrence of
\n in the command sent to the device is replaced with the
Terminator property value.
s.Terminator
ans =
LF
The default value of Terminator is the line feed character. The terminator
required by your device will be described in its documentation.
Synchronous Versus Asynchronous Write Operations. By default, fprintf operates
synchronously and will block the MATLAB command line until execution
completes. To write text data asynchronously to the device, you must specify
async as the last input argument to fprintf.
fprintf(s,'Display:Contrast 45','async')
Asynchronous operations do not block access to the MATLAB command line.
Additionally, while an asynchronous write operation is in progress, you can:
Execute an asynchronous read operation since serial ports have separate
pins for reading and writing
Make use of all supported callback properties
You can determine which asynchronous operations are in progress with the
TransferStatus property. If no asynchronous operations are in progress, then
TransferStatus is idle.
s.TransferStatus
ans =
idle
Rules for Completing a Write Operation with fprintf.
A synchronous or asynchronous
write operation using
fprintf completes when:
The specified data is written.
The time specified by the
Timeout property passes.
Additionally, you can stop an asynchronous write operation with the
stopasync function.