Overview
Connecting a National Instruments Compact FieldPoint (cFP) backplane to a Siemens S7 or S5 programmable logic controller (PLC) over Profibus or MPI is a common integration challenge in mixed-vendor supervisory, control, and data acquisition (SCADA) systems. The cFP family provides deterministic, ruggedized analog and digital I/O modules controlled by a LabVIEW Real-Time field-programmable controller (FPC), but the controller does not include a native Profibus DP slave or MPI interface. All Profibus/MPI traffic must therefore be terminated by a protocol gateway, an embedded PC running Siemens Prodave, or a Modbus-capable bridge that proxies the S7 data into a transport the cFP can consume (typically TCP/IP, Modbus/TCP, or RS-232/485).
This reference documents the three field-proven topologies for joining a cFP chassis to a Siemens S7-300, S7-400, S7-200 (with EM 277), or S7-1200/1500 controller. Each topology is mapped to a firmware and software stack, a list of compatible gateways with catalog numbers, an addressing and tag map, and a step-by-step commissioning procedure. A troubleshooting matrix closes the article with symptom-to-cause mappings based on field experience.
Protocol Foundation: MPI vs Profibus DP
Selecting the correct gateway depends first on which Siemens protocol the target PLC exposes. MPI and Profibus DP share the same EIA-485 physical layer (RS-485, 9.6 kbit/s to 12 Mbit/s) and the same Siemens proprietary frame format on top of Profibus FDL, but they differ in addressing, master arbitration, and accessible data areas.
| Attribute | MPI (Multi-Point Interface) | Profibus DP (Class 1) |
|---|---|---|
| Physical layer | RS-485, isolated, 9.6 kbit/s to 187.5 kbit/s typical, 12 Mbit/s max | RS-485, isolated, 9.6 kbit/s to 12 Mbit/s |
| Topology | Bus, max 32 nodes, 50 m segment at 187.5 kbit/s | Bus, max 32 nodes (126 with repeaters), up to 1.2 km with fiber |
| Cable | Profibus purple cable, 2-wire, shielded, 150 Ω nominal | Profibus purple cable, identical |
| Connector | 9-pin Sub-D (Profibus standard) | 9-pin Sub-D (Profibus standard) |
| Master arbitration | Token passing among MPI masters (PG/PC, OP, CPU, FMs/CPs) | Single DP Class-1 master; multi-master requires Class-2 |
| Slave address range | 0 to 31 (MPI default: master 0, CPU 2) | 1 to 125 (0 reserved for service) |
| Default baud | 187.5 kbit/s (S7-300/400) | 1.5 Mbit/s (negotiated by master) |
| Cyclic I/O model | Not defined; only acyclic read/write via S7 functions | Yes - DP-V0 cyclic I/O, DP-V1 acyclic, DP-V2 isochronous |
| Accessible data | Inputs (PE), Outputs (PA), Merkers (M), Data Blocks (DB), Timers/Counters (T/C) | Same; restricted to process image and configured slot mapping |
| Typical CPU targets | S7-300/400, S7-200 (PPI not MPI), S7-1200/1500 (no native MPI) | S7-300/400 with CP 342-5/443-5, S7-200 with EM 277, ET 200 slaves, S7-1200/1500 with CM 1542-5 |
For cFP integration, MPI is almost always the simpler choice when the target CPU is a S7-300 or S7-400 with its onboard MPI/DP port set to MPI mode. Profibus DP is preferred when the PLC is configured as a DP slave and you are using a CP 342-5/443-5 master or a third-party gateway acting as DP Class-1 master.
Hardware Gateway Architectures
Three reference architectures are widely used in the field. Each has different latency, deterministic, and cost characteristics.
Architecture A: MPI/Ethernet Gateway
An MPI-to-Ethernet gateway terminates the Profibus cable and presents the S7 data over TCP/IP. The cFP FPC runs LabVIEW Real-Time and exchanges S7 protocol frames (wrapped in a vendor-proprietary ASCII or binary protocol) with the gateway over a standard Ethernet socket. The gateway handles token passing on the MPI bus, freeing the cFP from real-time Profibus constraints.
Architecture B: Profibus DP Master with Modbus/TCP Bridge
A standalone DP Class-1 master (Siemens ET 200S IM 151, Helmholz, or Anybus X-gateway) scans Profibus slaves and exposes the cyclic I/O image to a Modbus/TCP server. The cFP reads the data using the LabVIEW Modbus library or the Modbus I/O Server. This topology is preferred when the cFP must coexist with Siemens HMI panels and a Siemens PG/PC on the same Profibus segment.
Architecture C: PC-Hosted Prodave MPI
An industrial PC (IPC) on the same MPI segment uses the Siemens Prodave MPI/TCP DLL to read/write S7 data blocks, then forwards the values to the cFP via a custom TCP socket or by writing to a shared file/NFS mount. Prodave is a Windows-only API and cannot be loaded on the cFP FPC itself; therefore, Architecture C requires the cFP to treat the IPC as a data concentrator.
IBHsoftec IBH Link S7/MPI Gateway Configuration
The IBHsoftec IBH Link (formerly IBH Link S7/MPI) is the most commonly deployed gateway in cFP-Siemens integrations. It supports MPI 9.6 kbit/s to 12 Mbit/s, Profibus DP, and S7-TCP, exposes its services on TCP port 1099, and includes a built-in web configuration interface.
Catalog numbers and variants
| Model | Catalog / order code | MPI / DP | Ethernet | Notes |
|---|---|---|---|---|
| IBH Link S7/MPI | IBH-LINK-S7-MPI | Yes / No | 10/100 | Legacy, 187.5 kbit/s only |
| IBH Link S7-Profibus | IBH-LINK-S7-PB | Yes / Yes | 10/100 | DP Class-1 master capable |
| IBH Link S7-TCP | IBH-LINK-S7-TCP | n/a | 10/100 | Pure S7-TCP/IP, no RS-485 |
| IBHsoftec NetLink PRO | IBH-NL-PRO | Yes / Yes | 10/100/1000 | Current production model |
Step-by-step configuration
- Connect a PG/PC to the IBH Link's service port or to the same Ethernet subnet. Browse to
http://192.168.1.100(default). The default credentials areadmin / adminon firmware 4.x and later. - Open Configuration > MPI/DP. Set the baud rate to
187.5 kbit/sfor S7-300/400 MPI or1.5 Mbit/sfor Profibus DP. Set the highest station address (HSA) to31for MPI or126for DP. - Set the IBH Link's MPI/DP address to
0(master). For DP, the address must be unique on the segment; the CPU's MPI/DP port can be set to MPI at address2simultaneously if the PLC is in MPI/DP combined mode and the routing is enabled in STEP 7 / TIA Portal. - Under Configuration > S7 Connections, define one or more S7 connections. Specify the target PLC's MPI/DP address, the rack and slot (typically rack 0, slot 2 for S7-300), and the connection resource (local TSAP
01.01, remote TSAP02.01for an S7-300). - Open Configuration > Ethernet. Assign a static IP (e.g.,
192.168.1.100), subnet mask, and gateway. Disable DHCP for deterministic behavior on the cFP side. - Save and reboot. After reboot, verify with the built-in Diagnostics > S7 Status page. The PLC must show
Connectedwith a green status icon. If the status showsTimeout, double-check the PROFIBUS termination (both ends, 220 Ω, switch on), the cable shield bonding, and the baud-rate match. - From the cFP FPC, open a TCP socket to port
1099and issue a S7 read request, or use the IBHsoftec OPC server on a host PC and re-publish the data through the cFP via Modbus/TCP.
Verification
After the IBH Link shows Connected, send a test read from the cFP using the S7 function code 0x04 (Read Input) or the IBHsoftec S7-LAN protocol wrapper. A successful read returns the S7 data area content within 50-200 ms at 187.5 kbit/s for a 4-byte read. The cFP FPC should log a non-zero response and a status word of 0x0000.
Prodave MPI/TCP Integration (Architecture C)
Prodave is the only Siemens-supplied API that can drive an MPI port from user code without STEP 7 installed. It is licensed separately and ships as a set of DLLs and a small toolbox of ActiveX controls.
Prodave product matrix
| Prodave version | Supported PLCs | Bus | OS support | Notes |
|---|---|---|---|---|
| Prodave MPI/TCP V5.6 | S7-200/300/400 | MPI, PPI, Profibus, TCP | Windows XP/7/10 (x86) | Legacy; uses 32-bit DLL only |
| Prodave MPI/TCP V6.0 | S7-200/300/400/1200/1500 | MPI, Profibus, TCP | Windows 7/10/11 (x86, x64) | Replaces Toolbox; supports S7-1200/1500 PUT/GET |
| Prodave MPI/TCP V7.0 | S7-200/300/400/1200/1500 | MPI, Profibus, TCP, OPC UA bridge | Windows 10/11 (x64) | Latest; OPC UA server included |
Reading a data block with Prodave
The C-style API exposes a small surface. The most common read path is:
// Pseudo-code, simplified from Prodave MPI/TCP V6.0 header
#include <Prodave6.h>
unsigned char buffer[256];
int handle = -1;
int res;
// 1. Load the toolbox
res = ProDaveInit("S7ONLINE");
// 2. Open a connection to the PLC at MPI address 2
res = ProDaveConnect("MPI:2", &handle);
// 3. Read 16 bytes from DB1 starting at byte 0
res = ProDaveReadDataBlock(handle, 1, 0, 16, buffer);
// 4. Forward to cFP over TCP
sendto(cfp_socket, buffer, 16, 0, cfp_addr, cfp_port);
// 5. Close and unload
ProDaveDisconnect(handle);
ProDaveExit();
The IPC must have a CP 5611 / CP 5612 / CP 5621 Profibus card installed and configured with the Set PG/PC Interface tool. STEP 7 or at least the Simatic Net PC software is required to install the Profibus driver stack.
Modbus Gateway Bridge Architecture
Modbus is the lowest-common-denominator protocol between the cFP and a Siemens gateway. Two configurations are common:
Modbus/TCP to Profibus gateway (vendor examples)
| Vendor | Model | Catalog number | Profibus role | Modbus role |
|---|---|---|---|---|
| HMS Industrial Networks | Anybus X-gateway Profibus-MODBUS/TCP | AB7630-F | DP Class-1 master or slave | Modbus/TCP server (502) |
| Helmholz | DP-Master Modbus/TCP | 700-752-12S21 | DP Class-1 master | Modbus/TCP server (502) |
| Prosoft Technology | PTQ-PDPMV1 | PTQ-PDPMV1 | DP-V1 master with acyclic | Modbus/TCP server (502) |
| Woodhead (SST) | DN-PCI/DP | SST-DN-PCI-xxxx | DP Class-1 master (PCI card) | Custom DLL on host |
Modbus mapping example
Configure the gateway to map a S7 data block of 32 bytes into 16 Modbus holding registers (each register = 2 bytes, big-endian or little-endian depending on gateway). A typical mapping for reading a S7-300 DB100 holding recipe parameters:
| Modbus address | Function code | S7 source | Data type | Scale |
|---|---|---|---|---|
| 40001 | FC 3 (Read Holding) | DB100.DBD0 | REAL (32-bit float) | ×1.0, °C |
| 40003 | FC 3 | DB100.DBD4 | REAL | ×1.0, kPa |
| 40005 | FC 3 | DB100.DBD8 | DINT | ×1.0, count |
| 40007 | FC 3 | DB100.DBW12 | INT | ×1.0, setpoint |
| 40008 | FC 16 (Write Multiple) | DB100.DBW14 | INT | Command word |
| 00001 | FC 2 (Read Input) | PEW0 / PEW2 | 16-bit status | Bit-packed digital |
LabVIEW Shared Variable Engine and Modbus I/O Server
Starting with LabVIEW 8.0, NI introduced the Shared Variable Engine (SVE), a publish/subscribe data service that exposes LabVIEW front-panel indicators and controls over TCP/IP. The SVE also supports a built-in Modbus I/O server, eliminating the need for the standalone Modbus library on the cFP FPC.
Configuring the Modbus I/O Server on a Windows host (publisher)
- Install the NI Modbus Library and the DSC Module (or LabVIEW Real-Time Module with SVE) on the host PC. The cFP target itself does not need the DSC Module if it consumes the variables directly.
- In NI MAX > Tools > Real-Time > Variable Manager, or in LabVIEW Project Explorer, right-click My Computer and select New > I/O Server.
- Select Modbus as the protocol, choose Modbus/TCP as the transport, and enter the gateway's IP address (e.g.,
192.168.1.30) and the unit ID (default1). - Define one Modbus register per shared variable. For each variable, specify the address (e.g.,
40001), function code, and update rate. A 100 ms poll is typical for non-critical data; use 20 ms only for tight control loops. - Click Deploy. The SVE begins polling the gateway immediately.
Consuming shared variables on the cFP FPC
On the cFP FPC, the Shared Variable Engine on the real-time target subscribes to the published variables. From LabVIEW Real-Time, use a Shared Variable node bound to a network-published variable. Read/write semantics are baked into the SVE; the application code does not need to implement Modbus framing.
// Shared variable binding example (textual representation)
// Variable name: SV_DB100_Temp
// Data type: Single (REAL, 32-bit)
// Source URL: //host-pc/My Computer/ModbusLib/DB100_Temp
// Update rate: 100 ms
// Access: Read/Write
Read/Write library fallback (LabVIEW 7.1)
On older cFP targets that ship with LabVIEW Real-Time 7.1, the SVE-based Modbus I/O server is not available. Use the Modbus Library VIs (NI Modbus Library 1.2.x) directly: MB Open Connection.vi, MB Read Holding Registers.vi, MB Write Multiple Registers.vi, and MB Close Connection.vi. The library is available free of charge and runs on all LabVIEW Real-Time targets including the cFP-2020/2120/2220/2240.
Network Topology and IP/MPI Addressing
A complete address plan is mandatory before commissioning. The following is a worked example for a single-SKU production cell with one S7-300, one IBH Link, and one cFP-2220.
| Device | Profibus address | IP address | Subnet | Port / TSAP | Role |
|---|---|---|---|---|---|
| S7-300 CPU 315-2 DP | MPI 2 | n/a | n/a | TSAP 02.01 | Data source |
| ET 200S slave #1 | DP 3 | n/a | n/a | n/a | DP slave (I/O) |
| ET 200S slave #2 | DP 4 | n/a | n/a | n/a | DP slave (I/O) |
| IBH Link S7-Profibus | DP 0 (master) | 192.168.1.100 | /24 | TCP 1099 | Gateway |
| Siemens MP 277 HMI | MPI 1 | 192.168.1.50 | /24 | TSAP 01.01 | HMI (existing) |
| PG/PC (commissioning) | MPI 0 (temporary) | 192.168.1.10 | /24 | n/a | Service laptop |
| cFP-2220 FPC | n/a | 192.168.1.40 | /24 | TCP 502 (Modbus) | Data consumer |
| Industrial PC (Prodave) | n/a | 192.168.1.20 | /24 | CP 5621 MPI 0 | Optional, Arch. C |
Subnet mask 255.255.255.0; default gateway 192.168.1.1 (managed switch). Profibus cable must be terminated at both ends with the bus terminator switch on the connector in the ON position (220 Ω between pins 3 and 8, plus 390 Ω pull-up/down on data lines). Pinout for the 9-pin Sub-D Profibus connector: pin 1 shield, pin 3 RxD/TxD-P (B line, red), pin 5 DGND, pin 6 VP (+5 V), pin 8 RxD/TxD-N (A line, green).
Programming the cFP Logic
The cFP field-programmable controller runs a LabVIEW Real-Time VI. A typical scan cycle is implemented as a flat sequence with a deterministic loop.
-
Initialize: open the TCP socket to the gateway (port 1099) or the Modbus/TCP connection. The SVE does this automatically when the variable is bound; for direct TCP, use TCP Open Connection.vi with
192.168.1.100:1099. - Read: issue a S7 read for the configured data block. For the IBH Link, send the IBH S7-LAN read request frame:
// IBH S7-LAN read request frame (16 bytes header + payload)
// 0x00 0x00 0x00 0x11 - Length (17 bytes follow)
// 0x00 0x00 - Reserved
// 0x00 0x00 - Function group
// 0x00 0x00 0x00 0x01 - Function: Read Var
// 0x00 - Item count: 1
// 0x12 0x0A 0x10 0x01 - Item: Var specification (S7ANY)
// 0x00 0x0E - Length of following
// 0x00 0x10 - Syntax ID: S7ANY
// 0x00 0x00 - Transport size: BYTE
// 0x00 0x00 - Count: 16 (bytes to read)
// 0x00 0x00 0x00 0x01 0x84 - DB number 1, area DB (0x84)
// 0x00 0x00 0x00 0x00 - Byte offset 0
- Process: parse the response payload, convert S7 REAL to LabVIEW Single, apply engineering-unit scaling, and write the result to a shared variable or a cFP analog-output module.
-
Write (optional): issue an S7 write to command setpoints back to the PLC. Use the same framing with function code
0x00000005(Write Var). - Close: on shutdown, close the socket and the Modbus connection gracefully to avoid leaving the gateway with a half-open TCP state.
For deterministic execution, place the entire read/process/write block inside a Timed Loop with period 100 ms and priority 3. Use the Wait Until Next ms Multiple primitive to align the loop with the Profibus baud tick.
Diagnostics and Troubleshooting Matrix
| Symptom | Likely root cause | First check | Remediation |
|---|---|---|---|
| S7 status "Timeout" on gateway web UI | Wrong baud rate, missing termination, or PLC in STOP | CPU display, bus terminator switches, baud match | Set baud to 187.5 kbit/s, enable terminators at both ends, restart CPU |
Read returns 0xFFFF on every byte |
TSAP mismatch (rack/slot) | STEP 7 hardware config: CPU slot | Set local TSAP 01.01, remote TSAP 02.01 (S7-300 in slot 2) |
| Intermittent connection drops every 30-60 s | Keep-alive timer on gateway shorter than cFP poll | Gateway S7 Timeout setting (default 30 s) | Set cFP poll to ≤ 5 s, or raise gateway timeout to ≥ 120 s |
Prodave ProDaveConnect returns error 803 |
STEP 7 / Simatic Net not installed, or wrong interface in Set PG/PC Interface | Control Panel > Set PG/PC Interface | Install Simatic Net, select the CP 5621 MPI interface |
| Modbus I/O server shows "Cannot connect to device" | Unit ID mismatch or TCP port blocked by Windows Firewall | Telnet to gateway port 502; check Windows Firewall log | Set unit ID = 1 (default), open inbound TCP 502 or add firewall rule |
| Data updates lag by several seconds | Shared Variable Engine configured for "Snapshot" instead of "Real-Time" | LabVIEW Project > Variable Properties > Buffering | Set buffering to "Real-Time" with on-demand or 1-element buffer |
| CPU enters STOP after cFP write | Write target is read-only or out of range; OB121 not loaded | STEP 7 diagnostic buffer (PLC > Diagnostic Buffer) | Load OB121 in the S7 project, or correct the DB number / offset |
| Random byte corruption on RS-485 | EMI from VFD, missing shield bond, or stub length > 1 m | Check shield termination at cabinet entry; oscilloscope eye pattern | Use fiber-optic Profibus OLM, bond shield at one end only, shorten stubs |
Modbus Illegal Data Address
|
Address base mismatch (0-based vs 1-based) | Gateway Modbus register table | Add +1 to address: gateway 40001 = Modbus address 0 in holding register space |
Commissioning Checklist
- Verify all Profibus cable shields are bonded at the cabinet entry to a clean ground bar. The shield must be continuous; do not break the shield at the connector.
- Enable bus terminator switches on the first and last device on the segment. Disable on all intermediate devices.
- Set unique MPI/DP addresses. Document the address plan on the cabinet door.
- Confirm baud-rate match across all devices. Use STEP 7 PG/PC Interface > Diagnostics to read the bus statistics: bus errors should be 0, repeat count 0.
- Power up the gateway, browse to its web UI, and confirm the S7 connection is
Connected. - From the cFP FPC, perform a single read of 16 bytes from DB1, offset 0. Confirm the value matches a known constant in the PLC (e.g., a recipe header magic number).
- Trigger a write of a 16-bit command word and confirm the PLC sets the corresponding bit in the diagnostic buffer.
- Run the loop for 24 h with diagnostic logging enabled. Monitor the gateway's Uptime counter and the cFP's Connection Error shared variable. Both should remain zero.
- Document the configuration (IP, baud, addresses, register map) in a PDF and store on the project server.
Field-Proven Caveats
-
S7-1200/1500 PUT/GET protection: Starting with TIA Portal V14, Siemens enables Permit access with PUT/GET from remote partner only on explicit configuration. Without this, the IBH Link's S7 connection succeeds but reads return
0x00. Enable in Device Configuration > Properties > Protection > Connection Mechanisms. - CP 343-1 Lean does not support S7 communication as a server: It is an exclusive client. Use CP 343-1 Advanced or onboard PN for server-side S7 access.
- Prodave floating-point conversion: Prodave returns S7 REAL as four bytes in big-endian, byte-swapped per word. S7 stores REAL in big-endian (DBD0 = bytes 0,1,2,3). On x86 the LabVIEW type cast to Single must use Swap Bytes or Swap Words depending on the data type.
- Watchdog on cFP-2020: The cFP-2020 FPC has a single-core 200 MHz Geode and no hardware FPU. Running S7 protocol parsing plus Modbus polling at < 50 ms can starve the loop. Use a cFP-2220 or cFP-2240 for sub-50 ms loops.
-
Firewall on Windows Server 2019+: The default Windows Defender firewall blocks inbound TCP 502. The Modbus I/O server will report
Device not respondingeven when the gateway is reachable. Add an explicit inbound rule for%ProgramFiles%\National Instruments\Shared\Tagger\tagger.exe.
Can a cFP controller act as a Profibus DP slave without an external gateway?
No. The cFP-2020/2120/2220/2240 FPCs have no native Profibus interface, and LabVIEW Real-Time on the cFP target does not include a Profibus stack. A third-party gateway (IBH Link, Anybus X-gateway, Helmholz) or a PC-hosted Prodave bridge is mandatory for any Profibus DP integration.
What is the typical end-to-end latency from S7 input to cFP shared variable?
At 187.5 kbit/s MPI, a 32-byte read takes 80-150 ms. Add 10-30 ms for the IBH Link processing, 5-20 ms for the cFP TCP stack, and 0-100 ms for the Shared Variable Engine buffering (default). Total: 100-300 ms under steady-state conditions. Use a 100 ms or shorter poll for closed-loop control and 1 s or longer for trending.
Is Prodave MPI supported on Windows 11 or on 64-bit LabVIEW?
Prodave MPI/TCP V7.0 supports Windows 10/11 x64. Earlier versions (V5.6, V6.0) are x86 only and require a 32-bit LabVIEW process; calling them from a 64-bit LabVIEW VI fails with a Call Library Function Node error. If you must run 64-bit LabVIEW, use V7.0 or migrate to the Modbus I/O server via a gateway.
Do I need a license for the LabVIEW Modbus library on the cFP target?
The LabVIEW Modbus Library (1.2.x) is free of charge and runs on any LabVIEW Real-Time target, including the cFP-2020/2120/2220/2240. The library VIs are redistributable in compiled applications. No NI license is required to deploy.
Can I read and write S7-1500 data blocks with this stack?
Yes, with two prerequisites. First, enable PUT/GET access from remote partner in the S7-1500 device configuration. Second, use the IBH Link firmware 6.0 or later (S7-1500 optimized block access requires the latest gateway firmware). Prodave MPI/TCP V6.0 or V7.0 also supports the S7-1500 PUT/GET mechanism when configured for S7-TCP rather than MPI.