Author Topic: Modbus register 4371  (Read 960 times)

kmak

  • Newby
  • *
  • Posts: 3
Modbus register 4371
« on: September 21, 2019, 02:27:01 PM »
Forgive me if this topic has been discussed before...

I'm currently pulling a number of registers via modbus to populate binary sensors (via mqtt) in Home Assistant so as to create a number of automations to turn circuits on and off depending on sunlight, amp draw and such...

The problem I'm having is when  reading register 4371 on my classic 150 (with WBJR installed), as the current goes negative I get readings varying in the 65530 range.... I'm obviously missing something and I don't understand.  I have installed and used Graham's android app (which is really damn good) and I'd like to be able to capture some of the same values it displays, but I'm not a programmer although I can pretty much stumble through understanding code and making it work.

Ideally I'd like to be able to get the amps/watts consumption readings of the WBJR so as to add that to conditions within an automation.

Can someone please enlighten me with regards to 4371 register readings?

Thanks,

Kevin

boB

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3026
Re: Modbus register 4371
« Reply #1 on: September 21, 2019, 03:32:31 PM »

Register 4371  (modbus address 4370)  is a signed number so what you are seeing is a negative current.

65535 would be -1, 65530 would be  -6   etc...

I think that address 4392, register 4393  will show the same numbers.

K7IQ

kmak

  • Newby
  • *
  • Posts: 3
Re: Modbus register 4371
« Reply #2 on: September 21, 2019, 04:04:06 PM »
Wow, that's insanely simple.... Boy did I overthink it.

How far do the registers extend?  Based on the register doc from midnite it doesn't show anything beyond 4384 (4373 -> 4384 are reserved).

Kevin

boB

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3026
Re: Modbus register 4371
« Reply #3 on: September 21, 2019, 05:35:22 PM »

Well, the maximum current the WB Jr. can read, based on a 500A/50mV shunt, I remember that it would handle up to +/- 3000 amps or so.  That's +/- 3K amps.    For instance, you could have a shunt good for  5000 (5K) amps at 500mV and the WB Jr. should be able to handle the terminal shunt voltage up to that 1/2 volt (+/- 0.5V)

The actual internal current resolution of the WB Jr. is, as I remember, 0.078 amps and in the Classic is  averaged and rounded to 0.1 amp.

As of right now, the register addresses go up to and including  4425  (address 4424) which happens to be LastDerateAmp.  I haven't looked at the list for a while now but that should be what I call  SlidingILimit.  The last temperature amp limit of the Classic. 

There are several registers that are "Reserved" interspersed here and there in the list of registers.
Usually those are just waiting to eventually be populated with something else and something may have previously occupied that register address but you can't always count on that being the case when a register is designated as "reserved"

We need to update the documentation still but nothing outrageous has been added or deleted since last.
K7IQ

kmak

  • Newby
  • *
  • Posts: 3
Re: Modbus register 4371
« Reply #4 on: September 21, 2019, 05:44:15 PM »
Thanks a bunch for the info... I'd been wracking my brain for days trying to figure that out.

Kevin