External Interfaces/API    


Serial Port I/O


Introduction

What Is MATLAB's Serial Port Interface?

MATLAB's serial port interface provides direct access to peripheral devices such as modems, printers, and scientific instruments that you connect to your computer's serial port. This interface is established through a serial port object. The serial port object supports functions and properties that allow you to:

If you want to communicate with PC-compatible data acquisition hardware such as multifunction I/O boards, you need the Data Acquisition Toolbox. If you want to communicate with GPIB- or VISA-compatible instruments, you need the Instrument Control Toolbox.

For more information about these products, visit the MathWorks Web site at http://www.mathworks.com/products.

Supported Serial Port Interface Standards

Over the years, several serial port interface standards have been developed. These standards include RS-232, RS-422, and RS-485 - all of which are supported by MATLAB's serial port object. Of these, the most widely used interface standard for connecting computers to peripheral devices is RS-232.

In this guide, it is assumed you are using the RS-232 standard, which is discussed in Overview of the Serial Port. Refer to your computer and device documentation to see which interface standard you can use.

Supported Platforms

MATLAB's serial port interface is supported for Microsoft Windows 95, Windows 98, Windows 2000, Windows NT, Linux, and Sun Solaris platforms.

Using the Examples with Your Device

Many of the examples in this section reflect specific peripheral devices connected to a PC serial port - in particular a Tektronix TDS 210 two-channel oscilloscope connected to the COM1 port. Therefore, many of the string commands are specific to this instrument.

If your peripheral device is connected to a different serial port, or if it accepts different commands, you should modify the examples accordingly.


 DDE Advisory Links Overview of the Serial Port