Instrument Control Toolbox    

Creating a Serial Port Object

You create a serial port object with the serial function. serial requires the name of the serial port connected to your device as an input argument. As described in Configuring Property Values, you can also configure property values during object creation.

Each serial port object is associated with one serial port. For example, to create a serial port object associated with the COM1 port:

The serial port object s now exists in the MATLAB workspace. You can display the class of s with the whos command.

Once the serial port object is created, the properties listed below are automatically assigned values. These general purpose properties provide descriptive information about the serial port object based on the object type and the serial port.

Table 5-3: Serial Port Descriptive Properties 
Property Name
Description
Name
Specify a descriptive name for the serial port object.
Port
Indicate the platform-specific serial port name.
Type
Indicate the object type.

You can display the values of these properties for s with the get function.


  Finding Serial Port Information for Your Platform The Serial Port Object Display