attach()
Description
Initializes the ModbusSlaveNode
object and specifies the mount channel and node number.
Syntax
node1.attach(slave_id, bus1) node2.attach(bus2)
Parameters
node1/node2
: ModbusSlaveNode
object.
slave_id
: Specifies the slave node number. In TCP mode, if the number is not specified, the number will be preset to MODBUS_TCP_SLAVE
(0xFF).
bus1/bus2
: Specifies the ModbusSlave
object to be mounted.
Return
bool
: If successful, return true
, otherwise return false
Example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
|
See Also
- ModbusSlave::begin()
- ModbusMasterNode::attach()
Library Reference Home Page
The text in the 86Duino reference material is modified from Arduino Reference Material, licensed under a Creative Commons Attribution-Share Alike 3.0 License. The code examples in the reference material have been released into the public domain.