realvirtual.io
  • Building Digital Twins with Unity and realvirtual.io
  • Basics
    • Installation
    • Demo Model
      • Old Demo Model
    • Editor User Interface
      • Hierarchy Window
      • 3D Views
      • Quick Edit
      • Move Pivot Points (Pro)
      • Selection Window (Pro)
      • Material Window (Pro)
      • Measurement (Pro)
      • Kinematic Tool (Pro)
      • Model Checker
    • Runtime UI
      • Group Manager
      • Debug Console
      • Responsiveness
      • Runtime Persistence
    • Importing and exporting
    • Folder structure
    • Tutorial
    • Physics
    • CAD import (Pro)
      • CADLink (Pro)
      • CAD Checker (Pro)
      • CAD Updater (Pro)
    • Reusable Components (Prefabs)
    • Cadenas parts4cad
    • Publishing the Digital Twin
    • Revision management
  • News
  • Login & Download Updates (Pro)
  • Components & Scripts
    • Realvirtual
      • Environment Controller
    • MU, Source and Sink
      • Source
      • Sink
    • Motion and Kinematic
      • Drive
      • Kinematic
      • Group
      • Joint
      • CAM
      • TransportSurface
      • Guided Transport
      • Drive behavior
      • Chain
      • Chain element
      • Motion for developers
    • Sensors
      • Sensor
      • Measure
      • MeasureRaycast
    • Picking and Placing MUs
      • Grip
      • Gripper
      • Fixer
      • Pattern
    • Changing MUs
      • MaterialChanger
      • PartChanger
      • Cutter
    • Scene Interaction
      • 3D Buttons
      • Screen Overlay Buttons
      • Scene Selectables
      • Lamp
      • Interact3D
      • UI components
      • HMI components (Pro)
        • Start your own HMI
        • HMI Tab
        • HMI DropDown
        • HMI Puschbutton
        • HMI Switch
        • HMI Value
        • HMI Text
        • HMI Slider
        • HMI Message
        • HMI Marker
      • ModelZoo (Pro)
    • Interfaces
      • Interface Tools
        • Signal Manager
        • Signal Importer Exporter
        • Signal Catcher
        • OnValueChangedReconnect
      • Signal Importer / Exporter
      • ABB RobotStudio (Pro)
      • Denso Robotics (Pro)
      • EthernetIP (Pro)
      • Fanuc (Pro)
      • FMI
      • Igus Rebel
      • MQTT (Pro)
      • Modbus (Pro)
      • OPCUA (Pro)
      • PLCSIM Advanced (Pro)
      • RoboDK (Pro)
      • RFSuite (Pro)
      • SEW SimInterface (Pro)
      • Siemens Simit Interface (Pro)
      • Simit Shared Memory (Pro)
      • Simulink (Pro)
      • S7 TCP
      • TwinCAT (Pro)
      • TwinCAT HMI (Pro)
      • UDP (Pro)
      • Universal Robots (Pro)
      • Wandelbots Nova (Pro)
      • Websocket (Pro)
      • Windmod Y200 (Pro)
      • Custom Interfaces
    • Performance Tools
      • Combine Meshes (Pro)
      • Create Prefab (Pro)
      • Hierarchy Cleanup (Pro)
      • Mesh Optimizer (Pro)
      • Performance Optimizer (Pro)
    • Defining Logic
      • Unity Scripting
      • Behavior Graph
      • Logicsteps
      • Unity Visual Scripting
      • Recorder
    • Robot Inverse Kinematics (Pro)
    • Volume Tracking (Pro)
  • Multiplayer (Pro)
  • Extensions
    • ModelZoo
      • Beckhoff TwinCAT
      • Siemens S7
      • Denso Cobotta 1300
      • Wandelbots Nova Fanuc CRX
      • Universal Robots UR10
      • Fanuc Roboguide
    • realvirtual.io AIBuilder
      • realvirtual.io AI Builder Overview
      • Generate AI Training Data
      • AI Training
      • Testing AI in a Digital Twin
      • Deploying the AI
    • realvirtual.io Simulation
      • Conveyor Library
      • Path System
        • Path finding
        • Line
        • Curve
        • Workstation
        • Catcher
        • Pathmover
    • realvirtual.io Industrial Metaverse
      • Setup Guide
      • VR Modules
      • AR Modules
      • Multiuser
    • AGX Physics
    • VR Builder
    • CMC ViewR
  • Advanced Topics
    • Render Pipelines
    • Mixed Reality with Meta Quest3
    • Upgrade Guide
      • Upgrade to 2022
    • Open Digital Twin Interface
    • Usefull Addons
    • Improving Performance
    • Supported Platforms
    • Compiler Defines
    • For Developers
      • Important Classes and Interfaces
      • Assembly Definitions
      • Starting your development
      • Class documentation
      • realvirtual Init Sequence
      • realvirtualBehavior Lifetime Methods
      • Testing
    • Newtonsoft JSON
    • Troubleshooting
  • Release Notes
  • AI Digital Twin Assistant (GPT4)
  • License Conditions
Powered by GitBook
On this page
  • Introduction
  • Prerequisites
  • Ready-to-Run Beckhoff Project
  • Interface Configuration
  • Signals
  • 1. Robot Signals
  • 2. Machine Signals
  • 3. Entry and Exit Conveyor
  • 4. HMI (Buttons & Lights)
  • 5. TwinCAT Configuration
Edit on GitHub
  1. Extensions
  2. ModelZoo

Beckhoff TwinCAT

Demonstration cell including full TwinCAT3 project

PreviousModelZooNextSiemens S7

Last updated 1 month ago

Introduction

This scene is a virtual commissioning setup for testing and validation with real or virtual Beckhoff PLCs programmed using TwinCAT. The PLC controls the process flow, including starting the robot, while the robot controller is fully simulated. It enables safe and flexible testing of automation logic without the need for real hardware. For prerequisites and setup instructions, please visit https://doc.realvirtual.io/modellzoo.

This document lists all signals exchanged between realvirtual (Unity) and a Beckhoff TwinCAT PLC for controlling the TwinCAT Demo, following the convention that IO.Input = PLC Input (from realvirtual) and IO.Output = PLC Output (from PLC). The tables below map each signal to its purpose in the modelzoo simulation.

Prerequisites

To use the Beckhoff ModelZoo scene, you will need an installation of Beckhoff TwinCAT 3 (recommended version: 3.1.x or higher). You can connect either a real PLC or use the local TwinCAT PLC runtime (PLCSim) on your PC.

For communication with the PLC, TwinCAT 3 ADS (usually part of a full TwinCAT3 installation) must be installed on the same PC where the realvirtual.io ModelZoo is running. Make sure TwinCAT is in Run mode, and that the correct AMS NetID and port are configured in the simulation settings.

We provide a complete TwinCAT project for this scene, which can be imported and compiled directly in the TwinCAT environment.

Ready-to-Run Beckhoff Project

For this ModelZoo scene, we provide a complete Beckhoff TwinCAT project. You can import, compile, and run it directly within the TwinCAT environment to control the simulation seamlessly.

Interface Configuration

Before connecting to a Beckhoff PLC, you need to configure the NetID and Port used for communication.

To do this:

  1. Click the Settings icon (⚙️) in the toolbar.

  2. Enter your TwinCATInterface.NetId and TwinCATInterface.Port as shown in the image below.

  3. Make sure the values match your TwinCAT runtime setup.

📘 Refer to the official Beckhoff documentation for details on how to find or configure your NetID and Port.

Signals

1. Robot Signals

1.1 Robot Overall Status

These signals tell the PLC whether the robot is in a loading or unloading state, as determined by the realvirtual simulation.

Signal

Type

Direction

Description

IO.Input.Robot.bStatusLoading

BOOL

realvirtual → PLC (In)

Indicates that the robot is currently loading a part

IO.Input.Robot.bStatusUnloading

BOOL

realvirtual → PLC (In)

Indicates that the robot is currently unloading a part

1.2 Start Robot Programs

These signals come from the PLC and are used by realvirtual to trigger robot actions in the simulation.

Signal

Type

Direction

Description

IO.Output.Robot.bStartLoading

BOOL

PLC → realvirtual (Out)

When set by the PLC, requests the robot to start loading.

IO.Output.Robot.bStartUnloading

BOOL

PLC → realvirtual (Out)

When set by the PLC, requests the robot to start unloading.


2. Machine Signals

These signals handle the interaction between the simulated machine (e.g., a milling station) and the PLC.

Signal

Type

Direction

Description

IO.Output.Machine.bStart

BOOL

PLC → realvirtual (Out)

When set by the PLC, starts the machine operation in the simulation.

IO.Input.Machine.bMachining

BOOL

realvirtual → PLC (In)

Tells the PLC that the machine is currently machining

IO.Input.Machine.bMachiningFinished

BOOL

realvirtual → PLC (In)

Tells the PLC the machine has finished its operation

IO.Input.Machine.bDoorOpen

BOOL

realvirtual → PLC (In)

Indicates the machine door is open in the simulation.

IO.Input.Machine.bDoorClosed

BOOL

realvirtual → PLC (In)

Indicates the machine door is closed in the simulation.


3. Entry and Exit Conveyor

3.1 Exit Belt Signals

Signal

Type

Direction

Description

IO.Output.ExitBelt.Motor.bStart

BOOL

PLC → realvirtual (Out)

PLC requests the simulation to start the exit conveyor motor.

IO.Input.ExitBelt.Sensor.bOccupied

BOOL

realvirtual → PLC (In)

Simulation indicates whether the exit belt sensor is triggered/occupied.

3.2 Entry Belt Signals

Signal

Type

Direction

Description

IO.Output.EntryBelt.Motor.bStart

BOOL

PLC → realvirtual (Out)

PLC requests the to start the entry conveyor motor.

IO.Input.EntryBelt.Sensor.bOccupied

BOOL

realvirtual → PLC (In)

Simulation indicates whether the entry belt sensor is triggered/occupied.


4. HMI (Buttons & Lights)

These signals correspond to the simulated HMI panel. Some are set by the simulation and read by the PLC (Inputs), while others are set by the PLC and read by the simulation (Outputs).

Signal

Type

Direction

Description

IO.Input.HMI.OnSwitch.bOn

BOOL

realvirtual → PLC (In)

Simulation indicates the main HMI switch is turned on.

IO.Input.HMI.Emergency.bOn

BOOL

realvirtual → PLC (In)

Simulation indicates an emergency button is pressed.

IO.Input.HMI.AutomaticButton.bPressed

BOOL

realvirtual → PLC (In)

Simulation indicates an “Automatic” button press event.

IO.Output.HMI.AutomaticButton.bLight

BOOL

PLC → realvirtual (Out)

Turns the Lamp of the button on.

IO.Input.HMI.Robot.bOn

BOOL

realvirtual → PLC (In)

Simulation indicates the robot button is pressed.

IO.Input.HMI.EntryBelt.bOn

BOOL

realvirtual → PLC (In)

Simulation indicates the entry belt button is pressed.

IO.Input.HMI.ExitBelt.bOn

BOOL

realvirtual → PLC (In)

Simulation indicates the exit belt button is pressed.

IO.Output.HMI.Robot.bLight

BOOL

PLC → realvirtual (Out)

Turns the Lamp of the button on.

IO.Output.HMI.EntryBelt.bLight

BOOL

PLC → realvirtual (Out)

Turns the Lamp of the button on.

IO.Output.HMI.ExitBelt.bLight

BOOL

PLC → realvirtual (Out)

Turns the Lamp of the button on.

5. TwinCAT Configuration

  1. Match Each Signal In your TwinCAT PLC project, create variables for every one of the signals listed here. Ensure the variable names match exactly (case-sensitive) and the types are all BOOL unless otherwise specified.

  2. Map to Physical or Virtual I/O

    • If connected to real hardware, map these PLC variables to the corresponding digital inputs/outputs.

    • For pure simulation, keep them as internal variables in the TwinCAT PLC.

  3. Enable ADS Make sure the AMS Router and ADS settings in TwinCAT are configured so Unity/realvirtual can connect. You will need the AMS Net ID and Port in your Unity project.

  4. Configure realvirtual

    • In Unity, locate the TwinCATInterface (or similar script).

    • Enter the correct ADS settings (Net ID, IP Address, Port).

    • Assign each of the “IO.Input” and “IO.Output” strings to the matching TwinCAT variable.

204KB
UnityDemoszene.tnzip