[Modbus]
説明
cbFunc is a callback function pointer array. When poll() receives the corresponding function code, it will call the corresponding function pointed to in the cbFunc array.
構文
uint8_t Func1(function, address, length)
{
return EXCEPTION_CODE;
}
node1.cbFunc[MODBUS_CB_CODES] = Func1;媒介変数
node1: ModbusSlaveNode object.Func1: User-defined function that returns a Byte of EXCEPTION_CODE.function: Modbus packet function code.address: The address of the bit that the Modbus packet wants to access.length: The length of the space that the Modbus packet wants to access.cbFunc[]: Call-back function letter array.MODBUS_CB_CODES: The callback function has a column index value and supports the following function codes.MODBUS_CB_READ_COILS
MODBUS_CB_READ_DISCRETE_INPUTS
MODBUS_CB_READ_HOLDING_REGISTERS
MODBUS_CB_READ_INPUT_REGISTERS
MODBUS_CB_WRITE_SINGLE_COIL
MODBUS_CB_WRITE_SINGLE_REGISTER
MODBUS_CB_WRITE_MULTIPLE_COILS
MODBUS_CB_WRITE_MULTIPLE_REGISTERS
MODBUS_CB_MASK_WRITE_REGISTER
例
Please refer to the Modbus Slave example.
See Also
ライブラリリファレンスホーム
86Duinoリファレンスのテキストは、Arduinoリファレンスを改変したもので、Creative Commons Attribution-ShareAlike 3.0ライセンスに基づいてライセンスされています。リファレンス内のコードサンプルはパブリックドメインとして公開されています。