User`s manual
Getting Started with Serial I/O
8-23
Note that you can configure only one property value at a time using the dot
notation.
In practice, you can configure many of the properties at any time while the
serial port object exists – including during object creation. However, some
properties are not configurable while the object is connected to the device or
when recording information to disk. Refer to “Property Reference” on page 8-70
for information about when a property is configurable.
Specifying Property Names
Serial port property names are presented using mixed case. While this makes
property names easier to read, you can use any case you want when specifying
property names. Additionally, you need use only enough letters to identify the
property name uniquely, so you can abbreviate most property names. For
example, you can configure the
BaudRate property any of these ways.
set(s,'BaudRate',4800)
set(s,'baudrate',4800)
set(s,'BAUD',4800)
When you include property names in an M-file, you should use the full property
name. This practice can prevent problems with future releases of MATLAB if
a shortened name is no longer unique because of the addition of new properties.
Default Property Values
Whenever you do not explicitly define a value for a property, then the default
value is used. All configurable properties have default values.
Note Your operating system provides default values for all serial port
settings such as the baud rate. However, these settings are overridden by your
MATLAB code, and will have no effect on your serial port application.
If a property has a finite set of string values, then the default value is enclosed
by
{}. For example, the default value for the Parity property is none.
set(s,'Parity')
[ {none} | odd | even | mark | space ]
You can find the default value for any property in the property reference pages.