ArduinoModbus icon indicating copy to clipboard operation
ArduinoModbus copied to clipboard

Allow declaring multiple banks of registers at a time

Open salasidis opened this issue 3 years ago • 2 comments

Got it to work on a Portenta H7 - only testing Holding Register reading (all required in my application).

I have a question about the software.

Is it possible to issue 2 configures as below

modbusTCPServer.configureHoldingRegisters(0, nSensors);
modbusTCPServer.configureHoldingRegisters(1000, nSensors*2);

I would like to have the first group be scaled integers, and the second group will be transmitted as floats. The user will decide which to access depending on their PLC etc

Thanks

salasidis avatar Jul 02 '22 21:07 salasidis

Tested it - added 2nd group of configure registers, and able to transmit floats.

All is good.

Was extremely easy to implement.

Thanks

salasidis avatar Jul 02 '22 22:07 salasidis

Actually, I thought it was working, but it was not - It looks like only one bank of registers can be declared at a time.

What I did to compensate was -say I have 100 sensors -I reserved space for 1000 + 100x2 holding registers. This first 100 resisters hold the Int representations, the last 200 registers the floats. This wastes 900 register positions - almost 2k RAM presumably.

salasidis avatar Jul 03 '22 02:07 salasidis