Table of Contents

ImodbusRTUMem()

ImodbusRTUMem() sets the sizes of M and D memory used by the Slave.

ImodbusRTUMem command operation flow

void ImodbusRTUMem(uint16_t m_size, uint16_t d_size)

Commands

Command Arguments Return Value Operation
ImodbusRTUMem(m_size, d_size) uint16_t m_size
uint16_t d_size
void Sets the sizes of M and D memory used by the Slave.

Example

void setup() {
  ImodbusRTUMem(100, 200);  // Set the M·D memory sizes used by the Slave.
  ImodbusRTUAdr(0, 0);  // Set the start addresses of M·D memory.
  ImodbusRTUInit(Serial1, 1, 115200);  // Set the communication port, station number and baud rate.
}
 
void loop() {
  ImodbusRTU();  // Check incoming requests and process Slave responses.
  D[0] = 100;
  D[3] = 200;
}

Precautions

Built-in Commands in the Same Category

← Built-in Command List