Connecting to the Device

Before you can use the serial port object to write or read data, you must connect it to your device via the serial port specified in the serial function. You connect a serial port object to the device with the fopen function.

fopen(s)

Some properties are read only while the serial port object is connected and must be configured before using fopen. Examples include the InputBufferSize and the OutputBufferSize properties. To determine when you can configure a property, see Property Reference.

You can examine the Status property to verify that the serial port object is connected to the device.

s.Status
ans =
open

As shown in the following illustration, the connection between the serial port object and the device is complete; data is readable and writable.

Connecting a serial port object and a device

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS