BiancoRoyal/node-red-contrib-modbus

Errors when polling numerically high registers

Stomachbuzz opened this issue · 2 comments

Which node-red-contrib-modbus version are you using?

5.25.0

What happened?

I am integrating to a device with several registers in the 4x,xxx category.
The registers start at 40,001 and continue to 40,052 for the first chunk. It picks up again at 40,100 to 40,150. It then jumps to 42,050 and ends at 42,100

When polling the first chunk (40,001 to 40,052), everything works perfectly.
When polling anything beyond that, it gives an Error: Data length error, expected 7 got 6
I've tried tinkering with many settings and no luck.

Server

Modbus-Server Node

How can this be reproduced?

Attempt to poll for numerically high register addresses

What did you expect to happen?

No response

Other Information

No response

Through lots of tinkering, I discovered the solution.
For the specific register(s) I was trying to poll, they are 32-bit registers, split into 2 16-bits, with upper register first (sequentially lower) and lower register second.
For example, upper register: 42097; lower register 42098.
For this specific data, the upper register would always be irrelevant (always 0), so I discarded it.
Not sure if it is for the specific device I'm dealing with, but it only worked when I started at the upper register address with # of registers polled of 2.
So I get an array of [0, xxxx].

Previously I was inputting 2098 for starting address, with 1 addresses polled. <- ERROR
Now I have to do 2097 starting, 2 addresses polled.

This issue is stale because it has been open 60 days with no activity. It will be closed in 30 days, but can be saved by removing the stale label or commenting.