Abstract:
A method and a device for simulating an automation system are disclosed. The aim of the invention is to allow an automation system to be simulated in such a way that simulation components operating at very different computing speeds can be combined into an overall simulation. Said aim is achieved by a method comprising a control component that can be clocked using an external timing source and at least one simulation component which can be clocked using an external timing source. A coordinated clock system is provided for the control component and the at least one simulation component by means of a control component-independent timing coordinator.

Description:
BACKGROUND OF THE INVENTION 
   The invention relates to a method and to a device for simulating an automation system. 
   In order to simulate automation systems, a control component is connected to one or more simulation components, for example a drive simulation or a kinematics simulation. The control component and the various simulation components that are, for example, processed on a computer system, run independently of one another in this process with the aid of a dedicated clock system in each case. The minimum clock frequency is always prescribed in this case by the control component, since the clock frequencies of the control component cannot be influenced. 
   Complex situations such as drive simulations or kinematics simulations are, however, frequently too slow, to be calculated in the clock time of the control component. Since, according to the prior art, the clock time of the simulation components is prescribed by the control component, the simulation components must therefore be accelerated in such a way that they operate in time with the control component. To this end, either the required hardware preconditions are drawn up such that the fastest possible computers are used to design the simulation components, or else use is made of special simulation hardware. Another possibility consists in reducing the degree of detail of the simulation so far that it can be executed quickly enough on the existing simulation hardware. The consequence of this is that specific simulations can be carried out either not at all or only with useless results, or else only with a disproportionately high outlay. 
   SUMMARY OF THE INVENTION 
   It is an object of the present invention to enable a simulation of an automation system to the effect that simulation components that operate at very different computing speeds can be connected so as to yield an overall simulation. 
   According to one aspect of the invention, the object is achieved by a method for simulating an automation system having a control component that can be clocked by means of an external clock source, and at least one simulation component that can be clocked by means of an external clock source, a coordinated clock system being provided for the control component and the at least one simulation component by means of a timing coordinator that is independent of the control component. 
   According to another aspect of the invention, the object is achieved by a device for simulating an automation system having a control component that can be clocked by means of an external clock source, having at least one simulation component that can be clocked by means of an external clock source, and having a timing coordinator, which is independent of the control component, for providing a coordinated clock system for the control component and the at least one simulation component. 
   According to yet another aspect of the invention, the object is achieved by a computer program for simulating an automation system having a control component that can be clocked by means of an external clock source, and at least one simulation component that can be clocked by means of an external clock source, and having computer program instructions for providing a coordinated clock system for the control component and the at least one simulation component by means of a timing coordinator that is independent of the control component, when the computer program is executed on a computer. 
   Consequently, the automation system has a control component and at least one simulation component, it being possible to clock both the control component and the at least one simulation component with the aid of an external clock source. According to the invention, a timing coordinator that is independent of the control component serves the purpose of providing a coordinated clock system for all the system components. 
   A core idea of the invention is to separate the prescription of the clock time from the control component and to provide a timing coordinator that is independent of the control component and establishes an external clock system. The invention is based, firstly, on the fact that the control component is designed in such a way that it can be clocked from outside, and secondly on the fact that an external timing coordinator uses this ability to synchronize the various system components via a common clock interface. 
   It is of no importance here whether the control component is designed as a real control hardware item or is, instead, replaced by a software emulation on a computer. 
   The invention can be used, for example, for real time simulation of automation controls and drives such as SIMOTION, SINAMICS, SINUMERIK or SIMATIC S7, all from SIEMENS AG. 
   In one embodiment of the invention, the timing coordinator operates in a fixed timing pattern. It is possible thereby, in particular, to reduce the speed of the control component and to adapt it to the speeds of the simulation components. If all the system components are operated at the same speed, even slow simulation components such as, for example, drive simulations or kinematics simulations, can be connected to the control component. In the case of such a fixed timing pattern, the clock is, in other words, set such that the clock cycle is large enough that even the slowest simulation component can execute all the simulation steps in this pattern. This embodiment of the invention is particularly easy to implement and to monitor. 
   In order to improve the comparatively low performance of this embodiment, it is provided in accordance with a further embodiment of the invention that the timing coordinator sets each clock pulse in a time-variable fashion. In this case, the timing coordinator does not trigger the next clock cycle in a fixed pattern, but as a function of the state of at least one of the system components. The triggering of the next clock cycle is preferably performed whenever all the simulation components have terminated the current clock pulse. As a result, the available computing power is optimally utilized in each clock cycle. A profound depth of detail can be achieved in the case of individual especially complex simulation steps. 
   Particularly advantageous is a two-phase timing coordination in the case of which not only is the system clock coordinated—so, too, is the data exchange between the system components. This resolves the problems of consistency known from the prior art and which can occur during the processing sequence or the data transfer between system components. 

   
     BRIEF DESCRIPTION OF THE DRAWING 
     The present invention is explained below in more detail with the aid of exemplary embodiments that are explained with the aid of the drawings, in which: 
       FIG. 1  shows a schematic of an automation system simulation with an asynchronous simulation clock according to the prior art, 
       FIG. 2  shows a scheme of a coordinated simulation in a network, 
       FIG. 3  shows a scheme of a coordinated simulation on an individual computer, and 
       FIG. 4  shows a scheme of a coordinated simulation on an individual computer with a two-phase timing coordination. 
   

   DETAILED DESCRIPTION OF PREFERRED EMBODIMENTS 
     FIG. 1  shows a schematic of a simulation of an automation system according to the prior art in the case of which the individual system components are interconnected via a network  1 . Serving here as control component  2  is a real control hardware in the form of a programmable controller (SPS). A drive simulation  3 , a kinematics simulation  4  and a process simulation  5  are provided as simulation components. Each system component  2 ,  3 ,  4 ,  5  has an external clock generator  6 ,  7 ,  8 ,  9  such that the individual system components  2 ,  3 ,  4 ,  5  run independently of one another with a dedicated clock system in each case. 
     FIG. 2  shows a device  10  for simulating an automation system in accordance with the invention. This comprises as control component a software-based control emulation  11 , running on a computer, of an SPS, as well as a number of software-based simulation components running on individual computers, specifically a drive simulation  12 , a kinematics simulation  13  and a process simulation  14 . 
   Instead of the software-based control emulation, it is also possible to use a controller hardware with a special firmware that supports the external synchronization. In this case, all the system components  11 ,  12 ,  13 ,  14  are interconnected via a network  15 . 
   Each system component  11 ,  12 ,  13 ,  14  has an interface  16  via which the system clock of the respective component  11 ,  12 ,  13 ,  14  can be controlled via an external timing coordinator  17 . The interface  16  is designed in the manner of a clock/acknowledge module. In other words, in addition to the clock function (clock), an acknowledge function is also provided in such a way that the external timing coordinator  17  receives an acknowledge relating to the termination of the clock cycle after each clock cycle of a system component  11 ,  12 ,  13 ,  14 . The use of the acknowledge signal is superfluous if a fixed timing pattern is used instead of this time-variable system. The interface can then be designed without this functionality. 
   The external timing coordinator  17 , which is implemented as software on a computer, comprises the functionality of a signal source  18  and a signal sink  19 . The coordination of the system runs clock runs as follows in this case: the signal source  18  of the timing coordinator  17  sends a corresponding clock signal  20  to the clock interface  16  of the control emulation  11 . After processing of the clock pulse, an acknowledgement  21  of the control emulation  11  passes from the acknowledge interface  16  to the signal sink  19  of the timing coordinator  17 . Following thereupon, a clock signal  20  is transmitted from the signal source  18  of the timing coordinator  17  to the clock interface  16  of the drive simulation  12 , and following the processing of the clock signal a corresponding acknowledgement  21  passes from the acknowledge interface  16  of the drive simulation  12  back to the signal sink  19  of the timing coordinator  17 . The coordination is performed correspondingly in the case of the kinematics simulation  13  and the process simulation  14 . 
   Such an automation simulation is particularly easy to operate when the system components  11 ,  12 ,  13 ,  14  are not distributed in a network  15  but run separately on a single simulation computer  22 . Such an embodiment of the invention is illustrated in  FIG. 3 . 
   If the aim is to coordinate not only the clock pulse, but also the data exchange between the individual system components  11 ,  12 ,  13 ,  14 , the clock/acknowledge interface  16  of each system component  11 ,  12 ,  13 ,  14  is supplemented by a load input  23 , compare  FIG. 4 . The timing coordinator  17  then operates in a two-phase method. In this case, all the system components  11 ,  12 ,  13 ,  14  are clocked in a first phase. Here, a state vector provided for each system component  11 ,  12 ,  13 ,  14  changes whilst a respective output vector is kept constant (clock/acknowledge interface). In a second phase, the state vector of the individual system components  11 ,  12 ,  13 ,  14  is then kept constant while the output vector is updated in accordance with the transfer function of the state vector (load interface). 
   The coordination of the system clock is performed in this case in such a way that a consistent output value is always present at the communication outputs  24  of the individual system components  11 ,  12 ,  13 ,  14  within a clock pulse. In other words, it is ensured that the output value of a system component  11 ,  12 ,  13 ,  14  is not changed during the calculating time, since otherwise the remaining system components  11 ,  12 ,  13 ,  14  would process defective input values. For example, if the control emulation  11  of the drive simulation  12  transfers via a communication connection  25  the instruction to increase the operating current, this has the effect, for example, of effecting in the simulated drive a specific change in the speed of a drive motor that must, in turn, be acknowledged to the control emulation  11  by the drive simulation  12 , the control emulation  11  determining from this acknowledgement a renewed current value for transmission to the drive simulation  12 . If the various system components  11 ,  12 ,  13 ,  14  are operating with different clock pulses, it must be ensured that a consistent output value is always present at the communication outputs  24  of the individual system components  11 ,  12 ,  13 ,  14 , for example at the output of the drive simulation  12 , within a clock pulse. This is particularly important with regard to the fact that this output value is used not only by the control emulation  11 , but also by the kinematics simulation  13 . Proceeding from a system instant t( 0 ), each system component  11 ,  12 ,  13 ,  14  initially attempts to calculate its own state for this instant t( 0 ). However, to this end the system components  11 ,  12 ,  13 ,  14  require information from the other system components  11 ,  12 ,  13 ,  14  at the instant t( 0 ). If, for example, the drive simulation  12  now firstly performs a calculation, it calculates its state at the instant t( 1 ) on the basis of its state at the instant t( 0 ). If the kinematics simulation  13  subsequently requires data from the drive simulation  12 , it must be ensured that the kinematics simulation  13  has not already received the data for the instant t( 1 ), since it is necessary to have calculated the step t( 0 ) to t( 1 ) in advance. In other words, it must be ensured that the data of the drive simulation  12  are still available from the instant t( 0 ) for the kinematics simulation  13 . 
   Otherwise expressed, a distinction is made for each system component  11 ,  12 ,  13 ,  14  and each instant t between an internal state vector and an external output vector. In this case, each of these vectors is designed as a type of data record that displays the instantaneous current value, the instantaneous performance or the instantaneous speed etc. The state vector is designed in this case in such a way that it is visible only within a system component  11 ,  12 ,  13 ,  14 , while the output vector provides information for communication with other system components  11 ,  12 ,  13 ,  14 . 
   If such a refinement with state vector and output vector were not provided, the simulation of the automation system would be dependent on the processing sequence within the individual system components  11 ,  12 ,  13 ,  14 . However, it is thus possible for the respectively next state vector already to be calculated internally without changing the output vector in the process. The sequence of the internal processing therefore no longer plays a role. Since it is exclusively the output vectors that are relevant for the data exchange, the processing sequence can be optimized according to other points of view. 
   In order to execute this functionality, the timing coordinator has a further signal source  26  from which appropriate control signals  27  are sent to the load interfaces  23  of the system components  11 ,  12 ,  13 ,  14 .