modbus
Create Modbus object
Syntax
Description
Note
In R2022a, Modbus functionality has moved from Instrument Control Toolbox™ to Industrial Communication Toolbox™. If you have been a licensed Instrument Control Toolbox user prior to this release, you might be eligible to continue using Modbus functionality as described in Opt-In Offer for Instrument Control Toolbox Modbus Users.
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.
Examples
Input Arguments
Extended Capabilities
Version History
Introduced in R2017a