  Digital twin is a virtual replica of a real-world object that lives
simultaneously with its physical counterpart. Since its first introduction in
2003 by Grieves, digital twin has gained momentum in a wide range of
applications such as industrial manufacturing, automotive and artificial
intelligence. However, many digital-twin-related approaches, found in
industries as well as literature, mainly focus on modelling individual physical
things with high-fidelity methods with limited scalability. In this paper, we
introduce a digital-twin architecture called TiLA (Twin-in-the-Loop
Architecture). TiLA employs heterogeneous models and online data to create a
digital twin, which follows a Globally Asynchronous Locally Synchronous (GALS)
model of computation. It facilitates the creation of a scalable digital twin
with different levels of modelling abstraction as well as giving GALS formalism
for execution strategy. Furthermore, TiLA provides facilities to develop
applications around the twin as well as an interface to synchronise the twin
with the physical system through an industrial communication protocol. A
digital twin for a manufacturing line has been developed as a case study using
TiLA. It demonstrates the use of digital twin models together with online data
for monitoring and analysing failures in the physical system.
