Writing modbus to EV charger

Hi there!
I have started my experience with Node Red few weeks ago.
The goal is to manage the power flow between PV (via SOFAR 20 KTL), energy storage, EV charger, and the heat pomp. I had to start with SOFAR and the EV charger.
EV charger is BENY BCP-AT2N-L - it is 11kW 3 phase charger.
I got all necessary protocols for the SOFAR and the Charger.
Both are connected via RS485 but via two adapters (SOFAR baud is 9600bps, EV Charger is 4800bps)
Right now I'm able to read all necessary registers either from SOFAR or EV charger. I can calculate and set the surplus current from PV for the EV charger.

But the problem is that EV charger don't response to any changes! Even writing simple register to STOP charging does not work.
I have got confirmed info from producer that there are no special authorization register or dip switches in charger to enable writing.

I'm using MODBUS_FLEX_WRITE and after MODBUS RESPONSE. I receive info that data has been received but that is all.

the code just before flex_write goes like this:

msg.payload = [
{
value: msg.payload,
fc: 6,
unitid: 1,
address: 512,
quantity: 1
},
];
return msg;

I was trying to write numbers, strings and arrays (since I receive arrays when reading registers).
I was trying the FC 6, 16 and also writing decimals and hex values.

Can anyone could help me with the diagnosis ??
Many thanks
MB

start simple. use a single write and set a value - does any work?

Try setting then reading back using single individual operations.

PS, Modbus ONLY accepts 16 bit numbers for FC 6

If you want to send strings, you need to encode them into a number array and use FC16

The buffer-parser parser node package has a helper node ("buffer-maker") that can convert string (and other) values to UINT16BE array (Unsigned 16 bit Integer Big Endian)

Well, yes.
I've been trying to use simple write.

Try setting then reading back using single individual operations.

Could you elaborate ?

If you want to send strings, you need to encode them into a number array and use FC16

I was trying to send simple 0 ("zero") in the format of string, number and array. Without any response.

I will try BUFFER-MAKER - thank you for suggestion.
Is it like world wide standard that chargers require an arrays in modbus communication?

MB

  1. Write a single value (ANY valid writable register as per units docs)
  2. Read back the exact SAME register
  3. check it worked!

No, Modbus is the communication protocol and it requires numbers.

Just remember, in computers, everything is a number. Even strings! Modbus wants numbers, it has nothing to do with chargers. In fact, I dont know of many EV chargers that offer Modbus - most common protocol for controlling them is the Open Charge Point Protocol (OCPP).

1.Write a single value (ANY valid writable register as per units docs)
2. Read back the exact SAME register
3. check it worked!
Off course I checked. It didn't work.

I will be searching and post here if find out.

Thanks

I have not heard of any EV chargers that support Modbus - the vast majority are either proprietary or more and more and moving towards either MQTT or OCCP - are you positive your model of charger supports Modbus over RS485 ? (Some of them support Modbus for READING from energy meters or inverters)

Craig

In fact just looking up the Australian version of the EV charger you have and it supports wifi in an app for controlling it, but i can find no mention of modbus. It does use Modbus to talk to the energy meters that it supports for its various modes - i think you may be getting confused with this.

Possibly post up a link to the manual and modbus documentation you are using

Craig

Well, this model has a RS485 dedicated connector. Here is on the picture (the green one).
I've added 120 ohm resistor at the end of the line.


Ports are described typically for RS connection: A line and B line.
For communication with energy meters it uses dedicated RJ45 port.

In fact if there will be no communication over RS485 producer won't send me the modbus protocol.
file in attached.

BENY Charge Point Communication protocol based on RS485 v3_1.pdf (682.1 KB)