📡 Industrial Protocols — 2.6
Developer HubModule 2: Industrial Protocols2.6
Hands-on20 min

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:

RegisterTypeDescriptionUnitsScale Factor
40001INT16Active Power SetpointkW1
40002INT16Reactive Power SetpointkVAr1
40003UINT16Max Charge RatekW1
40004UINT16Max Discharge RatekW1
30001INT16AC Active PowerkW1
30002INT16AC Reactive PowerkVAr1
30003UINT16DC Bus VoltageV10
30004INT16DC Bus CurrentA10
30005UINT16State of Charge%100
30006UINT16State of Health%100
30007INT16Battery TemperatureC10
30008UINT16System Statusenum-

Tasks

  1. 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).
  1. 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.
  1. 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.
  1. 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.
  1. 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.

Launch

Log in to track your progress and earn certifications.