Serial communication is the most common low-level protocol for
communicating between two or more devices. Normally, one device is
a computer, while the other device can be a modem, a printer, another
computer, or a scientific instrument such as an oscilloscope or a
function generator. For many serial port applications, you can communicate
with your instrument without detailed knowledge of how the serial
port works. Communication is established through a serial port object,
which you create in the MATLAB® workspace. For information about
serial object, see Serial Port Object.
Before you can write or read data, both the serial port object and the instrument must have identical communication settings. For information, see Configuring Communication Settings.
|Remove instrument objects from MATLAB workspace|
|Remove instrument objects from memory|
|Disconnect interface object from instrument|
|Connect interface object to instrument|
|Write text to instrument|
|Read binary data from instrument|
|Read data from instrument, and format as text|
|Write binary data to instrument|
|Instrument object properties|
|Information about available hardware|
|Disconnect and delete all instrument objects|
|Instrument object property information|
|Read data asynchronously from instrument|
|Configure or display instrument object properties|
|Create serial port object|
|List of serial ports connected to your system|
|Stop asynchronous read and write operations|
|Read binblock data from instrument|
|Write binblock data to instrument|
|Display instrument object summary information|
|Remove data from input buffer|
|Remove data from output buffer|
|Open Test & Measurement Tool|
|Read line of text from instrument and discard terminator|
|Read line of text from instrument and include terminator|
|Display event information when event occurs|
|Read instrument objects from memory to MATLAB workspace|
|Find visible and hidden instrument objects|
|Help for instrument object type, function, or property|
|Define and retrieve commands that identify instruments|
|Define notification for instrument events|
|Open Property Inspector|
|Determine whether instrument objects are valid|
|Length of instrument object array|
|Load instrument objects and variables into MATLAB workspace|
|Class method names and descriptions|
|Convert instrument object to MATLAB code|
|Write text to instrument, and read data from instrument|
|Save instrument objects and variables to MAT-file|
|Read data from instrument, format as text, and parse|
|Size of instrument object array|
The serial port object establishes a connection between MATLAB® and the instrument via the serial port.
Communication settings are associated with the baud rate and serial data format.
You can write and read both text and binary data with a serial port object.
Enhance your instrument communication using events and callbacks.
The control pins allow you to signal the presence of connected devices and to control the flow of data.
Basic features of the serial port.
These properties are available in the toolbox.
Try these tips if you have problems using the toolbox with the Serial Port interface. Includes information about Serial Port supported platforms, adaptor requirements, configuration and connection, and other interface-specific tips.