diy solar

diy solar

Schneider Conext XW

Sorry, I can't help with the Combox, I never had one. The XW-Pro is not compatible with the Combox, so I didn't have an option, had to use the Gateway. I was in the short window, the Insight Home and Facility boxes didn't exist yet.

In the Gateway, there was a checkbox to tell it to allow Modbus TCP. Does the Combox have a setting like that?
 
Yes, Combox seems to be a simplier gateway device. It has references to Slave and Master that don't seem relevant in gateway.
All I get from attempts to talk to Combox is:
solar92.read_input_registers(0,1)
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/home/housectl/ov_modbus.py", line 126, in read_input_registers
if data is None: raise RuntimeError
RuntimeError
---
where this operation works fine with the gateway at its IP.
solar502.read_input_registers(40278,1)
5779
 
I found this....

"Select Listening in Modbus TCP Enabled to enable Modbus communication"

In the Combox manual. Not sure where that is located though.

What register are you trying to read? 40278 would be a register at decimal 278 or &H116 hex. &H116 is the seconds that the grid has been active in the XW.

I read the watts of the Grid AC1 input at &H66 and the output watts at &H9A
In Decimal those would be 102 or 40102 with the register type. But it is also a 32 bit value, so you need to read 2 words and join them. Same 32 bit read for Output Watts at decimal 154 or 40154.

Here is the structure I use in the PLC to read the output watts

' Read output watts
DM[9] = &H9A

READMB2 4,10,DM[9],DM[10],2

O = DM[11]
SETHIGH16 O,DM[10]
DM[15] = O

DM[9] register is set to the location I want to read, in this case HEX 9A
The READMB2 line is using virtual com 4 which was setup as Modbus TCP to the gateway ip address.
10 is the device id of the first XW inverter, I only have one.
DM[9] is telling it which register to read
DM[10] is where it will store the response of the first word
2 on the end is read 2 16 bit registers, the second one goes into DM[11]

"O" is the variable where I store the resulting 32 bit watts reading.
DM[11] holds the low 16 bits so they get copied first. The "SETHIGH" appends the upper 16 bits from DM[10] which has the high 16 bits.
I also copy "O" to DM[15] for use in other calculations.

I am sure this could be done a little cleaner, but it made it easy to just pick any register and have the same lines able to pull any 32 bit value, so I have copied this section many times.

Reading the watts from the main panel PZEM meters is a bit different on serial Modbus
Here is the L1 power reading

READMB2 11,4,0,DM[41],10

If STATUS(2) = 1 THEN
DM[39] = 1
N = DM[44]
SETHIGH16 N,DM[45]
ELSE
DM[39] = 0
ENDIF

READMB2 this time is reading from COM 11. That is actually COM1 physical port on the Nano-10 but if I use COM 1 it uses Modbus ASCII and we want Modbus RTU, so they signal that by adding 10 to the com number. 4 is device id again, that is the L1 PZEM power meter.
0 means starting from the first register. Store the data starting at DM[41] and take 10 registers.
Watts is again 32 bits like the XW, but, not signed, and multiplied by 10 so 200 watts is 2000 here. DM[44] has the low 16 bits, and then SETHIG from DM[45] with the high 16 bits.

The "If STATUS(2)" check returns a 1 for a read success. If a bad read, set the read status to zero at DM[39]. Before the read I set that to 41 for debugging, and it is set to one if the read is good.

So now "O" has the watts going out of the XW and "N" has the watts being used from L1 in the main panel.
It's a little cryptic, but once you got working in it, it starts making some sense. I know I can clean up my code a lot, and I need to add more comments, even for myself, let alone someone else trying to read through it.

First thing you should do is just make it monitor the values and make sure you are getting the correct data. It is very easy to read the wrong register, get bytes or words flipped, or treat a signed variable as unsigned etc.
 
where this operation works fine with the gateway at its IP.
solar502.read_input_registers(40278,1)
5779

This is in modbus map for gateway, read batt voltage 57.79 v
Showing that the module works on gateway.

Now cannot get a single or simply response on Combox. Sample was trying the base address of 0 which is supposed to be device name
 
fyi -- Been told by Eric that if I utilize the gateway, it has two (2) Xanbus ports
I can use one on 6848 Pro and the other for the 4548 older unit
and then I won't need the Combox
I will post again after I get a hold of my gateway
 
Who is Eric?
I thought the two Xanbus ports were so you could daisy chain more charge controllers etc after the gateway.

I'm curious if it works for you.
 
Who is Eric?
I thought the two Xanbus ports were so you could daisy chain more charge controllers etc after the gateway.

I'm curious if it works for you.
Eric Benston (spelling?) He is the lead applications engineer for Schneider Solar. He appears in a few YT videos. I had his mobile number at one time but have misplaced it. He really doesn't like it when DIY'ers call him direct. LOL
 
Works. gateway will use two
Who is Eric?
I thought the two Xanbus ports were so you could daisy chain more charge controllers etc after the gateway.

I'm curious if it works for you.
Pretty sure you can always put two mppt units on the same modbus. You just need to be sure they get assigned different IDs. Like 30 and 31.
The gateway did my trick ... have main system on one xanbus and a standalone older 4548 on the second xambus. No conflicts.
 
Noticing I still have the issue on charging from grid. I do use modbus to set the charge limit

solar502 = ov_modbus.session('192.168.1.91',pollinterval=3,unit_id=1) # , port=502 gateway or Insight Home

sensor = ov_modbus.sensor(solar502, 40210, 1, signed=False) # 40210 Setpoint for maximum charge
sensors['XW_ChrgMax'] = sensor # W unit16 rw - works

So using address 40210 at port 502 on the xw6848 pro

So at times I will: sensors['XW_ChrgMax'].set(500)
and then later; sensors['XW_ChrgMax'].set(2500)

There will be times that the Inverter gets stuck at the lower value and nothing I send will push more than the 500 watts.
If I reboot the xw6848 it comes back at the 2500 level.
Any thoughts ?
 
That syntax is different than what I use, but the data going to a given port should still be correct.
40210 would be the decimal port number. My Modbus map is in hex. 210 decimal is &H00D2 hex. That is a read only location in the XW Pro, it shows it as seconds the battery has been discharging.
Maximum charge rate is at &H016F Decimal 367 or 40367 on the map I have.
That is a maximum, there are a few things that can cause it to be less than that. In my case, I am limited to just the 20 amp grid side breaker. If the loads in my backup panel are pulling too much power, the XW will reduce the charge current to not exceed the input breaker capability.
 
I don't know why we have different maps. Mine works, only gets stuck.
RW for me. Works for days then one day it is stuck at a low value.
The reboot ALWAYS fixes it. So it's like code gets corrupted over time and S/E has better things to do.
I was just looking to see if any user here encountered that like me.

Mine is in watts, Your appears to be in % from 0 to 100. I got them both working now, so I'll see if one doesn't lock up.
 
Back
Top