# Engineering Method and Tool for the Complete Virtual Commissioning of Robotic Cells
## 3 Proposed Virtual Commissioning Approach
### Architecture of the Virtual Commissioning System  
The main idea of the proposed approach is to replicate the physical automation solution architecture in a virtual environment (in the specific case RS) referring to a one-to-one mapping between real physical components and their digital representations. As shown in the left part of Figure 1, in the industrial practice, a robotic cell is usually governedby one PLC, which exchanges signals with other automation modules, i.e., controllers of robots, motors, etc. The signal can represent any type of data, e.g., Booleans, integers and real data. The communication is conveyed referring to a field bus, which is physically implemented as a cable connecting the controllers and cell devices in series.  
The right side of Figure 1 depicts the proposed VC solution. The PLC system is maintained as a cell governing tool (hybrid solution) or optionally substituted by a PC running an emulated PLC for a fully virtual strategy. Each physical device is represented in the prototyping software platform as a virtual module, which is designed to have the same interface of the real counterpart, in terms of exchanged signals and expected behavior. Such virtual models are realized as SCs, leveraging the functionalities and abstraction capabilities of RS by providing to the user the possibility of defining reusable blocks, which encapsulate geometrical definitions, kinematics, sensors and control logics. The level of detail in the representation of the single device is a compromise between the necessary realism and the overall performance of the simulation environment. In particular, aspects that influence the performance of the PLC must be accurately modelled, such as dynamic or synchronized activities. Contrastingly, physically based computations that accurately represent systems performance may be demanding in terms of resources, so they must be limited to the parts where they provide the necessary realism and coherence with the represented behavior, as discussed in [39].  
Analogously, the flow of signals on the field bus is seamlessly linked to a flow of virtual signals in the virtual environment. The communication between the PLC and the virtual environment is obtained by a connection interface developed as a SC. This component, named PLC_Beckhoff, mimics the presence of the real PLC in RS. The connection to the real PLC is established through the automation device specification (ADS) protocol, which is provided by Beckhoff for linking the devices of a control chain. Since ADS Advanced Programming Interfaces (API) are available for MS NET Framework platform, the C# programming language was used to develop the PLC_Beckhoff SC to read and write the values of the variables defined in the TC PLC program.  
From the PLC point of view, the PLC_Beckhoff SC acts as a real element of the control chain and exchanges real signals on the field bus. Contrastingly, the component is integrated in the virtual environment of RS so that it can read and write the virtual signals used to control the synthetic environment. The usage of the SC in RS is quite straightforward since it provides the possibility to freely add signals that the user wants to exchange with the PLC simply by naming them as they appear in the PLC code. For instance, Figure 2 shows how  
Figure 1: Conceptual representation of the proposed VC approach: (**a**) Typical hardware architecture of a robotic cell; (**b**) Representation in a virtual environment of the control architecture to maintain a correspondence between physical and virtual assets.  
the two signals RS_Input1 and RS_Output1, defined in the robot controller Controller_R1, are linked to the PLC variables PLC_Output1 and PLC_Input1, respectively. The two latter variables are searched in the TC running code and the values are automatically synchronized by the SC.