Articles Posted by the Author:

  • available()

    available()

    Description Returns the data of the private array readData in the ModbusMasterNode class. readData is the array stored after reading back the Slave device register using the Read function code. Syntax node1.available() Parameters node1: ModbusMasterNode object. Return uint8_t: Returns the number of data in the private array readData of the ModbusMasterNode class 1 2 3 […]


  • send()

    send()

    Description Sets the arguments to the private array writeData in the ModbusMasterNode class and automatically stacks the data, using beginTransmission with writeMultipleRegisters without parameters. writeData is the content of the Modbus packet using the Write function code. Syntax node1.send(value) Parameters node1: ModbusMasterNode object. value: The value to be filled into the writeData array, i.e. the […]


  • sendBit()

    sendBit()

    Description Sets the arguments as bits to the private array writeData in the ModbusMasterNode class and automatically stacks the data, using beginTransmission with writeMultipleCoils without parameters. writeData is the content of a Modbus packet using the Write function code. Syntax node1.sendBit(value) Parameters node1: ModbusMasterNode object. value: Fill in the Boolean value of the writeData array, […]


  • beginTransmission()

    beginTransmission()

    Description Set the starting address of the Slave device register to be written. Used with writeMultipleCoils or writeMultipleRegisters without parameters. See Example for details. Syntax node1.beginTransmission(write_address) Parameters node1: ModbusMasterNode object. write_address: The starting address of the Slave device register to be written. Example 1 2 3 4 5 6 7 8 9 10 11 12 […]


  • writeMultipleRegisters()

    writeMultipleRegisters()

    Description Sends a packet command to write multiple Holding Registers to the Slave node. Syntax node1.writeMultipleRegister(write_address, write_size) node2.writeMultipleRegister() - The function and usage are different with or without parameters. See the example for details. Parameters node1/node2: ModbusMasterNode object. write_address: The starting address of the Holding Registers to be written. write_size: The size of the Holding […]


  • writeMultipleCoils()

    writeMultipleCoils()

    Description Sends a packet command to the Slave node to write multiple Coils registers. Syntax node1.writeMultipleCoils(write_address, write_size) node2.writeMultipleCoils() - The function and usage are different with or without parameters. See the example for details. Parameters node1/node2: ModbusMasterNode object. write_address: The starting address of the Coils register to be written. write_size: The size of the coils […]


  • writeSingleRegister()

    writeSingleRegister()

    Description Sends a packet command to the Slave node to write to a single Holding Register register. Syntax node1.writeSingleRegister(write_address, write_size) Parameters node1: ModbusMasterNode object. write_address: The address of the Holding Register register to be written. write_size: The size of the Holding Register register to be written. Return int: If successful, return MODBUS_SUCCESS, otherwise return EXCEPTION_CODE […]


  • writeSingleCoil()

    writeSingleCoil()

    Description Sends a packet command to the Slave node to write to a single Coil register. Syntax node1.writeSingleCoil(write_address, value) Parameters node1: ModbusMasterNode object. write_address: The address of the Coil register to be written. value: The value of the Coil register to be written, usually 0 or 1. Return int: If successful, return MODBUS_SUCCESS, otherwise return […]


  • readInputRegisters()

    readInputRegisters()

    Description Sends a packet command to the Slave node to read the Input Registers register. Syntax node1.readInputRegisters(read_address, read_size) Parameters node1: ModbusMasterNode object. read_address: The starting address of the Input Registers register to be read. read_size: The size of the Input Registers register to be read. Return int: If successful, return MODBUS_SUCCESS, otherwise return EXCEPTION_CODE . […]


  • readHoldingRegisters()

    readHoldingRegisters()

    Description Sends a packet command to the Slave node to read the Holding Registers register. Syntax node1.readHoldingRegisters(read_address, read_size) Parameters node1: ModbusMasterNode object. read_address: The starting address of the Holding Registers register to be read. read_size: The size of the Holding Registers register to be read. Return int: If successful, return MODBUS_SUCCESS, otherwise return EXCEPTION_CODE . […]