User`s manual
Writing and Reading Data
8-33
For example, suppose you write the string command *IDN? to the TDS 210
oscilloscope using the
fprintf function. As shown below, the string is first
written to the output buffer as six values.
The
*IDN? command consists of six values since the terminator is
automatically written. Moreover, the default data format for the
fprintf
function specifies that one value corresponds to one byte. For more information
about bytes and values, refer to “Bytes Versus Values” on page 8-11.
fprintf
and the terminator are discussed in “Writing Text Data” on page 8-34.
s=serial('COM1');
fopen(s)
fprintf(s,'*IDN?')
...
*IDN?
6 values
6 bytes
MATLAB Output Buffer
Bytes used during write
Bytes unused during write