ModbusSlaveNode.poll()

[Modbus]

Description

Receives and parses Modbus packets and accesses the register and callback function according to the command.

When the function code is Read command, it will call the callback function first and then read the register back; when the function code is Write command, it will write the register first and then call the callback function; when the function code is ReadWrite command, it will write the register first and then call the Write callback function, then call the Read callback function and finally read the register back.

Syntax

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

Parameters

  • node1/node2: ModbusSlaveNode object.
  • buf: User-defined registry space.
  • size: The size of the self-defined space.

Returns

Int: The length of the received Modbus packets.

Example

Please refer to the Modbus Slave example.

See Also


Libraries Reference Home

The text of the 86Duino reference is a modification of the Arduino reference and is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.

Leave a Comment

Scroll to Top