[Modbus]
描述
Initialize the ModbusGateway object and specify the communication mode between this object and the Modbus Master.
語法
gateway1.begin(mode, serial)
gateway2.begin(mode)
參數
gateway1/gateway2: ModbusGateway object.mode: Specify the communication mode between the ModbusGateway object and the Modbus Master with MODBUS_RTU, MODBUS_ASCII or MODBUS_TCP quotes.serial: Specify the Serial class as the transmission channel.
回傳
bool: Returns true if successful, false if not
範例
#include <Modbus86.h>
#include <Ethernet.h>
ModbusGateway gateway1;
ModbusGateway gateway2;
void setup()
{
Serial485.begin(115200);
gateway1.begin(MODBUS_RTU, Serial485);
Ethernet.begin();
gateway2.begin(MODBUS_TCP);
}
void loop()
{
}函式庫參考主頁面
86Duino 參考的文本是根據 知識共享署名-相同方式分享 3.0 許可證,部分文本是從 Arduino 參考 修改的。 參考中的代碼示例已發佈到公共領域。