You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using ArduinoModbus library with RP2040 Pico with Arduino Pico core.
I am able to communicate with Modbus slave and client using this library, the limitation I am facing is that I need to read around 100 holding registers from energy meter slave and process that data to serve it on to Modbus TCP server. but i can only read up to 14 holding registers using Modbus RTU client. please guide me how to fix the issue.
constint numHoldingRegisters = 100;
voidreadHoldingRegisterValues() {
Serial.print("Reading Holding Register values ... ");
// read 10 Input Register values from (slave) id 42, address 0x00if (!ModbusRTUClient.requestFrom(42, HOLDING_REGISTERS, 0x00, numHoldingRegisters)) {
Serial.print("failed! ");
Serial.println(ModbusRTUClient.lastError());
} else {
Serial.println("success");
while (ModbusRTUClient.available()) {
Serial.print(ModbusRTUClient.read());
Serial.print('');
}
Serial.println();
}
// Alternatively, to read a single Holding Register value use:// ModbusRTUClient.holdingRegisterRead(...)
}
the error shows:
.............. failed! Connection timed out
The text was updated successfully, but these errors were encountered:
Please consider that Modbus RTU requires a termination resistor at the end of the line. i personally don't have problems with the buffer size. I used the Arduino Opta RS485 and i read currently 30 registers without problems.
I am using ArduinoModbus library with RP2040 Pico with Arduino Pico core.
I am able to communicate with Modbus slave and client using this library, the limitation I am facing is that I need to read around 100 holding registers from energy meter slave and process that data to serve it on to Modbus TCP server. but i can only read up to 14 holding registers using Modbus RTU client. please guide me how to fix the issue.
the error shows:
The text was updated successfully, but these errors were encountered: