The Redflow BMS contains extensive MODBUS-TCP support for both Master and Slave operating modes (concurrently).
The Redflow BMS does not currently include support for native MODBUS-RTU (RS485 - serial) data communications to remote MODBUS-RTU Slave or Master devices.
However, it is easy to interface the BMS to a MODBUS-RTU external device using any properly working, off-the-shelf, MODBUS-TCP to MODBUS-RTU gateway device (there are many such devices on the market)
There is in particular a very cost effective gateway available called the USR-D302. This product supports MODBUS-TCP to MODBUS-RTU conversion (in either direction).
Meantime, this article (for the time being) explains and illustrates the process to configure and use such a device with the Redflow BMS, using (as our example device) the MOXA MB3170 TCP/RTU gateway.
In this example we are setting up the gateway to be a MODBUS-RTU Slave, meaning that it can be queried as required via an RS485-attached MODBUS-RTU Master (such as a telecommunications site main energy system controller)
(If required, the same gateway can also be used to transfer data the other way (to have the BMS act as a Master and transmit updates to an RTU slave)
Configure Static IP Address
Once the MOXA MB3170 gateway is powered up, it initially responds on a fixed IP address that is printed on the side of the box.
Other brands of gateway may start up initially using DHCP and the initial IP address may be determined by reference to the DHCP lease table on the local network router being used.
For use with the Redflow BMS, reliable operations demand that all elements concerned (the Redflow BMS and the MODBUS gateway, along with any other MODBUS nodes being used) are all configured as follows:
- Set up to run on a known local area network IP address range
- Using Static IP addresses programmed directly into each unit (BMS and all other MODBUS devices)
- Via direct-attach ethernet cables between the devices concerned (this is made simple using the MOXA product line, as each unit contains a two port daisy-chain capable Ethernet switch - so all devices are simply daisy-chain-connected with no separate ethernet switch being required)
Once the starting IP address of the unit has been determined, connect to the unit and use the Network Parameters menu to change the IP address to your intended address for the unit on the local area network (i.e. for the same LAN address range that you are intending to use for the Redflow BMS).
Set the MODBUS operating mode
Incoming RTU commands that reach the MOXA are 'proxied' via the MOXA to the BMS using MODBUS-TCP.
To do this, the MOXA gateway has to be configured to operate as a "Master".
To be clear - in this context the "Master" is the MOXA MB3170 itself, acting in its intermediary role, so that it can pass commands on to the Redflow BMS as downstream TCP "Slave".
For clarity, the full end-to-end data communication path is as follows:
[ Upstream RTU system]---[RS485 cable]---[MOXA Gateway]---[Ethernet cable]----[Downstrea Redflow BMS]
The MB3170 is a 'Slave' as far as the RTU port is concerned. When it receives a command over this port, the MB3170 then acts as a 'Master' over MODBUS-TCP to express the same request to the downstream Redflow BMS over MODBUS-TCP.
The response then travels along the reverse direction of the same connections, to be returned to the Upstream RTU system.
In this example, we are configuring port 1 for this RTU-to-TCP-Master function:
Set the RTU Serial Port parameters
Next, the MB3170 needs to be configured (on port 1) to suit the requirements (baud rate and cable wiring) that are required by the upstream RTU system concerned.
In this example, the upstream system requires 9600 baud communication via a 2-wire RS485 cable:
Configure the MODBUS Routing parameters
The Modbus Routing page sets up 'mappings' between the unit numbers specified by the RTU master, and the unit numbers in use on the slave (in this case, that's the Redflow BMS).
We create a mapping using the 'Add' button on the Modbus Routing page:
We can then review the results, as follows:
In this case we are just configuring a 1:1 mapping, as the unit numbers on the BMS are suitable for direct use by the upstream RTU Master system.
The IP address specified in the 'Add' page needs to be configured to be the IP address you are using for your Redflow BMS (which should also be configured to be a static IP address, to ensure continued long-term communications success).
Post Configuration Testing
Once the configurations are done, and once the BMS and the Moxa are connected and operating on their intended static IP address settings, connectivity can be tested from the upstream RTU Master, via the gateway, to the BMS.
MODBUS information can be retrieved from any of the MODBUS 'Field' values documented in the BMS, using the unit number 201 for the main 'System' MODBUS table in the BMS.
If required, diagnostic / debugging facilities exist in the MB3170, as per the MB3170 manual.
In particular, MOXA provide (on their web site) a downloadable tool called the MGate Manager, which is capable of providing real-time monitoring of MODBUS activity passing through the MODBUS gateway. This can be helpful in diagnosing any issues that may be encountered in achieving successful connectivity from the upstream RTU Master though to the downstream Redflow BMS as the MODBUS-TCP Slave.
It can also be helpful to use a MODBUS-TCP diagnostic tool to talk to the Redflow BMS directly, to ensure that the correct unit and register numbers are behaving as expected on that system.