Hands-on: Read a Battery via Modbus TCP
📡 Module 2: Industrial Protocols
Hands-on: Read a Battery via Modbus TCP
In this hands-on exercise, you will connect to a simulated battery energy storage system (BESS) using Modbus TCP and read its operational parameters.
Exercise Overview
The EnergyAtIt simulator provides a virtual 10 MW / 40 MWh lithium-ion battery system with a full Modbus TCP register map. You will use the Protocol Inspector in the live dashboard to read registers, interpret data types, and understand the relationship between raw register values and engineering units.
Register Map
The simulated BESS exposes the following Modbus registers:
| Register | Type | Description | Units | Scale Factor |
|---|---|---|---|---|
| 40001 | INT16 | Active Power Setpoint | kW | 1 |
| 40002 | INT16 | Reactive Power Setpoint | kVAr | 1 |
| 40003 | UINT16 | Max Charge Rate | kW | 1 |
| 40004 | UINT16 | Max Discharge Rate | kW | 1 |
| 30001 | INT16 | AC Active Power | kW | 1 |
| 30002 | INT16 | AC Reactive Power | kVAr | 1 |
| 30003 | UINT16 | DC Bus Voltage | V | 10 |
| 30004 | INT16 | DC Bus Current | A | 10 |
| 30005 | UINT16 | State of Charge | % | 100 |
| 30006 | UINT16 | State of Health | % | 100 |
| 30007 | INT16 | Battery Temperature | C | 10 |
| 30008 | UINT16 | System Status | enum | - |
Tasks
- Read all input registers (30001-30008). Use FC 04 to read the battery's current state. Note the SOC, temperature, and power output. Apply the scale factors to convert raw values to engineering units (e.g., a raw value of 8530 in register 30005 means 85.30% SOC).
- Write a power setpoint. Use FC 06 to write to register 40001. Set the battery to charge at -5000 kW (negative = charging). Observe how the input registers change over the next 30 seconds as the battery begins charging.
- Monitor SOC over time. Poll register 30005 at 1-second intervals for 5 minutes. Watch how SOC changes as the battery charges. Calculate the charge rate in MWh and verify it matches the setpoint.
- Test limits. Try writing a setpoint that exceeds the max charge/discharge rate. Observe how the BESS clamps the actual power to its rated maximum. Check register 30008 for status flags.
- Read 32-bit float values. Some advanced registers use FLOAT32 encoding across two consecutive registers. Practice reading registers 30003-30004 together and interpreting them as a 32-bit big-endian float.
What You Will Learn
- Practical Modbus TCP register reading and writing
- Data type interpretation (INT16, UINT16, FLOAT32) and scale factors
- The relationship between setpoints and measured values
- BESS operational characteristics (ramp rates, SOC dynamics)
This exercise uses the Grid Simulator. Click the Launch button below to open the Battery Modbus Lab.
Open Hands-on Lab
Complete the exercise in the live dashboard.
Log in to track your progress and earn certifications.