(To be removed) Create serial port object
serial
will be removed in a future release. Use serialport
instead. See Compatibility Considerations.
s = serial(
creates a serial port
object 'port'
)s
associated with the serial port specified by
'port'
. If 'port'
does not exist, or if it is in
use, you cannot connect the serial port object to the device.
s = serial(
creates a serial port object with the specified property names and property values. If an
invalid property name or property value is specified, an error is returned, and the serial
port object is not created.'port'
,Name,Value
)
Refer to serial Properties for a list of serial port
object properties that you can use with serial
.
Before you can communicate with the device, it must be connected to obj
with the
function. A connected
serial port object has a fopen
Status
property value of open
.
An error is returned if you attempt a read or write operation while the object is not
connected to the device. You can connect only one serial port object to a given serial
port.