Getting data from inverters via an RS485 connection

No change with this new adapter either. Tried multiple USB ports on the windows laptop and the pi also. I can see the tx/rx LEDs flash so data is being sent but no idea what to enter in the app address to test, even before entering anything the errors are just going up.


Also installed python and ran it via VS Code and still never get anything back

MinimalModbus debug mode. Create serial port COM8
here 0
MinimalModbus debug mode. Will write to instrument (expecting 9 bytes back): '\x01\x04\x0bŸ\x00\x02²\x0b' (01 04 0B BC 00 02 B2 0B)
MinimalModbus debug mode. Clearing serial buffers for port COM8
MinimalModbus debug mode. No sleep required before write. Time since previous read: 287031937.00 ms, minimum silent period: 4.01 ms.
MinimalModbus debug mode. Response from instrument: '\x01\x84\x02ÂÁ' (01 84 02 C2 C1) (5 bytes), roundtrip time: 297.0 ms. Timeout for reading: 200.0 ms.

I am about 95% sure the code is just wrong because x02 means illegal data address, in relation to requests according to that pdf file with the registers, anyone know the correct values I can try?

FW of inverter is 330022, how about you @craigcurtin maybe they changed all the registers?

I took 3021 from the Python code in one of your posts earlier in this thread.

According to the 4G doc Craig attached to his post, register 3021 is reserved.
That’s in line with the illegal address error you’re seeing.

That same doc says register 3043 holds the mains frequnecy value.
Give it a try with 3043 in the address “box.” Given the -1 offset, and depending on the program’s
“start from 0 / start from one” setting, you may need to use 3042 vice 3043.

Will do and how about length and display options as above? 10 and Integer?
Also as soon as I hit the connect the button the Polls and Errors numbers keep going up, not sure if that’s right.
I tried a few of these from the code but none worked (from python)

Realtime_DCV = instrument.read_register(3021, numberOfDecimals=0, functioncode=4, signed=False) #Read DC Volts as Unsigned 16-Bit
	Realtime_DCI = instrument.read_register(3022, numberOfDecimals=0, functioncode=4, signed=False) #Read DC Current as Unsigned 16-Bit
	Realtime_ACV = instrument.read_register(3035, numberOfDecimals=0, functioncode=4, signed=False) #Read AC Volts as Unsigned 16-Bit
	Realtime_ACI = instrument.read_register(3038, numberOfDecimals=0, functioncode=4, signed=False) #Read AC Current as Unsigned 16-Bit
	Realtime_ACF = instrument.read_register(3042, numberOfDecimals=0, functioncode=4, signed=False) #Read AC Frequency as Unsigned 16-Bit

The doc says that particular register is an Input register, so change the value in the dropdown menu to input register vice holding register. It also says the offset is -1.
e.g. if the register address is 3043, you specify 3042 in the app.
The app has a setting that can do that. (start from 0 / start from 1)
I’d start with the length set to 2.
The doc says the data type is uint16, so the Integer bullet is the correct choice.

Nothing but errors as soon as I hit connect, before I even input anything in the other fields


Really doubt that 3 different adapters can be incompatible, this still feels like software problem.

Same result with 3043 in the address box?

Correct

The screenshot shows holding registers. Did you try it with Input registers selected?

One other thing to try is to prepend a 3 to the address. i.e. try 33043 in the address box.

I think you were right with the 3 in front:


So that looks like some legit data at least, and the errors stopped, next is to try and update the python to also pull data

Did you try adding a 3 to the address? e.g. 33043 vice 3043.

Yup see above and it got some data

Looks like that was the problem. Now you’ve got something to work with.

What do you get with address 33043?

I think 722 is total generation


If I can get the python to return something then I can go and fix it

Here’s a screencap of that part of the register map.

That aside, now you should be able to fix your Python code to ge the results you’re after.

thumbsup highfive

I exited the app and went back in and now the values are totally different:

What’s got me puzzled is the app is showing 63042 as the start of the address block.
Not sure why it’s behaving that way. Not being familair with the inverter you have, I can only guess
as to what is happening. It appears your inverter wants a 5 digit address. Whether or not 3 is the correct
digit to prepend to the offset is the part I don’t know. You can try changing the 3 to another value.
Whether or not that will work, I can’t say, but it couldn’t hurt to try.

Yeah so 33035 is generation today which is correct, 28.3kw but not sure why it’s in position 2

You add the numbers in the column to the address entered into the address box.
That would give you 3037 as the address holding the value for “generation today.”

BTW, where’d you see that reference? The doc that Craig posted shows 3035 as a voltage value.

The inverter registers can hold data in MSW/LSW or LSW/MSW format.
MSW = Most Signifcant Word
LSW = Least Significant Word

Generally referred to as Big Endian or Little Endian, respectively