Configuring PROFINET Boolean Registers for UR5e PLC Handshaking

David Krause17 min read
Industrial NetworkingSiemensTutorial / 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

PROFINET Boolean register handshaking provides the lowest-latency mechanism for exchanging discrete (TRUE/FALSE) state between a Universal Robots e-Series controller (UR3e, UR5e, UR10e, UR16e, UR20, UR30) and a PROFINET IO Controller, typically a SIMATIC S7-1200, S7-1500, ET 200SP, ET 200pro, or a third-party PLC that supports PROFINET IO. Each Boolean occupies a single bit inside the cyclic process image, eliminating acyclic read/write overhead, OPC UA subscription latency, and Modbus TCP register polling. Handshake completion is bounded by the PROFINET send clock, configurable from 1 ms (RT_CLASS_1) down to 250 µs (RT_CLASS_3 isochronous). This article covers configuration of UR5e Boolean registers in URScript, the corresponding IO mapping in TIA Portal V16 or later, and the implementation of a robust handshake using the T2O (Tool-to-Output) and O2T (Output-to-Tool) signal pairs defined by Universal Robots.

Overview

Handshaking between a UR5e and a PLC must be deterministic, repeatable, and observable. PROFINET satisfies these requirements by transporting the Boolean state as part of the cyclic IO data frame the PROFINET IO Controller (PLC) sends to the IO Device (robot) every send clock. There is no application-layer handshake required at the fieldbus level; the cyclic exchange IS the handshake transport. The application layer (your URScript and PLC code) is then responsible for edge detection, sequencing, and watchdog supervision.

The UR5e PROFINET option exposes:

  • 8 Boolean input registers (PLC → Robot), 1 byte total, addressed 0-7.
  • 8 Boolean output registers (Robot → PLC), 1 byte total, addressed 0-7.

These are read and written by URScript through the read_input_boolean_register, read_output_boolean_register, and write_output_boolean_register functions installed by the PROFINET Device URCap. They appear in the PROFINET IO Controller's process image as one Input byte and one Output byte per slot.

Bit ordering: Boolean register 0 is the LSB (least significant bit) of the input/output byte. The PROFINET mapping is little-endian: bit 0 of byte N corresponds to address 0, bit 7 corresponds to address 7. Failure to honor this ordering is the most common cause of "inverted" signals in field deployments.

PROFINET IO Data Model and Real-Time Classes

PROFINET (IEC 61784-2, IEC 61158) defines three Real-Time (RT) classes for cyclic data exchange between the IO Controller (PLC) and IO Device (UR5e). The IO Controller arbitrates all cyclic exchange on the subnet. PROFINET is documented by PROFIBUS & PROFINET International (PI), the international standards body governing both PROFINET and PROFIBUS.

RT Class Send Clock (min) Jitter Use Case
NRT (Non-Real-Time) N/A N/A TCP/IP, HTTP, SNMP, parameterization
RT_CLASS_1 (RT) 1 ms ≤ 50 µs Default I/O, Boolean handshaking
RT_CLASS_2 (IRT, top) 250 µs ≤ 1 µs Isochronous motion with PROFINET IRT
RT_CLASS_3 (IRT, high-precision) 31.25 µs ≤ 1 µs PROFIdrive isochronous, reserved

For Boolean handshaking between UR5e and a SIMATIC PLC, RT_CLASS_1 is sufficient. The send clock is set in the IO Controller's PROFINET interface properties (TIA Portal: Device View → PROFINET interface → Real-Time Settings → Send Clock).

The IO Controller maintains a process image divided into inputs (PII — Process Image Inputs, written by devices, read by the user program) and outputs (PIQ — Process Image Outputs, written by the user program, sent to devices). For a UR5e Boolean I/O slot:

  • Inputs to the PLC = 1 byte at the configured input address (e.g., IB 100). Each bit is a Boolean that the UR5e has set via write_output_boolean_register.
  • Outputs from the PLC = 1 byte at the configured output address (e.g., QB 100). Each bit is a Boolean that the UR5e reads via read_input_boolean_register.

The send clock Tio defaults to 1 ms. The watchdog multiplier is set to 3 by default, meaning the IO Controller declares a station failure if no valid cyclic frame is received within 3 × Tio = 3 ms. The round-trip latency for a Boolean handshake is therefore:

T_round_trip = 2 × T_io + 2 × T_proc

where Tproc is the application processing delay on each side (PLC OB1 cycle and URScript thread poll). At Tio = 1 ms and Tproc ≤ 200 µs, the round trip is typically 2.4 ms.

UR5e Boolean Register Architecture

The Universal Robots PROFINET Device URCap (com.universal_robots.profinet) installs three URScript functions for Boolean register access. The function names reflect the UR5e controller's perspective:

URScript Function Direction Address Range Maps To
read_input_boolean_register(address) PLC → Robot 0–7 1 byte PROFINET output (PIQ), bits 0–7
read_output_boolean_register(address) Robot → PLC 0–7 1 byte PROFINET input (PII), bits 0–7
write_output_boolean_register(address, value) Robot → PLC 0–7 1 byte PROFINET input (PII), bits 0–7

The terminology is intentionally from the robot's point of view:

  • Input register (from robot's view): A Boolean the robot receives from the PLC. The PLC sets a bit; the robot reads it.
  • Output register (from robot's view): A Boolean the robot sends to the PLC. The robot sets a bit; the PLC reads it.

This corresponds to the T2O/O2T nomenclature used in UR5e installations:

  • O2T (Output to Tool): PLC output → robot input. PLC writes QB bit, robot calls read_input_boolean_register.
  • T2O (Tool to Output): Robot output → PLC input. Robot calls write_output_boolean_register, PLC reads IB bit.
The PROFINET option for e-Series is licensed per controller and ships with a corresponding GSDML file in the install package. The URCap, GSDML, and license are versioned and must match the PolyScope version running on the controller. Confirm version compatibility in the URCap release notes before commissioning.

Hardware and Software Prerequisites

Component Specification / Version Notes
UR5e controller CB5 series, PolyScope 5.13.0 or later PROFINET URCap requires URCap 1.0.0+
PROFINET Device URCap com.universal_robots.profinet ≥ 1.0.0 Install via PolyScope → Settings → URCaps
PROFINET license Universal Robots PROFINET option key Required for runtime, activates URCap
SIMATIC PLC S7-1200 (CPU 1214C FC/DC/DC or later) or S7-1500 (any CPU) Must support PROFINET IO Controller
TIA Portal V16 Update 7 / V17 / V18 / V19 STEP 7 Professional
GSDML file GSDML-Vx.x-xxxxxxxx-UR-PND-Vx.x.x.xml Provided in PROFINET URCap install
Ethernet cable Cat 5e or higher, 100 m max segment M12 D-coded or RJ45 (per UR5e variant)
Network switch (optional) Managed PROFINET switch recommended Unmanaged switch acceptable for small cells
PROFINET device name Unique per subnet, e.g., "ur5e-cell1" Assigned in TIA Portal and on the robot

UR5e Robot-Side Configuration

  1. Open PolyScope on the UR5e teach pendant.
  2. Navigate to Settings → URCaps and verify PROFINET Device is listed with a green status indicator. If absent, install via Setup → URCaps → Add URCap from USB.
  3. Navigate to Installation → PROFINET (added by the URCap).
  4. Configure the PROFINET network:
    • Device Name: Assign the same name that will be assigned in TIA Portal (e.g., ur5e-cell1). Device names are case-sensitive.
    • IP Address: Set a static IP in the same subnet as the PLC (e.g., 192.168.1.50/24).
    • Subnet Mask: 255.255.255.0 typical for /24 subnets.
    • Gateway: PLC IP or empty if no routing required.
  5. Restart the controller when prompted. The PROFINET stack initializes only after restart.
  6. Verify on the teach pendant: Installation → PROFINET → Connection State should read Connected once the IO Controller (PLC) is in RUN and has established an Application Relationship (AR) with the device.
The PROFINET device name is required even with static IP configuration. PROFINET uses the name to identify the device during AR establishment; the IO Controller will reject frames from a device whose name does not match what the IO Controller expects. The name assignment can also be performed from TIA Portal via "Assign PROFINET device name" (Online & Diagnostics → Functions).

TIA Portal Configuration and GSDML Installation

  1. Open TIA Portal and the project containing the SIMATIC PLC. The TIA Portal help library is available at Siemens TIA Portal documentation.
  2. Install the UR5e GSDML: Options → Manage General Station Description Files (GSD). Browse to the GSDML-XML file provided in the PROFINET URCap install. Click Install. A green check in the installation log indicates success.
  3. Open Devices & Networks and switch to the Network View.
  4. Locate the UR5e PROFINET device in the Hardware Catalog: Other field devices → PROFINET IO → I/O → Universal Robots → UR e-Series. Drag the device onto the PROFINET subnet.
  5. Connect the UR5e to the PLC's PROFINET port by dragging a cable from the device's PROFINET interface to the PLC's PN port.
  6. Assign the IO Controller: Right-click the UR5e → Assign IO Controller → select the SIMATIC PLC CPU.
  7. Right-click the UR5e → Properties → PROFINET interface → Ethernet addresses:
    • Set the IP address to match the robot's static IP (e.g., 192.168.1.50).
    • Set the PROFINET device name to match the name configured on the robot (e.g., ur5e-cell1).
  8. Open the Device View of the UR5e. Drag the Boolean Input 8-bit module from the catalog into Slot 1. Drag the Boolean Output 8-bit module into Slot 2. The slot numbering is defined in the GSDML.
  9. Configure the I/O addresses: Click each module → Properties → I/O addresses:
    • Input module (T2O): Start address 100 (IB 100 - IB 107).
    • Output module (O2T): Start address 100 (QB 100 - QB 107).
  10. Compile and download to the PLC. The UR5e will transition to Connected once the AR is established.
TIA Portal V18 introduced a streamlined GSDML import. If you are on V16, ensure the GSDML import is from the TIA Portal menu, not from Windows Explorer. Improperly installed GSDML files will appear in the catalog under the wrong vendor or fail to load entirely.

IO Mapping: T2O and O2T Signal Definition

The 8 Boolean bits in each direction are typically reserved for a fixed application handshake. The recommended mapping for a UR5e ↔ PLC handshake is:

Bit / Addr T2O (Robot → PLC) — Robot Output / PLC Input O2T (PLC → Robot) — PLC Output / Robot Input
0 Robot Ready (TRUE = ready to receive command) Start Command (PLC triggers motion)
1 Cycle Active (TRUE = robot executing program) Stop / Abort (PLC halts cycle)
2 Cycle Complete (TRUE = last program finished successfully) Reset / Acknowledge (PLC clears faults)
3 Fault (TRUE = robot fault active) Fault Reset (PLC pulses to clear)
4 Gripper Closed (TRUE = gripper in closed state) Close Gripper
5 Gripper Open (TRUE = gripper in open state) Open Gripper
6 Part Present (TRUE = part detected in fixture) Conveyor Index (PLC advances conveyor)
7 Heartbeat (toggles every 100 ms, watchdog for PLC) Heartbeat (toggles every 100 ms, watchdog for robot)

Bit 7 is reserved for a bidirectional heartbeat. Each side toggles its output bit every 100 ms; each side monitors the opposite bit and declares a communication fault if no transition is detected within 300 ms (3 missed heartbeats at 100 ms period).

Handshake Logic Implementation

A robust handshake is a four-edge sequence:

  1. Request: PLC raises Start Command (O2T bit 0). Robot reads via read_input_boolean_register(0).
  2. Acknowledge: Robot raises Cycle Active (T2O bit 1). PLC reads via IB 100, bit 1.
  3. Execute: Robot runs the program. PLC may monitor Heartbeat and Cycle Active throughout.
  4. Complete: Robot raises Cycle Complete (T2O bit 2). PLC drops Start Command; robot drops Cycle Active and Cycle Complete on next read of Start Command == FALSE.

Edge detection in URScript and PLC code is required. Reading a Boolean register returns the current state, not the edge; the application must compare to the previous sample and act only on transitions. Failure to implement edge detection is the second most common cause of "robot executes command twice" in the field.

Programming Examples: URScript, SCL, and Ladder

The following URScript implements the robot-side handshake receiver as a background thread:

# UR5e URScript — Handshake Receiver Thread
# File: handshake.urscript
# Runs as a background thread; monitors PLC commands and toggles heartbeat.

global cycle_active = False
global cycle_complete = False
global robot_fault = False
global heartbeat_state = False
global prev_start = False
global prev_plc_heart = False
global plc_heart_age_ms = 0

thread heartbeat_thread():
  while True:
    heartbeat_state = not heartbeat_state
    write_output_boolean_register(7, heartbeat_state)
    sleep(0.1)
  end

thread handshake_thread():
  while True:
    # Read PLC commands (O2T direction)
    plc_start   = read_input_boolean_register(0)
    plc_stop    = read_input_boolean_register(1)
    plc_reset   = read_input_boolean_register(3)
    plc_heart   = read_input_boolean_register(7)

    # PLC heartbeat watchdog (300 ms)
    if plc_heart != prev_plc_heart:
      plc_heart_age_ms = 0
    else:
      plc_heart_age_ms = plc_heart_age_ms + 20
    end
    prev_plc_heart = plc_heart
    if plc_heart_age_ms > 300:
      robot_fault = True
      write_output_boolean_register(3, True)
    end

    # Reset request
    if plc_reset:
      robot_fault = False
      write_output_boolean_register(3, False)
    end

    # Start request — rising edge
    if plc_start and not prev_start:
      cycle_active   = True
      cycle_complete = False
      write_output_boolean_register(1, True)   # Cycle Active ON
      # ... call motion program here ...
      cycle_active   = False
      cycle_complete = True
      write_output_boolean_register(1, False)  # Cycle Active OFF
      write_output_boolean_register(2, True)   # Cycle Complete ON
    end

    # Stop request — drop everything
    if plc_stop:
      write_output_boolean_register(1, False)
      write_output_boolean_register(2, False)
    end

    prev_start = plc_start
    sleep(0.02)  # 20 ms poll — 5x faster than 100 ms heartbeat
  end
end
Poll interval should be at most 1/5 of the heartbeat period. A 100 ms heartbeat polled every 20 ms gives 5 chances per period to detect a transition and provides tolerance for one or two missed polls.

The following SCL (Structured Control Language) function block implements the PLC side of the handshake. It can be used in TIA Portal with S7-1200 (firmware 4.4 or later) or S7-1500.

FUNCTION_BLOCK "UR5e_Handshake"
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
   VAR_INPUT
      i_RobotReady       : BOOL;    // IB 100.0
      i_CycleActive      : BOOL;    // IB 100.1
      i_CycleComplete    : BOOL;    // IB 100.2
      i_RobotFault       : BOOL;    // IB 100.3
      i_RobotHeartbeat   : BOOL;    // IB 100.7
   END_VAR

   VAR_OUTPUT
      q_Start            : BOOL;    // QB 100.0
      q_Stop             : BOOL;    // QB 100.1
      q_Reset            : BOOL;    // QB 100.3
      q_Heartbeat        : BOOL;    // QB 100.7
      q_HeartbeatOK      : BOOL;
      q_CommunicationFault : BOOL;
   END_VAR

   VAR
      heartbeat_prev   : BOOL;
      heartbeat_ton    : TON;     // 300 ms watchdog
      heartbeat_state  : BOOL;
   END_VAR

BEGIN
   // Heartbeat generation (toggle every 100 ms)
   heartbeat_state := NOT heartbeat_state;
   #q_Heartbeat := heartbeat_state;

   // Heartbeat watchdog — 300 ms without edge = fault
   #heartbeat_ton(IN := (#i_RobotHeartbeat XOR heartbeat_prev),
                  PT := T#300ms);
   #q_HeartbeatOK := NOT #heartbeat_ton.Q;
   #q_CommunicationFault := #heartbeat_ton.Q;
   heartbeat_prev := #i_RobotHeartbeat;

   // Command passthrough
   #q_Start := #i_RobotReady AND NOT #i_RobotFault;
   #q_Stop  := NOT #i_RobotReady OR #i_RobotFault;
   #q_Reset := FALSE;  // pulse via separate logic
END_FUNCTION_BLOCK

Equivalent Ladder (LAD) representation of the heartbeat watchdog:

Network 1: Heartbeat generation
      heartbeat_state           heartbeat_state
BOOL---[ NOT ]-------------------( )---|
                                  |    |
                                  +----+

Network 2: Edge detection on incoming robot heartbeat
      i_RobotHeartbeat  heartbeat_prev
BOOL---[ XOR ]-------------------( edge )

Network 3: 300 ms watchdog timer
      edge                              T#300ms
BOOL---[ ]--------------------------------TON----( heartbeat_ton.Q )
      i_RobotHeartbeat
BOOL---[ ]--------------------------------TON    Q
      heartbeat_ton.Q
BOOL---[ ]--------------------------------( q_CommunicationFault )

Verification, Diagnostics, and Troubleshooting

  1. Online → Go Online in TIA Portal. Right-click the UR5e PROFINET device → Online & Diagnostics.
  2. Verify the connection state shows a green check. If yellow (warning) or red (error), expand the diagnostics to see the cause. Common PROFINET diagnostic codes: D1 (Station Failure), D2 (Configuration Mismatch), D3 (Module Failure), D4 (Submodule Failure), E1 (AR Consumer DHT Expired).
  3. Open Watch Tables on the UR5e device. Monitor IB 100-107 and QB 100-107. Use Modify to force a single bit and confirm it appears on the robot side via URScript.
  4. On the robot teach pendant, open the PROFINET page and confirm the I/O status indicator is green. Use the URScript read_input_boolean_register(0) in a script to print the live value to the program log.
  5. Measure round-trip latency: Pulse QB 100.0 in the PLC, capture the timestamp when IB 100.0 transitions on the robot, compute Δt. Expected value: 1-2 send clock periods (1-2 ms at Tio = 1 ms).
  6. Force a watchdog trip: Stop the PLC PROFINET interface. The robot's heartbeat detection should declare a communication fault within 300 ms.
  7. Force a heart-bit polarity error: Briefly set q_Heartbeat := TRUE; q_Heartbeat := TRUE (skip the toggle). The PLC watchdog should trip on the next edge check.
Check Pass Criteria Tool
AR established Connection state = green / Connected TIA Online, PolyScope PROFINET page
Input byte mirror (O2T) QB 100.0 change appears in read_input_boolean_register(0) within 1 send clock URScript log + Watch Table
Output byte mirror (T2O) write_output_boolean_register(0, TRUE) appears as IB 100.0 within 1 send clock URScript log + Watch Table
Heartbeat integrity q_HeartbeatOK = TRUE, both sides see edge every 100 ms ± 10 ms Trace + Function Block
Watchdog trip Stopping PROFINET triggers q_CommunicationFault within 300 ms Forced PLC stop + trace
Round-trip latency 1-2 ms at Tio = 1 ms Trace timestamp comparison
Symptom Probable Cause Diagnostic Step Corrective Action
Connection state = "Not Connected" PROFINET device name mismatch TIA Online & Diagnostics → Name assignment Assign the device name from TIA Portal to the robot (PROFINET → Assign Name)
Connection state = "Not Connected" IP address conflict or wrong subnet Ping robot IP from PLC engineering station Correct static IP; ensure /24 subnet matches
Connection state = "Not Connected" URCap not installed or license missing PolyScope → Settings → URCaps Install URCap and apply license
Inputs always FALSE Module not inserted in slot TIA Device View → check slots 1, 2 Drag Boolean Input 8-bit module into Slot 1
Inputs always FALSE Address range conflict with other distributed I/O TIA → PLC tags → I/O addresses table Move UR5e I/O to a free range (e.g., IB 200-207)
Robot sees FALSE despite PLC TRUE Bit endianness confusion Trace QB 100 as BYTE; confirm bit 0 = address 0 Use bit-of-byte extraction; verify LSB is address 0
Intermittent connection drops Cable length > 100 m, EMI, or poor connector Check PROFINET diagnostics → cable statistics Replace cable, add shielding, use M12 connectors rated for motion
Watchdog trips during motion CPU scan time exceeds 3 × Tio Online → PLC → Cycle time Reduce OB1 cycle time or increase watchdog multiplier
GSDML not visible in catalog Wrong TIA Portal version or wrong GSDML variant Options → Manage GSD → check installation log Install correct GSDML for TIA version; check TIA version in the URCap release notes
Communication OK but signals inverted T2O/O2T terminology confusion Trace IB/QB and confirm with URScript log Apply bit-mask inversion in URScript or PLC; document mapping
Cyclic frame D2 (configuration mismatch) GSDML version mismatch between project and device Compare GSDML versions in TIA vs. on robot Re-import the GSDML shipped with the URCap and recompile

Safety and PROFIsafe Considerations

Boolean registers exposed via the PROFINET URCap are not safety-rated. They are intended for production handshaking, sequencing, and status — not for safety functions. Safety-rated signals (Emergency Stop, Safe Stop, Safe Operating Stop) must be transported via a separate, certified mechanism:

  • Safety IO on the UR5e controller: The e-Series controller exposes configurable Safety IO (8 safe inputs, 8 safe outputs as standard, expandable to 16 each with the Safety I/O expansion) that are processed by the UR safety controller (UR Safety 3.0+). These are hardwired, not PROFINET.
  • PROFIsafe over PROFINET: PROFIsafe (IEC 61784-3-3) wraps a safety protocol inside a standard PROFINET slot. The UR5e PROFINET URCap does not currently implement PROFIsafe; a separate PROFIsafe gateway (e.g., Siemens F-CPU with PROFIsafe profile) is required if PROFIsafe is desired.
  • Safety PLC integration: When a SIMATIC F-CPU is the master, the standard PROFINET device profile includes a PROFIsafe slot. This is not exposed by the UR5e PROFINET URCap.
Never route Emergency Stop, Safe Stop, or reduced-speed-enable signals through the Boolean registers described in this article. A single missed handshake cycle could defeat a safety function. Always wire safety signals to the dedicated Safety IO terminals on the UR5e controller and to the F-DI/F-DO modules of a SIMATIC F-CPU. Refer to the Universal Robots Safety Manual and the Siemens F-CPU safety manual for the certification scope of each integration.

Frequently Asked Questions

What is the difference between read_input_boolean_register and read_output_boolean_register?

From the robot's perspective, read_input_boolean_register returns a Boolean that the PLC has written to the robot (O2T direction, PLC output → robot input). read_output_boolean_register returns a Boolean that the robot has written to the PLC (T2O direction, robot output → PLC input). Both functions take an address 0-7 corresponding to a bit in the 1-byte PROFINET module.

How fast can a Boolean handshake complete?

At the default PROFINET RT_CLASS_1 send clock of 1 ms, a single-bit handshake completes in 1-2 send clock periods: 1-2 ms from PLC write to robot read, and 1-2 ms from robot write to PLC read. With IRT (RT_CLASS_2) and a 250 µs send clock, the round trip drops to 500 µs-1 ms.

Do I need a separate license for the PROFINET option on UR5e?

Yes. The PROFINET Device URCap for e-Series is a separately licensed option. The URCap installs and appears in the menu without a license, but the PROFINET stack will not start at runtime until a valid license key is applied. License keys are issued per controller serial number by Universal Robots.

Can I use Boolean registers together with PROFINET IRT motion control?

Yes. PROFINET IRT and Boolean I/O share the same physical cable. The IRT sync domain is configured in TIA Portal, and the Boolean I/O is configured as a separate slot/module. Confirm that the UR5e PROFINET URCap version you use supports IRT; some older versions are RT-only.

What happens if the PROFINET cable is disconnected mid-cycle?

The IO Controller's watchdog (default 3 × Tio = 3 ms) will trip. The UR5e transitions to a "station failure" state; the PROFINET URCap sets all Boolean input registers to FALSE. The PLC's output to the robot also goes to zero. Both sides should detect the failure via the heartbeat watchdog within 300 ms and enter a defined safe state. Always implement the heartbeat watchdog described in this article to avoid relying solely on the fieldbus watchdog.

Back to blog