poll()

Description

Receive and parse Modbus packets, and access registers and call callback functions according to commands. When the function code is a Read command, the callback function will be called first and then the register will be read back; when the function code is a Write command, the register will be written first and then the callback function will be called; when the function code is a ReadWrite command, the register will be written first and then the Write callback function will be called, then the Read callback function will be called, and finally the register will be read back.

Syntax

node1.poll() node2.poll(buf, size)

Parameters

node1/node2: ModbusSlaveNode object.

buf: User-defined register space.

size: The size of the user-defined space.

Return

int: Length of the received Modbus packet.

Example

Please refer to Modbus Slave Example

See Also

*cbFunc[]()


 

Library Reference

The text in the 86Duino reference is modified from the Arduino reference and is licensed under the Creative Commons Attribution-ShareAlike 3.0 License  . The code examples in the reference have been released into the public domain.