19.11.2020, 10:14
Hello.
I want to compare serial bus loading in case of use modbus mapping feature and modbus script control in the case of sequential registers access.
Modbus protocol assumes that read/write operations with multiple sequential registers can be performed using single request. Caller can to specify function, first register index, registers number and size. So if I need to read 64 sequential registers that have 4 bytes length I can:
* Create single read request to read 256 bytes.
* Create 64 requests to read 4 bytes on each request.
My questions are:
- When I use mapping feature does LM engine is smart enough to understand that some registers in the profile map are sequential and to create one request but not 64 requests?
- If I use 'luamodbus' library (class instanced?) does code below creates one request to read 20 registers, or 20 requests will be created to read each register?
I want to compare serial bus loading in case of use modbus mapping feature and modbus script control in the case of sequential registers access.
Modbus protocol assumes that read/write operations with multiple sequential registers can be performed using single request. Caller can to specify function, first register index, registers number and size. So if I need to read 64 sequential registers that have 4 bytes length I can:
* Create single read request to read 256 bytes.
* Create 64 requests to read 4 bytes on each request.
My questions are:
- When I use mapping feature does LM engine is smart enough to understand that some registers in the profile map are sequential and to create one request but not 64 requests?
- If I use 'luamodbus' library (class instanced?) does code below creates one request to read 20 registers, or 20 requests will be created to read each register?
Code:
i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19 = mb1:readregisters(0, 20)