begin()
Description
Initializes a ModbusGateway
object and specifies the communication mode between this object and the Modbus master.
Syntax
gateway1.begin(mode, serial) gateway2.begin(mode)
Parameters
gateway1/gateway2
: ModbusGateway
object.
mode
: Specifies the communication mode between the ModbusGateway
object and the Modbus master. Arguments are MODBUS_RTU
, MODBUS_ASCII
, or MODBUS_TCP
.
serial
: Specifies the Serial class as the transmission channel.
Return Value
bool
: Returns true
on success, false
otherwise.
Example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
|
Library Reference Homepage
The text in the 86Duino reference material is licensed under the Creative Commons Attribution-ShareAlike 3.0 License. Code examples in the reference material are released into the public domain.