Configuring Omron CS1G PRT21 Profibus Slave: DM Mapping Guide

James Nishida13 min read
OmronProfibusTutorial / How-to
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

Overview

The Omron CS1W-PRT21 is a PROFIBUS-DP slave interface module designed to mount on a CS1G or CS1H PLC backplane as a Special I/O Unit. Once registered, the module exchanges process data cyclically with a PROFIBUS master (typically a Siemens S7 PLC with a CP342-5 or CPU integrated DP port) over a shielded twisted-pair PROFIBUS cable terminated per IEC 61158 / EN 50170. From the CS1 application program, the data appears as plain DM (Data Memory) words; the PRT21 handles the PROFIBUS stack, token handling, and FDL services transparently.

This reference covers three layers of work that must all be correct before the green BF (Bus Fault) LED stays off and the RDY (Ready) LED comes on:

  1. CPU-side DM configuration words in the Special I/O DM area (D20100-D20107 for unit #1).
  2. I/O table registration of the PRT21 in CX-Programmer with the correct machine number.
  3. Master-side configuration using the Omron GSD file in the Siemens HW Config (or any DP master configurator).
The single most common cause of an I/O Verification Error with a freshly inserted PRT21 is that the DM configuration area contains the default zeros (or stale data) when the module powers up. The PRT21 reads its allocation the first time it initialises after a backplane reset, so the values must be present in D20100-D20107 before the CPU completes its first I/O refresh. A MOV on the first scan flag is too late on a cold start - the DM values must already be retentive.

Hardware Identification and Prerequisites

Confirm the exact module variant before configuring - the CS1 family supports two PROFIBUS interfaces and they are not interchangeable:

Catalog Number Function Mounting Backplane I/O Words
CS1W-PRT21 PROFIBUS-DP Slave (12 Mbit/s) Special I/O Unit slot 10 CIO + 100 DM per unit
CS1W-PRM21 PROFIBUS-DP Master Special I/O Unit slot 10 CIO + 100 DM per unit
CS1W-SCU21 Serial Communications Unit (Modbus / Host Link) Special I/O Unit slot 10 CIO + 100 DM per unit

The PRT21 is a slave only; it cannot be configured as a PROFIBUS master. Maximum PROFIBUS segment length depends on baud rate per the standard:

Baud Rate Max Segment Length (m) Max Stations per Segment
9.6 kbps 1,200 32
187.5 kbps 1,000 32
1.5 Mbps 200 32
3 Mbps 100 32
6 Mbps 100 32
12 Mbps 100 32

Prerequisites for the configuration procedure below:

  • CS1G-CPUxx or CS1H-CPUxx with firmware supporting Special I/O Units.
  • CX-Programmer v9.x or later, installed with the CX-Profibus configuration tool component.
  • CX-Profibus v1.x Operation Manual from Omron eData (W05E-EN-02).
  • PRT21 GSD file (OMT_0F70.GSD or equivalent) imported into the master configuration tool.
  • PROFIBUS cable with 9-pin D-sub connectors and bus termination resistors enabled on the two physical end nodes only.

CS1 Special I/O DM Allocation for the PRT21

CS1 Special I/O Units (machine number 0 to 95) are allocated a fixed DM window of 100 words each. The window base is computed as:

DM_Base = D20000 + (100 × Unit_Number)

For a PRT21 mounted in Unit #1 (the first Special I/O slot; machine number shown as M/C1 / 2010 in the I/O table):

  • DM allocation window: D20100 - D20199 (100 words).
  • CIO allocation: CIO 2010 - CIO 2019 (10 words; the unit's operational bits and status flags).

Only the first 8 words of the DM window are meaningful for the PRT21. The remainder (D20108-D20199) is reserved and must be left at zero unless you are using the Optional Area for diagnostic data.

PRT21 DM Configuration Word Map

The PRT21 reads the following eight words from its DM window during initialisation. All values are unsigned 16-bit BCD or hex as noted; CPU should be set to binary mode (most CS1G/H default) when writing with MOV.

DM Address Function Allowed Values Description
D20100 Input Mapping Mode 0000 or 0001 0 = Fixed CIO/DM slot; 1 = User-Defined Mapping (arbitrary DM start)
D20101 Input Start Address (low word) 0-32767 DM word number where the first received word (Master -> Slave Output) is stored
D20102 Input Word Count 0-122 (max 244 bytes) Number of words received from the master (one PROFIBUS slot of consistent data)
D20103 Output Mapping Mode 0000 or 0001 0 = Fixed slot; 1 = User-Defined Mapping
D20104 Output Start Address (low word) 0-32767 DM word number where the first transmitted word (Slave -> Master Input) is sourced
D20105 Output Word Count 0-122 Number of words sent to the master
D20106 Input Data Format 0000 or 0001 0 = Word swap enabled (big-endian); 1 = Word swap disabled (little-endian / raw PROFIBUS byte order)
D20107 Output Data Format 0000 or 0001 Same as D20106 for the output direction
Word Count Limit: Each PROFIBUS-DP slot in the GSD supports up to 16 bytes of I/O. The PRT21 can chain up to 122 words (244 bytes) per direction, but the master must be configured with the matching slot count and total length. Mismatch between D20102/D20105 and the GSD slot length is the second most common cause of a BF fault after power-up.

Critical Point: Overlapping Input and Output Windows

A common beginner error is to set D20101 (input start) and D20104 (output start) to the same DM address. With User-Defined Mapping enabled, the PRT21 will write the received words into the same memory that it reads to send back, causing an immediate data collision. The fix is to offset the output start by the input word count:

Parameter 16-Word Example 32-Word Example 64-Word Example
D20101 Input Start 0 (D00000) 0 (D00000) 0 (D00000)
D20102 Input Words 16 32 64
D20104 Output Start 16 (D00016) 32 (D00032) 64 (D00064)
D20105 Output Words 16 32 64

The rule is:

D20104 >= D20101 + D20102

or, expressed in DM word numbers where the I/O buffer is placed in the work area (D00000-D32767):

Output_Buffer_Start = Input_Buffer_Start + Input_Word_Count

With a 16-word configuration and the input buffer placed at D00000, the output buffer must begin at D00016, not D00000. A MOV like MOV #0016 D20104 is the correct fix.

Step-by-Step Configuration Procedure

  1. Power down and seat the PRT21. Mount in a Special I/O slot. Connect the PROFIBUS D-sub 9 connector with the cable shield bonded at the bulkhead, not at the module. Power up the rack.
  2. Go online with CX-Programmer. Establish a serial, USB, or Ethernet connection to the CS1G CPU. Place the CPU in PROGRAM mode (this is required for I/O table edits).
  3. Open the I/O Table component. Double-click I/O Table in the project tree. The current registered table is read from the CPU. The PRT21 slot will either be empty (if never registered) or show a different unit type.
  4. Create the I/O table. From the I/O Table menu select Options -> Create. CX-Programmer reads the physical rack, identifies the PRT21 by its unit code, and offers the correct model in the pull-down. Click OK and transfer the new table to the CPU.
  5. Write the DM configuration words. Switch to the Memory component (or open a Watch Window) and enter the values shown in the table below. Because CS1 DM words are retentive, the values persist across power cycles, so this step only needs to be performed once per program.
Address Value (hex) Comment
D20100 #0001 Input: User-Defined Mapping
D20101 #0000 Input start: D00000
D20102 #0010 Input words: 16
D20103 #0001 Output: User-Defined Mapping
D20104 #0010 Output start: D00016 (offset by 16!)
D20105 #0010 Output words: 16
D20106 #0001 Input format: no swap
D20107 #0001 Output format: no swap
CIO 2010 1 Bit 0 = Module Enable (must be on to permit PROFIBUS comms)
  1. Enable the module. Set CIO 2010.00 to 1 in the I/O table's unit enable bit (alternatively move 0001 to CIO 2010 with a one-shot on the first scan after power-up). Without this bit set the PRT21 stays in the disabled state and will not enter PROFIBUS data exchange even if all DM values are correct.
  2. Cycle power to the CS1 backplane. The PRT21 only re-reads its DM configuration during initialisation. Changes to D20100-D20107 made online while the module is running are not picked up until the next power cycle or a backplane reset.
  3. Verify the LEDs. The PRT21 has three LEDs: PWR (green, lit when backplane 5 V is good), RDY (green, lit when the module has completed init and the DM config is valid), and BF (red, lit when the PROFIBUS physical layer or data exchange is bad).

Siemens Master-Side Configuration (S7 HW Config)

For an S7-300/S7-400 with a CP342-5 or CPU 31x-2 DP as the master, the PRT21 must be added as a DP slave with the Omron GSD file:

  1. Copy OMT_0F70.GSD (and any associated bitmap files) into the Siemens Step7\S7DATA\GSD directory.
  2. Open HW Config and refresh the catalog (Options -> Update Catalog).
  3. Drag the Omron PRT21 entry onto the PROFIBUS subnet. Assign a PROFIBUS address that is unique on the segment and matches the rotary switch on the PRT21 hardware (default 1, valid range 0-125).
  4. Insert the I/O slots in the slave's slot table. For a 16-word input / 16-word output configuration, add one 16 word input slot and one 16 word output slot. The slot order must match the direction (input first, output second) and the byte count must total exactly 32 bytes (16 words × 2 bytes).
  5. Compile and download the HW Config. The S7 will then attempt parameterisation of the PRT21 at the configured baud rate.
A GSD slot length mismatch - for example the master set to 8 bytes of input but the PRT21 configured for 16 words (32 bytes) - will cause the PRT21 to refuse parameterisation and the BF LED to remain on. Confirm both ends show the same byte count before chasing wiring issues.

I/O Verification Error: Root Cause and Fix

Symptom: the ERR/ALM LED on the CS1 CPU flashes and the I/O Table component of CX-Programmer shows the PRT21 slot marked with a red X. The PLC will not enter RUN while the verification error is active.

Likely Cause How to Confirm Fix
PRT21 not registered in I/O table Slot shows "(empty)" in I/O Table Run Options -> Create in I/O Table component
DM configuration all zeros D20100-D20107 read back 0000 Enter values via Memory component, then power-cycle
Input and output buffers overlap D20101 == D20104 with non-zero word counts Set D20104 = D20101 + D20102
Word count exceeds GSD slot Master shows 32 bytes, slave DM set to 64 words Reconcile counts in D20102 / D20105 with HW Config
Module Enable bit (CIO 2010.00) not set Bit 0 of CIO 2010 == 0 Force CIO 2010.00 = 1 and add rung to hold it on

BF (Bus Fault) LED Diagnostics

If the CPU is happy (no I/O verification error) but the PRT21 still shows a solid red BF LED, the fault is on the PROFIBUS segment or in the master:

BF Pattern Meaning Action
Solid ON, RDY OFF No PROFIBUS activity; bus termination or wiring Check 9-pin D-sub, terminator resistors ON at both ends only
Solid ON, RDY ON Parameterisation failed Compare GSD slot config vs D20102/D20105 word counts
Slow flash, RDY ON Master not in data exchange yet Check master is in RUN, slave address matches HW Config
Fast flash Self-test failure Cycle power; replace PRT21 if persistent

Ladder Snippet: First-Scan Buffer Prime

Although the DM values should be written once and left retentive, a defensive first-scan block keeps the configuration valid even if a programmer manually zeros a word online:

-- Top of first scan flag in CS1: P_First_Cycle (A200.11)
|  P_First_Cycle  |
|--| |-----------( )--|
|                   MOV(021) #0001 D20100  ; User Mapping In
|                   MOV(021) #0000 D20101  ; In Start = D00000
|                   MOV(021) #0010 D20102  ; In Words = 16
|                   MOV(021) #0001 D20103  ; User Mapping Out
|                   MOV(021) #0010 D20104  ; Out Start = D00016
|                   MOV(021) #0010 D20105  ; Out Words = 16
|                   MOV(021) #0001 D20106  ; In format
|                   MOV(021) #0001 D20107  ; Out format
|                   SET    CIO 2010.00    ; Enable PRT21
+------------------------------------------------+
Use the bit A200.11 (First Cycle Flag) for the initial write. Subsequent rungs can leave these DM areas alone. Do not use a normal contact that pulses on every scan; writing the same value every cycle is harmless but obscures the intentional initialisation step.

Verification and Commissioning

After both CS1 and S7 sides are configured and the bus is wired, perform the following acceptance steps:

  1. LED state: PWR solid, RDY solid, BF off. The CS1 CPU is in RUN with no I/O verification error.
  2. Parameterisation check: On the Siemens side, open the online PROFIBUS diagnostics and confirm the PRT21 appears as a configured, cyclic-exchanging slave with no diagnostic alarms.
  3. Loop-back test: From the S7 program, write a recognisable pattern (e.g. W#16#AAAA) to the first output word of the slave. Observe D00000 on the CS1 (set as a Watch Window entry). Within one PROFIBUS cycle (typically 5-10 ms at 1.5 Mbps) the value should appear. Repeat in the opposite direction by MOV-ing a value to D00016 on the CS1 and reading it in the S7.
  4. Word-swap test: Toggle D20106 and D20107 between 0 and 1 and observe the byte order of a multi-word value (e.g. W#16#1234 5678) to confirm whether the master expects big- or little-endian. This is critical when the master is non-Siemens.
  5. Fault injection: Pull the PROFIBUS connector and confirm both the CS1 sees CIO 2010.02 = 1 (Communication Error flag) and the S7 shows a slave diagnostic alarm. Restore the cable and confirm both clear automatically without a CPU restart.

Frequently Asked Questions

Why does my CS1G show an I/O Verification Error right after I add the PRT21 to the rack?

The PRT21 must be registered in the I/O table before the CPU will let the rack go to RUN. Open CX-Programmer's I/O Table component and use Options -> Create to read the physical rack, then transfer the new table to the CPU. If the table already has the PRT21 but the error persists, check that D20100-D20107 are populated - the PRT21 fails initialisation when its DM window is all zeros, and the CPU reports this as a verification error.

Can I use MOV inside the cyclic program instead of presetting DM values?

No, not reliably. The PRT21 reads its DM configuration only during initialisation at backplane power-up. A MOV on the first scan flag in the user program executes after the module has already initialised with whatever was in DM. The fix is to either preset the DM values via the Memory component of CX-Programmer (CS1 DM is retentive) or to cycle the CS1 power after the first program download so the MOV values are present when the PRT21 initialises.

What is the maximum number of PROFIBUS I/O words the CS1W-PRT21 can exchange?

Up to 122 words (244 bytes) per direction, configured in D20102 (input) and D20105 (output). The GSD file in the master must declare matching slot lengths, and the total PROFIBUS slot payload cannot exceed 244 bytes per slot, so a 122-word configuration uses one full slot. For higher throughput on the CS1 platform, consider the CS1W-PRM21 master module or the CJ2 CPU with a CJ1W-PRT21 on a CJ1H.

My BF LED stays on even though wiring and GSD are correct - what next?

Check the PROFIBUS address rotary switch on the PRT21 - it must match the address assigned to the slave in the master HW Config. Valid range is 0 to 125, with 0 and 1 reserved in some masters. Also confirm the bus termination resistors are installed only on the two physical end nodes; a mid-segment terminator collapses the signal and produces the same BF symptom. Finally, verify the shield of the PROFIBUS cable is bonded to ground at one end only.

Does the PRT21 support acyclic PROFIBUS-DP services (DPV1)?

No. The CS1W-PRT21 implements DP-V0 only - cyclic I/O exchange and station parameterisation. Acyclic DPV1 read/write of diagnostic or parameter data is not available. If acyclic data is required, move to the CJ2 platform with the CJ1W-PRT21 plus CX-Profibus v2.x, which supports DPV1 class 1 and class 2 services for parameter and diagnostic block access.

Back to blog