ModbusMaster
ModbusMaster copied to clipboard
hello i can write data but i can't read how can i read data can you help me
For example, how can I read the data in the 40001 register, I wrote a code but it didn't work, how can I read the data?
void loop() { static uint32_t i; uint8_t j, result; uint16_t data[6];
result = node.readHoldingRegisters(0x40000, 6);
if (result == node.ku8MBSuccess) { for (j = 0; j < 6; j++) { data[j] = node.getResponseBuffer(j); } }
delay(100);
node.writeSingleRegister(0x40000, 1506);
delay(100);
node.writeSingleRegister(0x40001, 100);
delay(100);
node.writeSingleRegister(0x40002, data);
delay(100);
}
i have same issue did u solve?