A Forum run by Enthusiasts of MidNite Solar

The Open Source software/hardware corner => General info => Topic started by: robp on October 30, 2016, 06:39:20 AM

Title: Modbus register 4120
Post by: robp on October 30, 2016, 06:39:20 AM
Hi, I'm having trouble reading the charger state register (4120 MSB) as referred to by the modbus doc dated 9 dec 2013.

During the day I was getting 0x02BC which doesn't seem to conform to the doc (no 0x02 listed) and this doesn't change when the charger changes modes ie absorb to float, which leads me to believe that I'm looking in the wrong register.  At night I'm getting 0x0044 or 0x0046...  0x00 could mean resting.

I'd just like to confirm that it has not changed with newer firmware? or that others are reading it ok.

classic 150 rev 4
firmware 2079

I've had no problems reading other registers such as voltage and current.

Thanks in advance.
Rob
Title: Re: Modbus register 4120
Post by: WillEert on October 30, 2016, 04:35:50 PM
When I developed the need to get this data I used Dgd's method. The MSB needs to be shifted to the right 8 places and then read. David's code has examples of how this works in his sketches.

Will
Title: Re: Modbus register 4120
Post by: robp on November 02, 2016, 04:59:42 PM
Thanks for your reply,  I did find dgd's program which help me confirm I was trying to do the right thing. http://kb1uas.com/mnsforum/index.php?topic=2393.0   (arduino code about half way down). 

In the end it was simple mistake on my part  I was requesting register 4121 expecting 4120 but I should I have been requesting 4119.  I knew I had to add or subtract one....

I'm now getting the hex reply 04 03 which if I just look at the high byte (04) tells me that it's in bulk mppt.

Thanks again