modbus
Create Modbus object
Syntax
Description
m = modbus(
constructs a Modbus object, Transport
,DeviceAddress
)m
, over the transport type
Transport
using the specified DeviceAddress
. When
the transport is 'tcpip'
, DeviceAddress
must be
specified as the second argument. DeviceAddress
is the IP address or host
name of the Modbus server.
m = modbus(
additionally specifies Transport
,DeviceAddress
,Port
)Port
. When the transport is
'tcpip'
, DeviceAddress
must be specified.
Port
is the remote port used by the Modbus server. Port is optional,
and it defaults to 502, which is the reserved port for Modbus.
m = modbus(
specifies additional options with one or more name-value pair arguments using any of the previous syntaxes. For example, you can specify a timeout value. The Transport
,DeviceAddress
,Name,Value
) Timeout
property specifies the waiting time to complete read and write operations in seconds, and the default is 10
.
m = modbus(
specifies additional options with one or more name-value pair arguments using any of the
previous syntaxes. For example, you can specify Transport
,Port
,Name,Value
)NumRetries
, the number of
retries to perform if there is no reply from the server after a timeout.