System Overview and Use Case
The application requires a low-cost, GSM/GPRS-based energy monitoring node that reads a three-phase Sentron PAC3200 or PAC4200 power monitoring device and forwards the measured values (voltage, current, active/reactive/apparent power, power factor, frequency, energy) to a remote control station. The controller side is a Siemens SIMATIC S7-200 CPU (S7-22x family) which polls the PAC meter over Modbus RTU on RS-485 and exchanges time-stamped data with a SINAUT MD-720-3 GPRS modem on a second RS-485 port. The MD-720-3 forwards the data through a GSM/GPRS link to the SINAUT MICRO SC server software running on a host PC, which exposes the values to a SCADA via an OPC DA interface. Because the S7-22x CPU cannot act as a Profibus-DP master, the PAC meter must be equipped with the Modbus RTU expansion module; the Profibus-DP module is electrically and logically incompatible with this topology.
Required Components and Order Numbers
| Component | Function | Order Number |
|---|---|---|
| S7-200 CPU 224XP DC/DC/DC or CPU 226 | PLC with two RS-485 ports (PPI/MPI/Freeport) | 6ES7214-... or 6ES7226-... |
| Modbus Master RTU library for S7-22x | Modbus RTU master in CPU | 6ES7830-2BC00-0YX0 |
| Sentron PAC3200 power monitoring device | 3-phase meter, class 0.5S | 7KM2112-0BA00-3AA0 (variant dependent) |
| Sentron PAC4200 power monitoring device | 3-phase meter, class 0.2S, harmonics | 7KM4212-0BA00-3AA0 (variant dependent) |
| PAC3200/4200 Modbus RTU expansion module | RS-485 Modbus interface | 7KM9300-0AB00-0AA0 |
| SINAUT MD-720-3 GPRS/GSM modem | Cellular link to control station | 6NH9720-3AA00 |
| SINAUT MICRO SC server software | OPC server and GPRS termination | 6NH9910-0AA10-0AA0 (or current) |
| Quad-band GSM antenna, SMA male | RF connection to MD-720-3 | 6NH9860-1AA00 (typical) |
| STEP 7-Micro/WIN V4.0 SP9 or higher | Programming environment | 6ES7810-2CC03-0YX0 (or current) |
Order numbers reflect catalog entries at the time of writing; confirm current part numbers against Siemens Industry Online Support at support.industry.siemens.com.
Hardware Architecture
The physical layout has two RS-485 segments and one wireless segment. The first segment is the S7-200 CPU Port 0 (Freeport mode) connected to the PAC3200/4200 Modbus expansion module through a shielded twisted-pair cable terminated at both ends. The second segment is the S7-200 CPU Port 1 connected to the SINAUT MD-720-3 modem; the modem supplies its own RS-485 transceiver and isolates the segment from the PAC bus. The third segment is the wireless link: GSM/GPRS from the MD-720-3 antenna to the cellular APN, terminating at the SINAUT MICRO SC server. The control station SCADA connects to the OPC DA interface published by the SINAUT MICRO SC server.
PAC3200 and PAC4200 Communication Interface Selection
Both the PAC3200 and PAC4200 are supplied with a base unit and a slot for one plug-in communication/expansion module. The slot accepts one of three families: a Profibus-DP slave module, a Modbus RTU module, or an Ethernet module. The slot position, DIP switches for the RS-485 bus address, and the termination switch are described in the device manual on Siemens Industry Online Support.
For this topology the PAC must be fitted with the Modbus RTU module (7KM9300-0AB00-0AA0 or current equivalent). The Profibus-DP module must not be used because the S7-200 is a Profibus-DP slave and cannot poll a Profibus-DP slave. The Modbus module exposes the following physical interface:
| Parameter | Value |
|---|---|
| Physical layer | RS-485, 2-wire, half duplex |
| Connector | 9-pin sub-D or plug-in terminal, shield on shell |
| Default baud | 9600 bit/s (configurable 1200 to 115200) |
| Default parity | Even, 1 stop (8E1) |
| Default address | 1 (DIP switches 1-7; switch 8 selects baud) |
| Termination | Internal 120 ohm, switchable |
When the PAC module is the last device on the segment, switch the internal termination ON. Otherwise leave it OFF and provide external 120 ohm terminators at the two physical ends of the bus.
RS-485 Cable Specification and Topology
Use a shielded twisted-pair cable designed for RS-485 or Profibus-DP, for example Siemens Profibus cable 6XV1830-0EH10 (violet sheath) or a Belden 3106A equivalent. The cable must satisfy:
- characteristic impedance 135 to 165 ohm at 3 to 20 MHz
- loop resistance below 110 ohm/km
- shield coverage greater than 60 percent
- route spaced at least 200 mm from VFD output cables; metallic conduit preferred
Connect the cable shield to ground at one point only (typically the S7-200 cabinet ground bus) to prevent ground loops. Use 9-pin sub-D connectors with integral 120-ohm termination for the segment ends. The S7-200 Port 0 pinout is pin 3 = B (Data-), pin 8 = A (Data+), pin 5 = shield/DGND; the PAC Modbus module follows the same convention.
Maximum Cable Length vs. Baud Rate
For RS-485 / Profibus-DP cables, the maximum segment length L in metres as a function of baud rate B (bit/s) is approximated by:
L = 1200 / sqrt(1 + (B / 250)^2)
Sample values for typical baud rates:
| Baud rate (bit/s) | Maximum segment length (m) | Notes |
|---|---|---|
| 1200 | 1200 | Long-run, noisy environments |
| 2400 | 1150 | |
| 4800 | 940 | |
| 9600 | 620 | Default PAC module |
| 19200 | 312 | Recommended for short runs |
| 38400 | 156 | |
| 57600 | 104 | |
| 115200 | 52 | Use only with repeaters |
STEP 7-Micro/WIN Project Configuration
- Create a new project for the target CPU in STEP 7-Micro/WIN. Confirm that the CPU type matches the order number of the physical PLC and that the CPU firmware is 2.0 or higher.
- Open System Block and configure Port 0 for Freeport / Modbus master: baud 9600, parity Even, 8 data bits, 1 stop bit. Port 1 stays in PPI for STEP 7-Micro/WIN online access.
- Allocate a data block (DB) for the polled PAC values; reserve at least 32 words per PAC (16-bit Modbus holding registers).
- Add the Modbus master library 6ES7830-2BC00-0YX0 to the instruction tree. The library adds the subroutines MBUS_CTRL and MBUS_MSG to the project.
- Reserve a second DB for SINAUT MICRO ST7 frames: time-stamped events are typically 32 words long, with up to 32 frames per CPU.
Modbus Master Library Installation and Block Calls
The Modbus master library contains two subroutines that the S7-200 calls cyclically:
- MBUS_CTRL - initialises the port (or re-initialises it) and sets timeout, mode, and parity. Call it once on first scan with Mode = 1 to enable Modbus master; the CPU is then in Modbus master mode and the PPI programming connection is suspended on that port until the CPU is reset to PPI.
- MBUS_MSG - sends a single Modbus request to a slave and waits for the response. Use a state machine to sequence multiple registers because MBUS_MSG is single-shot per call.
The example below polls the PAC3200 holding register that returns line-to-neutral voltage L1 and stores the result in VW200:
Network 1 - first scan, init
SM0.1 --| |-- MBUS_CTRL
Mode := 1 // 1 = Modbus master
Baud := 9600 // match PAC DIP switch
Parity := 0 // 0 = Even
Timeout := 1000 // ms
Done -> V10.0
Error -> VB11
Network 2 - cyclic poll every 200 ms
SM0.5 --| |-- MBUS_MSG
Slave := 1 // PAC address
RW := 0 // 0 = read holding register
Addr := 1 // register 0x0001 (L1-N V)
Count := 1
DataPtr := &VW200
Done -> V20.0
Error -> VB21
Network 3 - state machine, advance to next register
// sequence 1, 3, 5, 13, 15, 17, 25, 27, 29, 31, 57, 65
// done bit V20.0 latches success and triggers
// a pointer increment to fetch the next register
Each MBUS_MSG transaction takes 30 to 80 ms at 9600 baud including turnaround. With 12 registers, one full poll cycle completes in roughly 0.5 to 1.0 s, which is adequate for energy monitoring. If the SCADA requires a faster refresh, raise the baud to 19200 or 38400 and reduce the polled set to only the values required by the application.
PAC3200 and PAC4200 Modbus Register Map
The complete Modbus register map is published in the PAC3200 and PAC4200 device manuals. The S7-200 master polls the holding-register range (function code 0x03). A minimum engineering set is listed below; verify the latest register list from the manual before commissioning because address offsets differ between PAC3200 and PAC4200 firmware versions.
| Description | Unit | Typical PAC3200 address (holding) | Typical PAC4200 address (holding) |
|---|---|---|---|
| Voltage L1-N | V | 0x0001 (1) | 0x0001 (1) |
| Voltage L2-N | V | 0x0003 (3) | 0x0003 (3) |
| Voltage L3-N | V | 0x0005 (5) | 0x0005 (5) |
| Current L1 | A | 0x000D (13) | 0x000D (13) |
| Current L2 | A | 0x000F (15) | 0x000F (15) |
| Current L3 | A | 0x0011 (17) | 0x0011 (17) |
| Active power total (P) | W | 0x0019 (25) | 0x0019 (25) |
| Reactive power total (Q) | var | 0x001B (27) | 0x001B (27) |
| Apparent power total (S) | VA | 0x001D (29) | 0x001D (29) |
| Power factor (PF) | - | 0x001F (31) | 0x001F (31) |
| Frequency | Hz | 0x0039 (57) | 0x0039 (57) |
| Active energy, import | Wh | 0x0041 (65) | 0x015F (351) |
SINAUT MICRO and MD-720-3 GPRS Modem Configuration
The S7-200 transfers its data buffer to the MD-720-3 SINAUT GPRS modem over RS-485 (the modem's RS-485 port is independent from the PAC port). The MD-720-3 opens a GPRS link to the cellular APN and tunnels the data to the SINAUT MICRO SC server, which in turn serves the data to the SCADA via an OPC DA interface.
Configuration steps for the S7-200 + MD-720-3 link:
- Insert a SIM with a public or private APN configured for transparent access. Store the APN name, optional user name, and password in the S7-200 data block that the MD-720-3 reads at startup.
- Configure the MD-720-3 with the SINAUT ST7 configuration tool. Set the destination IP address or DNS hostname of the SINAUT MICRO SC server, the GPRS keep-alive interval (default 60 s), and the TCP port (default 26862).
- Enable the SINAUT ST7 protocol on the S7-200 port wired to the MD-720-3. Use the SINAUT MICRO ST7 library (delivered with SINAUT MICRO SC) for the S7-22x CPU. The library adds put, get, and time-sync subroutines.
- Declare the time-stamped frames the S7-200 will push. For energy monitoring, one frame per minute containing voltage, current, power, and energy is sufficient. The frame buffer must be a contiguous data block of DWORDs or REALs.
- Configure the time synchronisation source. The SINAUT MICRO SC server can act as the time master and push the system time to the S7-200 once per hour; otherwise the CPU time will drift and the SCADA timestamps will be wrong.
SIM Card and Cellular Data Service Requirements
Two services may be required from the GSM provider depending on the project scope:
- GPRS data - a standard M2M APN with public or private IP routing to the SINAUT MICRO SC server. A static IP on the S7-200 side is not required because the S7-200 always initiates the connection outbound.
- CSD (Circuit Switched Data) - legacy dial-up data service used for remote programming of the S7-200 over the same MD-720-3 modem. Confirm with the provider that the SIM and the rate plan still allow CSD; some providers have retired CSD on 3G and 4G networks.
Data Transfer to the Control Station
The SINAUT MICRO SC server runs on a Windows host with a static public IP or a fixed DNS name. The server accepts incoming GPRS connections from MD-720-3 modems, logs the time-stamped values to an internal database, and publishes them through the OPC DA 2.0/3.0 interface. The control station SCADA connects to the OPC server using any OPC client (WinCC, iFIX, Citect, or a custom HMI). Tag names are mapped 1:1 to the S7-200 data block addresses defined in the SINAUT ST7 configuration.
Throughput is governed by the GPRS link. A typical GPRS connection sustains 30 to 50 kbit/s; each SINAUT ST7 frame (32 words plus overhead) is roughly 100 bytes, so the practical update rate is 5 to 10 frames per second per modem, which is well above the 1 frame per minute that energy monitoring requires.
Optional PCS 7 PAC Library Integration (PAC_DIA Block)
For projects that integrate the PAC data into a SIMATIC PCS 7 control system, Siemens provides the Advanced Process Library PAC3200 & PAC4200 for SIMATIC PCS 7 (see P7PAC12B Advanced Process Library for PAC3200/PAC4200). The library supplies the PAC_DIA block that performs diagnosis of the PAC3200 and PAC4200 from the PCS 7 maintenance station, exposing the same values via the PCS 7 OS faceplates. The PAC_DIA block monitors the Modbus connection and the diagnostic registers of the PAC meter and raises PCS 7 maintenance messages on loss of communication. The block can be connected to a WinCC faceplate that mimics the PAC front-panel display, giving operators voltage, current, power factor, and energy at a glance.
Note that the P7PAC12B library is intended for PCS 7 AS stations, not for the S7-200 / SINAUT MICRO path. The two integration routes are independent.
Verification and Acceptance Test Procedure
- Apply 24 V DC to the S7-200 CPU and to the MD-720-3. Confirm the green power LED on the CPU and the green link LED on the MD-720-3.
- Connect STEP 7-Micro/WIN to Port 1 of the CPU and download the project. Open the status chart and force MBUS_CTRL Mode = 1.
- Verify with the Modbus master that the Done bit cycles and the Error code is zero. The PAC values appear in VW200 to VW230 within 1 s.
- Connect a Modbus service tool (for example SST MODBUS or the PAC configuration software) to the PAC meter and confirm that the meter is replying on the configured address and baud rate.
- Power up the SINAUT MICRO SC server and check that the MD-720-3 establishes a GPRS link. The link LED turns solid and the server shows the S7-200 in the connected devices list.
- Force a value in the S7-200 data block and confirm the change is visible in the OPC client within the configured refresh interval (typically 30 s to 1 min).
- Record the RSSI (signal strength) reported by the MD-720-3. Plan the antenna location so that RSSI is greater than -85 dBm; below -95 dBm the GPRS link will be unreliable.
- Disconnect the RS-485 cable to the PAC meter and confirm that the SCADA receives a "loss of communication" alarm within 60 s, validating the diagnostic path.
Troubleshooting Matrix
| Symptom | Probable cause | Check / fix |
|---|---|---|
| MBUS_CTRL error code 1 | Invalid parity or baud selected | Match PAC module DIP switches; default 8E1 / 9600 |
| MBUS_CTRL error code 2 | Mode out of range | Set Mode = 1 to enable Modbus master |
| MBUS_MSG error code 1 | Parity mismatch | Verify PAC parity setting |
| MBUS_MSG error code 2 | Slave did not respond, timeout | Check A/B polarity, shield, termination, address DIP |
| MBUS_MSG error code 3 | CRC error, line noise | Re-route cable, lower baud, add repeater |
| MBUS_MSG error code 5 | Modbus library not installed | Reinstall 6ES7830-2BC00-0YX0 |
| Modbus values read as zero | Wrong register address or byte order | Confirm Modbus address in PAC manual, swap bytes if needed |
| Voltage / power values 10x too high | Scale factor not applied | Apply 0.1 or 0.01 divisor in the S7-200 ladder |
| Float values from PAC4200 corrupt | Byte order wrong | Swap high and low word of the 32-bit register pair |
| MD-720-3 link LED off | SIM not detected, antenna disconnected, APN wrong | Check SIM insertion, antenna RSSI, APN in S7-200 data block |
| GPRS link drops every few minutes | Keep-alive interval too long, low signal | Reduce keep-alive to 30 s, raise antenna, use directional antenna |
| OPC server shows no data | Firewall blocks incoming TCP 26862 | Open TCP 26862 inbound on the SC server |
| SCADA gets old timestamps | Time sync not set on S7-200 | Configure SINAUT time synchronisation from server |
| CPU goes STOP after MBUS_CTRL | Port 0 reserved for PPI programming | Move Modbus master to Port 1 if available, or use a free-port-capable CPU |
FAQ
Can the S7-200 read the PAC3200 Profibus-DP module with the SINAUT MICRO?
No. The S7-22x CPU is a Profibus-DP slave only; it cannot poll a Profibus-DP slave. Use the PAC Modbus RTU expansion module (7KM9300-0AB00-0AA0) and the Modbus master library 6ES7830-2BC00-0YX0 instead.
Which Modbus library order number is required for the S7-200?
The Modbus master library for the S7-22x family is order number 6ES7830-2BC00-0YX0. It is installed in STEP 7-Micro/WIN and adds the MBUS_CTRL and MBUS_MSG subroutines that the CPU calls to poll a Modbus slave.
What baud rate should be used for the PAC RS-485 link?
Default is 9600 bit/s with even parity and one stop bit (8E1). Maximum cable length at 9600 bit/s using L = 1200 / sqrt(1 + (B/250)^2) is approximately 620 m; derate to 500 m in industrial installations to allow for connector and patch-panel losses.
Does the MD-720-3 support CSD data calls for remote programming?
Yes, the MD-720-3 supports CSD on GSM 2G networks. Confirm with the cellular provider that the rate plan and the local 2G network still carry CSD; many providers have retired 3G/4G CSD, so new deployments should plan for GPRS-only access.
Is the P7PAC12B PCS 7 library compatible with the S7-200 + SINAUT MICRO path?
P7PAC12B is a SIMATIC PCS 7 library for PAC3200 and PAC4200 that includes the PAC_DIA diagnostics block. It is intended for PCS 7 AS stations, not the S7-200 / SINAUT MICRO path. For S7-200 + SINAUT MICRO, use the OPC DA interface of the SINAUT MICRO SC server.