arduino-libraries/ArduinoModbus

Allow declaring multiple banks of registers at a time

Opened this issue · 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

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

All is good.

Was extremely easy to implement.

Thanks

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.