WO2015124170A1 - Method and apparatus for emulating a programmable logic controller - Google Patents

Method and apparatus for emulating a programmable logic controller Download PDF

Info

Publication number
WO2015124170A1
WO2015124170A1 PCT/EP2014/053120 EP2014053120W WO2015124170A1 WO 2015124170 A1 WO2015124170 A1 WO 2015124170A1 EP 2014053120 W EP2014053120 W EP 2014053120W WO 2015124170 A1 WO2015124170 A1 WO 2015124170A1
Authority
WO
WIPO (PCT)
Prior art keywords
time
virtual
cycle
program
real
Prior art date
Application number
PCT/EP2014/053120
Other languages
German (de)
French (fr)
Inventor
Gustavo Quiros Araya
Rene Ermler
Original Assignee
Siemens Aktiengesellschaft
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Siemens Aktiengesellschaft filed Critical Siemens Aktiengesellschaft
Priority to PCT/EP2014/053120 priority Critical patent/WO2015124170A1/en
Publication of WO2015124170A1 publication Critical patent/WO2015124170A1/en

Links

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B17/00Systems involving the use of models or simulators of said systems
    • G05B17/02Systems involving the use of models or simulators of said systems electric
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/05Programmable logic controllers, e.g. simulating logic interconnections of signals according to ladder diagrams or function charts
    • G05B19/058Safety, monitoring
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/10Plc systems
    • G05B2219/13Plc programming
    • G05B2219/13186Simulation, also of test inputs

Definitions

  • the present invention relates to a method for emulating a programmable logic controller according to the preamble of claim 1. Moreover, the present invention relates to a device for emulating a programmable logic controller according to the preamble of claim 9.
  • a programmable logic controller PLC
  • a non-real-time platform for example, Microsoft Windows operating system
  • the duration of execution of a program cycle is unpredictable and unpredictable, because this can in principle be delayed arbitrarily due to the execution of concurrent processes. If the virtual duration of the emulation is represented as a linear map of the real time required to emulate the program cycle, then the emulation is prone to misleading cycle timeouts.
  • cycle time violations in PLC emulation can be reported (for example, by alarms), which have external platform-related causes and are meaningless for the emulation.
  • time delays for the cyclic execution must be inserted in cycle time overruns in order to avoid overlapping of the successive time phases.
  • a linear mapping of the real time axis to a virtual time axis is used in the emulation of SPS.
  • a suitable increase for the linear mapping is selected. This can be determined, for example, by estimating the execution time of the program cycle during the PLC simulation. This approach avoids misleading cycle time overruns only on average chen versions in which the underlying operating system is used to a limited extent. Otherwise, the approach is vulnerable to the above problem. Although the alarms for cycle time violations could be suppressed, time shifts are unavoidable.
  • the method according to the invention for emulating a programmable logic controller comprises the provision of a computing device with an operating system which makes reference to a memory-programmable controller
  • Real-time requirement mapping a real time period to a virtual time period based on a predetermined function, predetermining a threshold for the virtual time required to emulate the at least one program cycle of a program of the programmable controller, emulating the at least one program cycle with the computing device and checking for a presence of a cycle timeout of the emulated program cycle in response to the threshold, mapping the real time period to the virtual time based on an asymptotic function.
  • a non-real-time computing device or a non real-time capable platform is used.
  • a computer with a Microsoft Windows operating system can be used.
  • the program of the programmable logic controller can be divided into several program cycles, for example, each having the same time duration. In this case, first a first program cycle is simulated with the computing device. Following this, the remaining program cycles can be emulated. This determines the virtual time required to emulate the program cycle. This virtual time period is compared to a threshold. If this limit is exceeded, for example, a cycle time violation can be concluded.
  • the real time of the PLC is first mapped to the virtual time period based on a predetermined mapping rule.
  • the real time duration is mapped onto the virtual time duration on the basis of an asymptotic function.
  • the virtual time period initially increases faster compared to the real time period and slows down towards the end of the program cycle.
  • reaching the predetermined limit value can be avoided.
  • misleading cycle time violations caused, for example, by concurrent processes of the non-real-time computing device can be avoided.
  • the asymptotic function mapping the real time period to the virtual time period approaches the predetermined threshold.
  • the limit value can be determined, for example, in advance of the emulation based on a maximum cycle duration of the program cycle.
  • the limit value can be determined during the engineering of the programmable logic controller.
  • the asymptotic function with which the real time duration is mapped onto the virtual time duration is preferred. directly proportional to the real time duration. Thus, asymptotic behavior can be easily used to model the progression of virtual time.
  • the asymptotic function with which the real time duration is mapped to the virtual time duration corresponds to a step response of a transmission element which has a proportional transmission behavior in a first-order delay.
  • the progress of the virtual time can be modeled on the basis of a step response of a PTI element. In this way, a corresponding asymptotic course of the virtual time duration can be modeled.
  • the computing device preferably comprises a virtual timer with which a virtual time is set when the emulation of the program cycle starts.
  • the emulator can have an internal clock with which the virtual time of the emulator or the computing device can be manipulated.
  • the current time of the virtual time can be set explicitly.
  • the virtual clock of the computing device can be arbitrarily set in the simulation environment.
  • the virtual time is determined by the virtual timer from a system time of the operating system of the computing device. With the PLC emulation the system time of the operating system can be used, which corresponds to the real time of the simulation environment. Thus, the virtual time can be calculated from the system time of the operating system.
  • the virtual time from the system time of the operating system is mapped using an asymptotic function.
  • the time advance of the virtual time can be calculated similarly to the above-mentioned asymptotic function.
  • faulty cycle time violations can be avoided.
  • a second program cycle of a second program is emulated with a second computing device.
  • various programmable logic controllers can be emulated simultaneously. In this way, a real system of a programmable logic controller can be modeled more accurately.
  • the device according to the invention for emulating a memory-programmable controller comprises a computing device with an operating system which is insufficient with respect to a real-time request made to the programmable controller, wherein the computing device is designed to emulate at least one program cycle of a program of the programmable logic controller with the computing device and wherein the device is configured to map a real time period to a virtual time period based on a predetermined function, to predetermine a limit value for the virtual time period required to emulate the at least one program cycle, and to provide a cycle timeout of the emulated program cycle depending on the limit value
  • the device is designed to map the real time duration to the virtual time duration on the basis of an asymptotic function.
  • Emulation of the programs is shown; 3 shows a diagram in which the temporal behavior of an emulated programmable logic controller is shown;
  • Time duration is represented on a virtual time period based on asymptotic functions
  • FIG. 5 shows a diagram which shows the difference between a linear mapping and an asymptotic mapping of the real time duration to the virtual time duration.
  • FIG. 1 shows a diagram 10 in which the time profile for a real system with two programmable logic controllers and two processes is shown.
  • the course of the real time duration t R is shown on a time axis.
  • the time course of a program 12 of a first programmable logic controller is shown.
  • the time course of a program 14 of a second programmable logic controller is shown.
  • the time course of a third and a fourth program 16, 18 is shown, which are simulated, for example.
  • the programs 12, 14, 16, 18 are each divided into predetermined program cycles, which in particular have the same time phases A, B. In the real system according to FIG. 1, all four arithmetic units execute the programs 12, 14, 16, 18 simultaneously.
  • FIG. 1 shows a diagram 10 in which the time profile for a real system with two programmable logic controllers and two processes is shown.
  • the course of the real time duration t R is shown on a time axis.
  • FIG. 2 shows a possible chronological progression of the programs 12, 14, 16, 18 according to FIG. 1 for a corresponding emulation.
  • the time phases A, B for the respective units are successively discharged one after the other. so that in the real time axis t R each time phase A, B occurs several times.
  • the virtual time t v corresponds to the real time axis of the simulated system and, in the case of simulation or emulation, forms a discontinuous sequence of timeline segments over the real time axis of the simulation system.
  • the overlapping of the segments on the real time axis t R is possible because of a parallel execution of the units. This is shown in FIG.
  • FIG 3 shows the temporal behavior of an emulated programmable logic controller for the first program 12 in a diagram 24.
  • a basic cycle time of 100 ms is specified for the user program.
  • the program 12 is thus divided into program cycles with the determined basic cycle time.
  • the emulated PLC executes each program cycle individually, analogous to the phased implementation of FIG 1. Since the real time t R and the virtual time t v are decoupled, each program cycle can begin before or after the corresponding real time of the cycle timing. However, at each beginning of the cycle, a virtual clock in the computing device can be reset so that the execution always starts with a correct virtual time.
  • the actual duration of the execution of the program - measured on the real time axis t R - depends on the underlying operating system and can in principle deviate arbitrarily from the targeted cycle time of 100 ms. However, exceeding the maximum cycle time does not mean that a cycle time violation has or would have occurred in the user program. In general, such an infringement when emulated on a non-real-time system (for example, Microsoft Windows) is not clearly identifiable and should therefore be excluded. On the other hand, these border crossings would have to be avoided because otherwise two consecutive virtual time phases could overlap. This raises the question of how the virtual time t v during the execution of the program cycle should progress. Here, different approaches can be followed.
  • no advance of the virtual time can be provided.
  • the virtual clock stops during the cycle and thus does not exceed the planned cycle time.
  • This approach would be easy to implement, but leads to the problem that all events that occur during the cycle show the same timestamp. For example, the causality of alarms on the basis of a time sequence in an operating system would not be recognizable. Therefore, an advance of the virtual time t v during execution of a program cycle is desired.
  • Another approach would be the linear progression of the virtual time t v .
  • the virtual time increases linearly with the real time t R. This can be made possible for example by the use of a counter or a linear mapping function of the real time t R. Although the time progress is given, an overlap of the planned cycle time is also possible.
  • an asymptotic advance of the virtual time t v is considered.
  • the virtual time rises asymptotically with the real time t R to a limit value T.
  • the limit value T is the time limit for the maximum cycle duration. This means that the virtual time t v runs faster at the beginning of the cycle and slows to the end of the cycle to avoid reaching the time limit. According to this approach, the time progress within the cycle is guaranteed and at the same time an exceeding of the planned cycle time is excluded. Theoretically, these two properties are always met, even with arbitrarily long execution times. In practice, however, one encounters the limitation of the finite resolution of the time values.
  • T and D are used, where T is the limit value for the asymptotic function and D is a factor with which an approaching speed to the limit value T can be set.
  • a function corresponding to a step response of a PT1 element may be used for the modeling of the progress of the virtual time t v .
  • FIG 4 graphically illustrates the asymptotic progress of the virtual time t v (vertical axis) with the real time t R (horizontal axis).
  • the threshold value T in the present embodiment corresponds to ten time units.
  • four functions are exemplified.
  • the graph 26 of the figure according to equation (1), with D 10.
  • a general observation is that the maps according to equation (2) reach the limit faster than the maps according to equation (1). With a suitable selection of the value D, however, both functions should be useful for modeling and implementing virtual time progress.
  • each simulation device or simulator of the simulation environment must have an internal clock which stores the virtual time t v for this unit (in addition to the real time of the simulation environment). This clock must enable the explicit manipulation of the virtual time t v of the emulator by setting the current time.
  • the current time of the virtual clock can in particular be set explicitly. This allows the clock to "spin" both forward and backward and is effectively used to "jump into time”. Based on this operation, the virtual clocks of the emulators in the simulation environment can be set arbitrarily. At the start of the cycle, the virtual clock with the appropriate value for the beginning of the cycle can be set for each emulator. In any case, the control of the simulation environment ensures that the individual internal virtual clocks of the respective emulation units remain synchronized during the simulation.
  • the system time of a real PLC is usually continued via timer interrupts and updated to new values.
  • the system can instead be used by the operating system, which corresponds to the real time t R of the simulation environment and which has not been modified by the emulator.
  • a useful approach for the virtual clock of the PLC simulation is therefore to calculate the virtual time from the system time of the operating system. For this calculation the functions mentioned for the time progress can be used.
  • mapping of the real time t R to the virtual time t v in a PLC simulation is based on an asymptotic function, while the mapping function used hitherto is usually linear in simulation programs. Unlike linear
  • FIG. 4 shows a diagram 34 in which the behavior of a linear time map (curve 36) and an asymptotic time map (curve 38) are shown.
  • a limit value T of 10 ten units is considered.
  • the increase in linear mapping corresponds to a factor of 0.1.
  • the approaching speed factor D in the asymptotic mapping corresponds to the value 5.
  • the linear time map (curve 36) reaches the limit value 10 of the virtual time t v at a real time t R of 100. This results in two possible situations in the execution of a program cycle. First, the execution is completed under 100 real time units t R. Regardless of the approach used, no misleading cycle time violation is caused. Alternatively, the embodiment requires 100 or more real time units t R. This can be the case, for example, with a higher load on the operating system. In linear time mapping, a cycle time violation occurs. As a result, the alarm is triggered and detects a time shift in the next execution of the next program cycle. Asymptotic time mapping still does not cause a misleading cycle time violation. Using the smaller increase in linear imaging reduces the likelihood of cycle time violations in the emulation, but never completely eliminates this problem. The presented asymptotic approach solves this problem for all possible execution times.

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Programmable Controllers (AREA)

Abstract

The invention relates to a method for emulating a programmable logic controller by providing a computation device having an operating system that is inadequate in terms of a real-time demand made of the programmable logic controller, mapping a real period (tR) onto a virtual period (tv) using a predetermined function, predetermining a limit value (T) for the virtual period (tv) that is needed for emulating at least one program cycle of a program (12) of the programmable logic controller; emulating the at least one program cycle with the computation device, and checking the presence of a cycle time overshoot in the emulated program cycle on the basis of the limit value (T), wherein the real period (tR) is mapped onto the virtual period (tv) using an asymptotic function.

Description

Beschreibung description
Verfahren und Vorrichtung zum Emulieren einer Method and device for emulating a
speicherprogrammierbaren Steuerung Programmable logic controller
Die vorliegende Erfindung betrifft ein Verfahren zum Emulieren einer speicherprogrammierbaren Steuerung gemäß dem Oberbegriff von Patentanspruch 1. Überdies betrifft die vorliegende Erfindung eine Vorrichtung zum Emulieren einer spei- cherprogrammierbaren Steuerung gemäß dem Oberbegriff von Patentanspruch 9. The present invention relates to a method for emulating a programmable logic controller according to the preamble of claim 1. Moreover, the present invention relates to a device for emulating a programmable logic controller according to the preamble of claim 9.
Bei der Emulation einer speicherprogrammierbaren Steuerung (SPS) auf einer nicht Echtzeitplattform (zum Beispiel Micro- soft Windows Betriebssystem) ist die Dauer der Ausführung eines Programmzyklus unberechenbar und unvorhersehbar, weil sich diese aufgrund von Ausführung nebenläufiger Prozesse im Prinzip beliebig verzögern kann. Wenn die virtuelle Zeitdauer der Emulation als eine lineare Abbildung der realen Zeitdau- er, die zum Emulieren des Programmzyklus benötigt wird, dargestellt ist, dann ist die Emulation für irreführende Zykluszeitüberschreitungen anfällig. When emulating a programmable logic controller (PLC) on a non-real-time platform (for example, Microsoft Windows operating system), the duration of execution of a program cycle is unpredictable and unpredictable, because this can in principle be delayed arbitrarily due to the execution of concurrent processes. If the virtual duration of the emulation is represented as a linear map of the real time required to emulate the program cycle, then the emulation is prone to misleading cycle timeouts.
Damit werden zwei Probleme verursacht. Zum einen können Zyk- luszeitverletzungen bei der SPS -Emulation gemeldet werden (zum Beispiel durch Alarme), die externe plattformbedingte Ursachen haben und für die Emulation bedeutungslos sind. Zum anderen müssen bei Zykluszeitüberschreitungen Zeitverschiebungen für die zyklische Ausführung eingefügt werden, um Überlappungen der sukzessiven Zeitphasen zu vermeiden. This causes two problems. On the one hand, cycle time violations in PLC emulation can be reported (for example, by alarms), which have external platform-related causes and are meaningless for the emulation. On the other hand, time delays for the cyclic execution must be inserted in cycle time overruns in order to avoid overlapping of the successive time phases.
Üblicherweise wird eine lineare Abbildung der realen Zeitachse auf eine virtuelle Zeitachse bei der Emulation von SPS verwendet. Hierbei wird ein passender Anstieg für die lineare Abbildung gewählt. Dieser kann beispielsweise durch eine Schätzung der Ausführungsdauer des Programmzyklus bei der SPS-Simulation bestimmt werden. Dieser Ansatz vermeidet irreführende Zykluszeitüberschreitungen nur bei durchschnittli - chen Ausführungen, bei denen das unterliegende Betriebssystem begrenzt ausgelastet ist. Ansonsten ist der Ansatz für das oben genannte Problem anfällig. Obwohl die Alarme für Zyklus - Zeitverletzungen dabei unterdrückt werden könnten, sind aber Zeitverschiebungen nicht vermeidbar. Usually, a linear mapping of the real time axis to a virtual time axis is used in the emulation of SPS. Here a suitable increase for the linear mapping is selected. This can be determined, for example, by estimating the execution time of the program cycle during the PLC simulation. This approach avoids misleading cycle time overruns only on average chen versions in which the underlying operating system is used to a limited extent. Otherwise, the approach is vulnerable to the above problem. Although the alarms for cycle time violations could be suppressed, time shifts are unavoidable.
Es ist Aufgabe der vorliegenden Erfindung, einen Weg aufzuzeigen, wie eine speicherprogrammierbare Steuerung zuverlässiger emuliert werden kann. It is an object of the present invention to provide a way to more reliably emulate a programmable logic controller.
Diese Aufgabe wird durch ein Verfahren mit den Merkmalen des Patentanspruch 1 sowie eine Vorrichtung mit den Merkmalen des Patentanspruchs 9 gelöst. Vorteilhafte Weiterbildungen der vorliegenden Erfindung sind Gegenstand der abhängigen Ansprü- che. This object is achieved by a method having the features of patent claim 1 and a device having the features of patent claim 9. Advantageous developments of the present invention are the subject of the dependent claims.
Das erfindungsgemäße Verfahren zum Emulieren einer speicherprogrammierbaren Steuerung umfasst das Bereitstellen einer Recheneinrichtung mit einem Betriebssystem, welches bezüglich einer an die speicherprogrammierbare Steuerung gestellteThe method according to the invention for emulating a programmable logic controller comprises the provision of a computing device with an operating system which makes reference to a memory-programmable controller
Echtzeitanforderung ungenügend ist, das Abbilden einer realen Zeitdauer auf eine virtuelle Zeitdauer anhand einer vorbestimmten Funktion, das Vorbestimmen eines Grenzwerts für die zum Emulieren des zumindest einen Programmzyklus eines Pro- gramms der speicherprogrammierbaren Steuerung benötigte virtuelle Zeitdauer, das Emulieren des zumindest eines Programmzyklus mit der Recheneinrichtung und das Überprüfen eines Vorhandenseins einer Zykluszeitüberschreitung des emulierten Programmzyklus in Abhängigkeit von dem Grenzwert, wobei die reale Zeitdauer auf die virtuelle Zeitdauer anhand einer asymptotischen Funktion abgebildet wird. Real-time requirement, mapping a real time period to a virtual time period based on a predetermined function, predetermining a threshold for the virtual time required to emulate the at least one program cycle of a program of the programmable controller, emulating the at least one program cycle with the computing device and checking for a presence of a cycle timeout of the emulated program cycle in response to the threshold, mapping the real time period to the virtual time based on an asymptotic function.
Zum Emulieren der speicherprogrammierbaren Steuerung (SPS) wird eine nicht echtzeitfähige Recheneinrichtung bzw. eine nicht echtzeitfähige Plattform verwendet. Beispielsweise kann ein Rechner mit einem Microsoft Windows Betriebssystem verwendet werden. Das Programm der speicherprogrammierbaren Steuerung kann in mehrere Programmzyklen eingeteilt werden, die beispielsweise jeweils die selbe Zeitdauer aufweisen. Dabei wird mit der Recheneinrichtung zunächst ein erster Programmzyklus simuliert. Im Anschluss daran können die übrigen Programmzyklen emuliert werden. Dabei wird die virtuelle Zeitdauer bestimmt, die zum Emulieren des Programmzyklus benötigt wurde. Diese virtuelle Zeitdauer wird mit einem Grenzwert vergleichen. Wenn dieser Grenzwert überschritten wird, kann beispielsweise auf eine Zykluszeitverletzung geschlossen werden . To emulate the programmable logic controller (PLC), a non-real-time computing device or a non real-time capable platform is used. For example, a computer with a Microsoft Windows operating system can be used. The program of the programmable logic controller can be divided into several program cycles, for example, each having the same time duration. In this case, first a first program cycle is simulated with the computing device. Following this, the remaining program cycles can be emulated. This determines the virtual time required to emulate the program cycle. This virtual time period is compared to a threshold. If this limit is exceeded, for example, a cycle time violation can be concluded.
Die reale Zeit der SPS wird hierzu zunächst auf die virtuelle Zeitdauer anhand einer vorbestimmten Abbildungsvorschrift abgebildet. Vorliegend wird die reale Zeitdauer auf die virtuelle Zeitdauer anhand einer asymptotischen Funktion abgebil- det . Im Vergleich zu einer üblicherweise verwendeten linearen Abbildung der realen Zeitdauer auf die virtuelle Zeitdauer steigt die virtuelle Zeitdauer im Vergleich zur realen Zeitdauer zunächst schneller an und verlangsamt sich zum Ende des Programmzyklus hin. Somit kann ein Erreichen des vorbestimm- ten Grenzwerts vermieden werden. Somit können irreführende Zykluszeitverletzungen, die beispielsweise in Folge von nebenläufigen Prozessen der nicht echtzeitfähigen Recheneinrichtung verursacht wurden, vermieden werden. In einer Ausführungsform nähert sich die asymptotische Funktion, mit der die reale Zeitdauer auf die virtuelle Zeitdauer abgebildet wird, an den vorbestimmten Grenzwert an. Der Grenzwert kann beispielsweise im Vorfeld der Emulation anhand einer maximalen Zyklusdauer des Programmzyklus ermittelt wer- den. Beispielsweise kann der Grenzwert während des Engineerings der speicherprogrammierbaren Steuerung ermittelt werden. Somit kann zuverlässig ermittelt werden, ob bei dem Emulieren Zykluszeitüberschreitungen auftreten, wobei durch die asymptotische Abbildung nebenläufige Prozesse der Rechenein- richtung vernachlässigt werden. The real time of the PLC is first mapped to the virtual time period based on a predetermined mapping rule. In the present case, the real time duration is mapped onto the virtual time duration on the basis of an asymptotic function. Compared to a commonly used linear mapping of the real time period to the virtual time period, the virtual time period initially increases faster compared to the real time period and slows down towards the end of the program cycle. Thus, reaching the predetermined limit value can be avoided. Thus, misleading cycle time violations caused, for example, by concurrent processes of the non-real-time computing device can be avoided. In one embodiment, the asymptotic function mapping the real time period to the virtual time period approaches the predetermined threshold. The limit value can be determined, for example, in advance of the emulation based on a maximum cycle duration of the program cycle. For example, the limit value can be determined during the engineering of the programmable logic controller. Thus, it can be reliably determined whether cycle time overruns occur in the emulation, whereby concurrent processes of the arithmetic unit are neglected due to the asymptotic mapping.
Bevorzugt ist die asymptotische Funktion, mit der die reale Zeitdauer auf die virtuelle Zeitdauer abgebildet wird, indi- rekt proportional zu der realen Zeitdauer. Somit kann auf einfache Weise ein asymptotisches Verhalten für die Modellierung des Fortschritts der virtuellen Zeit verwendet werden. In einer weiteren Ausgestaltung entspricht die asymptotische Funktion, mit der die reale Zeitdauer auf die virtuelle Zeitdauer abgebildet wird, einer Sprungantwort eines Übertragungsglieds, das ein proportionales Übertragungsverhalten in einer Verzögerung erster Ordnung aufweist. Mit anderen Worten kann der Fortschritt der virtuellen Zeit anhand einer Sprungantwort eines PTl-Gliedes modelliert werden. Auf diese Weise kann ein entsprechender asymptotischer Verlauf der virtuellen Zeitdauer modelliert werden. Bevorzugt umfasst die Recheneinrichtung einen virtuellen Zeitgeber, mit dem bei einem Start der Emulation des Programmzyklus eine virtuelle Uhrzeit eingestellt wird. Der Emulator kann eine interne Uhr besitzen, mit der die virtuelle Zeit des Emulators bzw. der Recheneinrichtung manipuliert werden kann. Dabei kann die aktuelle Zeit der virtuellen Uhrzeit explizit gesetzt werden. Somit kann die virtuelle Uhr der Recheneinrichtung in der Simulationsumgebung beliebig gesetzt werden. In einer Ausgestaltung wird die virtuelle Uhrzeit von dem virtuellen Zeitgeber aus einer Systemzeit des Betriebssystems der Recheneinrichtung bestimmt. Bei der SPS-Emulation kann die Systemzeit des Betriebssystems benutzt werden, welche der realen Zeit der Simulationsumgebung entspricht. Somit kann die virtuelle Uhrzeit aus der Systemzeit des Betriebssystems berechnet werden. The asymptotic function with which the real time duration is mapped onto the virtual time duration is preferred. directly proportional to the real time duration. Thus, asymptotic behavior can be easily used to model the progression of virtual time. In a further embodiment, the asymptotic function with which the real time duration is mapped to the virtual time duration corresponds to a step response of a transmission element which has a proportional transmission behavior in a first-order delay. In other words, the progress of the virtual time can be modeled on the basis of a step response of a PTI element. In this way, a corresponding asymptotic course of the virtual time duration can be modeled. The computing device preferably comprises a virtual timer with which a virtual time is set when the emulation of the program cycle starts. The emulator can have an internal clock with which the virtual time of the emulator or the computing device can be manipulated. The current time of the virtual time can be set explicitly. Thus, the virtual clock of the computing device can be arbitrarily set in the simulation environment. In one embodiment, the virtual time is determined by the virtual timer from a system time of the operating system of the computing device. With the PLC emulation the system time of the operating system can be used, which corresponds to the real time of the simulation environment. Thus, the virtual time can be calculated from the system time of the operating system.
In einer Ausgestaltung wird die virtuelle Uhrzeit aus der Systemzeit des Betriebssystems anhand einer asymptotischen Funktion abgebildet. Somit kann der Zeitfortschritt der virtuellen Uhrzeit ähnlich der oben erwähnten asymptotischen Funktion berechnet werden. Auf diese Weise können fehlerhafte Zykluszeitverletzungen vermieden werden. Bevorzugt wird parallel zu dem zumindest einen Programmzyklus ein zweiter Programmzyklus eines zweiten Programms mit einer zweiten Recheneinrichtung emuliert. Somit können verschiedene speicherprogrammierbare Steuerungen zeitgleich emuliert werden. Auf diese Weise kann ein reales System einer speicherprogrammierbaren Steuerung genauer nachgebildet werden. In one embodiment, the virtual time from the system time of the operating system is mapped using an asymptotic function. Thus, the time advance of the virtual time can be calculated similarly to the above-mentioned asymptotic function. In this way, faulty cycle time violations can be avoided. Preferably, parallel to the at least one program cycle, a second program cycle of a second program is emulated with a second computing device. Thus, various programmable logic controllers can be emulated simultaneously. In this way, a real system of a programmable logic controller can be modeled more accurately.
Die erfindungsgemäße Vorrichtung zum Emulieren einer spei- cherprogrammierbaren Steuerung umfasst eine Recheneinrichtung mit einem Betriebssystem, welches bezüglich einer an die speicherprogrammierbare Steuerung gestellte Echtzeitanforderung ungenügend ist, wobei die Recheneinrichtung dazu ausgebildet ist, zumindest einen Programmzyklus eines Programms der speicherprogrammierbaren Steuerung mit der Recheneinrichtung zu emulieren und wobei die Vorrichtung dazu ausgebildet ist, eine reale Zeitdauer auf eine virtuelle Zeitdauer anhand einer vorbestimmten Funktion abzubilden, einen Grenzwerts für die zum Emulieren des zumindest einen Programmzyklus benötig- te virtuelle Zeitdauer vorzubestimmen und ein Vorhandensein einer Zykluszeitüberschreitung des emulierten Programmzyklus in Abhängigkeit von dem Grenzwert zu überprüfen, wobei die Vorrichtung dazu ausgebildet ist, die reale Zeitdauer auf die virtuelle Zeitdauer anhand einer asymptotischen Funktion ab- zubilden. The device according to the invention for emulating a memory-programmable controller comprises a computing device with an operating system which is insufficient with respect to a real-time request made to the programmable controller, wherein the computing device is designed to emulate at least one program cycle of a program of the programmable logic controller with the computing device and wherein the device is configured to map a real time period to a virtual time period based on a predetermined function, to predetermine a limit value for the virtual time period required to emulate the at least one program cycle, and to provide a cycle timeout of the emulated program cycle depending on the limit value The device is designed to map the real time duration to the virtual time duration on the basis of an asymptotic function.
Die zuvor im Zusammenhang mit dem erfindungsgemäßen Verfahren beschriebenen Vorteile und Weiterbildungen gelten sinngemäß für die erfindungsgemäße Vorrichtung. The advantages and further developments described above in connection with the method according to the invention apply mutatis mutandis to the device according to the invention.
Die vorliegende Erfindung wird nun anhand der beigefügten Zeichnungen näher erläutert. Dabei zeigen: The present invention will now be explained in more detail with reference to the accompanying drawings. Showing:
FIG 1 ein Diagramm, in dem der Zeitverlauf für ein reales 1 shows a diagram in which the time course for a real
System mit mehreren Prozessen dargestellt ist;  System is shown with multiple processes;
FIG 2 ein Diagramm, in dem der zeitliche Verlauf bei der 2 shows a diagram in which the time course in the
Emulation der Programme dargestellt ist; FIG 3 ein Diagramm, in dem das zeitliche Verhalten einer emulierten speicherprogrammierbaren Steuerung dargestellt ist; Emulation of the programs is shown; 3 shows a diagram in which the temporal behavior of an emulated programmable logic controller is shown;
FIG 4 ein Diagramm, in dem die Abbildung einer realen 4 shows a diagram in which the image of a real
Zeitdauer auf eine virtuelle Zeitdauer anhand von asymptotischen Funktionen dargestellt ist; und  Time duration is represented on a virtual time period based on asymptotic functions; and
FIG 5 ein Diagramm, welches den Unterschied zwischen einer linearen Abbildung und einer asymptotischen Abbildung der realen Zeitdauer auf die virtuelle Zeitdauer zeigt. Die nachfolgen näher geschilderten Ausführungsbeispiele stellen bevorzugte Ausführungsformen der vorliegenden Erfindung dar . 5 shows a diagram which shows the difference between a linear mapping and an asymptotic mapping of the real time duration to the virtual time duration. The following detailed embodiments illustrate preferred embodiments of the present invention.
FIG 1 zeigt ein Diagramm 10, in dem der zeitliche Verlauf für ein reales System mit zwei speicherprogrammierbaren Steuerungen und zwei Prozessen dargestellt ist. Auf einer Zeitachse ist der Verlauf der realen Zeitdauer tR dargestellt. Dabei ist der zeitliche Verlauf eines Programms 12 einer ersten speicherprogrammierbaren Steuerung dargestellt. Weiterhin ist der zeitliche Verlauf eines Programms 14 einer zweiten speicherprogrammierbaren Steuerung gezeigt. Darüber hinaus ist der zeitliche Verlauf eines dritten und eines vierten Programms 16, 18 dargestellt, die beispielsweise simuliert werden. Dabei sind die Programme 12, 14, 16, 18 jeweils in vor- bestimmte Programmzyklen eingeteilt, die insbesondere gleiche Zeitphasen A, B aufweisen. Bei dem realen System gemäß FIG 1 führen alle vier Recheneinheiten die Programme 12, 14, 16, 18 gleichzeitig aus. FIG 2 zeigt einen möglichen zeitlichen Verlauf der Programme 12, 14, 16, 18 gemäß FIG 1 für eine entsprechende Emulation. Bei der Emulation bzw. Simulation werden die Zeitphasen A, B für die jeweiligen Einheiten sukzessive nacheinander abgear- beitet, so dass in der realen Zeitachse tR jede Zeitphase A, B mehrmals vorkommt. Die virtuelle Zeit tv entspricht aber der realen Zeitachse des simulierten Systems und bildet bei der Simulation bzw. Emulation eine diskontinuierliche Reihen- folge von Zeitliniensegmenten über die reale Zeitachse des Simulationssystems. Darüber hinaus ist die Überlappung der Segmente auf der realen Zeitachse tR wegen einer parallelen Ausführung der Einheiten möglich. Dies ist in FIG 3 dargestellt . 1 shows a diagram 10 in which the time profile for a real system with two programmable logic controllers and two processes is shown. The course of the real time duration t R is shown on a time axis. In this case, the time course of a program 12 of a first programmable logic controller is shown. Furthermore, the time course of a program 14 of a second programmable logic controller is shown. In addition, the time course of a third and a fourth program 16, 18 is shown, which are simulated, for example. The programs 12, 14, 16, 18 are each divided into predetermined program cycles, which in particular have the same time phases A, B. In the real system according to FIG. 1, all four arithmetic units execute the programs 12, 14, 16, 18 simultaneously. FIG. 2 shows a possible chronological progression of the programs 12, 14, 16, 18 according to FIG. 1 for a corresponding emulation. During emulation or simulation, the time phases A, B for the respective units are successively discharged one after the other. so that in the real time axis t R each time phase A, B occurs several times. However, the virtual time t v corresponds to the real time axis of the simulated system and, in the case of simulation or emulation, forms a discontinuous sequence of timeline segments over the real time axis of the simulation system. In addition, the overlapping of the segments on the real time axis t R is possible because of a parallel execution of the units. This is shown in FIG.
FIG 3 zeigt das zeitliche Verhalten einer emulierten speicherprogrammierbaren Steuerung für das erste Programm 12 in einem Diagramm 24. Vorliegend wird eine Basiszykluszeit von 100 ms für das Anwenderprogramm vorgegeben. Das Programm 12 wird also in Programmzyklen mit der bestimmten Basiszykluszeit eingeteilt. Die emulierte SPS führt jeden Programmzyklus einzeln aus, analog zur phasenweisen Ausführung gemäß FIG 1. Da die reale Zeitdauer tR und die virtuelle Zeitdauer tv entkoppelt sind, kann jeder Programmzyklus vor oder nach dem entsprechenden realen Zeitpunkt der Zyklustaktung anfangen. Allerdings kann bei jedem Zyklusanfang eine virtuelle Uhr in der Recheneinrichtung neu gesetzt werden, so dass die Ausführung immer mit einer korrekten virtuellen Uhrzeit startet. Die tatsächliche Dauer der Abarbeitung des Programms - auf der realen Zeitachse tR gemessen - ist abhängig vom unterliegenden Betriebssystem und kann im Prinzip beliebig von der gezielten Zykluszeit von 100 ms abweichen. Eine Überschreitung der maximalen Zykluszeit bedeutet aber nicht, dass eine Zykluszeitverletzung im Anwenderprogramm stattgefunden hat oder haben würde. Im Allgemeinen ist eine solche Verletzung bei einer Emulation auf einem nicht Echtzeitsystem (zum Beispiel Microsoft Windows) nicht sicher erkennbar und soll deswegen ausgeschlossen sein. Andererseits müssten diese Grenz- Überschreitungen vermieden werden, weil ansonsten zwei nacheinander liegende virtuelle Zeitphasen überlappen könnten. Damit entsteht die Frage, wie die virtuelle Zeit tv während der Ausführung des Programmzyklus fortschreiten soll. Hierbei können verschiedene Ansätze verfolgt werden. 3 shows the temporal behavior of an emulated programmable logic controller for the first program 12 in a diagram 24. In the present case, a basic cycle time of 100 ms is specified for the user program. The program 12 is thus divided into program cycles with the determined basic cycle time. The emulated PLC executes each program cycle individually, analogous to the phased implementation of FIG 1. Since the real time t R and the virtual time t v are decoupled, each program cycle can begin before or after the corresponding real time of the cycle timing. However, at each beginning of the cycle, a virtual clock in the computing device can be reset so that the execution always starts with a correct virtual time. The actual duration of the execution of the program - measured on the real time axis t R - depends on the underlying operating system and can in principle deviate arbitrarily from the targeted cycle time of 100 ms. However, exceeding the maximum cycle time does not mean that a cycle time violation has or would have occurred in the user program. In general, such an infringement when emulated on a non-real-time system (for example, Microsoft Windows) is not clearly identifiable and should therefore be excluded. On the other hand, these border crossings would have to be avoided because otherwise two consecutive virtual time phases could overlap. This raises the question of how the virtual time t v during the execution of the program cycle should progress. Here, different approaches can be followed.
Zum einen kann kein Fortschritt der virtuellen Zeit vorgese- hen sein. Hierbei bleibt die virtuelle Uhr während des Zyklus stehen und damit wird die geplante Zykluszeit nicht überschritten. Dieser Lösungsansatz wäre einfach zu realisieren, führt aber zu dem Problem, dass alle Ereignisse die während des Zyklus auftauchen, den gleichen Zeitstempel zeigen. Bei- spielsweise wäre die Kausalität von Alarmen auf der Basis einer zeitlichen Folge in einem Bediensystem nicht erkennbar. Deshalb ist ein Fortschritt der virtuellen Zeit tv während der Ausführung eines Programmzyklus erwünscht. Ein weiterer Ansatz wäre der lineare Fortschritt der virtuellen Zeit tv. Die virtuelle Uhrzeit steigt mit der realen Zeit tR linear an. Dies kann beispielsweise durch die Verwendung eines Zählers oder einer linearen Abbildungsfunktion der realen Zeit tR ermöglicht werden. Obwohl der Zeitfortschritt da- mit gegeben ist, ist eine Überschneidung der geplanten Zykluszeit ebenfalls möglich. On the one hand, no advance of the virtual time can be provided. The virtual clock stops during the cycle and thus does not exceed the planned cycle time. This approach would be easy to implement, but leads to the problem that all events that occur during the cycle show the same timestamp. For example, the causality of alarms on the basis of a time sequence in an operating system would not be recognizable. Therefore, an advance of the virtual time t v during execution of a program cycle is desired. Another approach would be the linear progression of the virtual time t v . The virtual time increases linearly with the real time t R. This can be made possible for example by the use of a counter or a linear mapping function of the real time t R. Although the time progress is given, an overlap of the planned cycle time is also possible.
Vorliegend wird ein asymptotischer Fortschritt der virtuellen Zeit tv betrachtet. Die virtuelle Uhrzeit steigt mit der rea- len Zeit tR asymptotisch zu einem Grenzwert T. Als Grenzwert T wird die Zeitgrenze für die maximale Zyklusdauer gewählt. Dies bedeutet, dass die virtuelle Zeit tv am Anfang des Zyklus schneller läuft, und sich zum Ende des Zyklus verlangsamt, um eine Erreichung der Zeitgrenze zu vermeiden. Nach diesem Ansatz ist der Zeitfortschritt innerhalb des Zyklus gewährleistet und gleichzeitig ist eine Überschreitung der geplanten Zykluszeit ausgeschlossen. Theoretisch sind diese beiden Eigenschaften immer erfüllt, selbst bei beliebig langen Ausführungsdauern . In der Praxis trifft man aber auf die Einschränkung der endlichen Auflösung der Zeitwerte. Aus diesem Grund soll in jedem Fall eine asymptotische Funktion gewählt werden, die für die üblichen maximalen Ausführungszei - ten entsprechend geeignet ist. Eine Voraussetzung für die Verwendung dieses Ansatzes ist jedoch, dass eine lineare Entwicklung der Zeit innerhalb eins Zyklus nicht zwingend erforderlich ist. Die Modellierung des Fortschritts der virtuellen Zeit tv kann beispielsweise mittels einer Funktion erfolgen, die indirekt proportional zu der realen Zeit tR ist. Beispielsweise kann eine Funktion f (t) nach folgender Formel verwendet werden:
Figure imgf000011_0001
In the present case, an asymptotic advance of the virtual time t v is considered. The virtual time rises asymptotically with the real time t R to a limit value T. The limit value T is the time limit for the maximum cycle duration. This means that the virtual time t v runs faster at the beginning of the cycle and slows to the end of the cycle to avoid reaching the time limit. According to this approach, the time progress within the cycle is guaranteed and at the same time an exceeding of the planned cycle time is excluded. Theoretically, these two properties are always met, even with arbitrarily long execution times. In practice, however, one encounters the limitation of the finite resolution of the time values. For this reason, an asymptotic function should be selected in each case, which is suitable for the usual maximum execution times. A requirement for the However, using this approach means that a linear evolution of time within one cycle is not mandatory. The modeling of the progress of the virtual time t v can be done, for example, by means of a function which is indirectly proportional to the real time t R. For example, a function f (t) can be used according to the following formula:
Figure imgf000011_0001
Hierbei werden die Parameter T und D verwendet, wobei T der Grenzwert für die asymptotische Funktion und D ein Faktor ist, mit dem eine Annäherungsgeschwindigkeit zu dem Grenzwert T eingestellt werden kann. Alternativ dazu kann für die Modellierung des Fortschritts der virtuellen Zeit tv eine Funktion verwendet werden, die einer Sprungantwort eines PT1- Gliedes entspricht. Eine derartige Funktion g(t) kann beispielsweise nach folgender Formel berechnet werden: g(t) = T . (\ - e ^) (2) In this case, the parameters T and D are used, where T is the limit value for the asymptotic function and D is a factor with which an approaching speed to the limit value T can be set. Alternatively, a function corresponding to a step response of a PT1 element may be used for the modeling of the progress of the virtual time t v . Such a function g (t) can be calculated, for example, according to the following formula: g (t) = T. (\ - e ^) (2)
FIG 4 stellt den asymptotischen Fortschritt der virtuellen Zeit tv (vertikale Achse) mit der realen Zeit tR (horizontale Achse) graphisch dar. Der Grenzwert T entspricht in dem vorliegenden Ausführungsbeispiel zehn Zeiteinheiten. In FIG 4 sind beispielhaft vier Funktionen dargestellt. Der Graph 26 der Abbildung gemäß Gleichung (1), mit D = 10. Der Graph 28 entspricht der Abbildung gemäß Gleichung (1) mit D = 50. Der Graph 30 entspricht der Abbildung gemäß Gleichung (2) mit D = 10. Der Graph 32 entspricht der Abbildung gemäß Gleichung (2) mit D = 50. Eine allgemeine Beobachtung ist, dass die Abbildungen gemäß der Gleichung (2) den Grenzwert schneller erreichen als die Abbildungen gemäß der Gleichung (1) . Mit einer geeigneten Auswahl des Werts D sollten aber beide Funktionen für die Modellierung und die Umsetzung des virtuellen Zeit- fortschritts verwendbar sein. 4 graphically illustrates the asymptotic progress of the virtual time t v (vertical axis) with the real time t R (horizontal axis). The threshold value T in the present embodiment corresponds to ten time units. In FIG 4 four functions are exemplified. The graph 26 of the figure according to equation (1), with D = 10. The graph 28 corresponds to the figure according to equation (1) with D = 50. The graph 30 corresponds to the figure according to equation (2) with D = 10. The graph 32 corresponds to the mapping according to equation (2) with D = 50. A general observation is that the maps according to equation (2) reach the limit faster than the maps according to equation (1). With a suitable selection of the value D, however, both functions should be useful for modeling and implementing virtual time progress.
Um das in FIG 1 dargestellte Verhalten zu ermöglichen, muss jede Recheneinrichtung bzw. jeder Emulator bzw. Simulator der Simulationsumgebung eine interne Uhr besitzen, die die virtuelle Zeit tv für diese Einheit aufbewahrt (neben der realen Zeit der Simulationsumgebung) . Diese Uhr muss die explizite Manipulation der virtuellen Zeit tv des Emulators ermögli- chen, indem mit ihr die aktuelle Zeit gesetzt werden kann.In order to enable the behavior shown in FIG. 1, each simulation device or simulator of the simulation environment must have an internal clock which stores the virtual time t v for this unit (in addition to the real time of the simulation environment). This clock must enable the explicit manipulation of the virtual time t v of the emulator by setting the current time.
Die aktuelle Zeit der virtuellen Uhr kann insbesondere explizit gesetzt werden. Dies ermöglicht die Uhr sowohl vorwärts als auch rückwärts „zu drehen" und wird effektiv benutzt, um „in die Zeit zu springen". Anhand dieser Operation können die virtuellen Uhren der Emulatoren in der Simulationsumgebung beliebig gesetzt werden. Zum Zyklusbeginn kann bei jedem Emulator die virtuelle Uhr mit dem passenden Wert für den Zyklusanfang gesetzt werden. In jedem Fall sorgt die Steuerung der Simulationsumgebung dafür, dass die einzelnen internen virtuellen Uhren der jeweiligen Emulationseinheiten während der Simulation synchronisiert bleiben. The current time of the virtual clock can in particular be set explicitly. This allows the clock to "spin" both forward and backward and is effectively used to "jump into time". Based on this operation, the virtual clocks of the emulators in the simulation environment can be set arbitrarily. At the start of the cycle, the virtual clock with the appropriate value for the beginning of the cycle can be set for each emulator. In any case, the control of the simulation environment ensures that the individual internal virtual clocks of the respective emulation units remain synchronized during the simulation.
Die Systemzeit einer realen SPS wird üblicherweise über Timer-Interrupts fortgesetzt und auf neue Werte aktualisiert. Bei der SPS-Emulation kann stattdessen das System vom Betriebssystem benutzt werden, was der realen Zeit tR der Simulationsumgebung entspricht und welche vom Emulator nicht modifiziert worden ist. Ein sinnvoller Lösungsansatz für die virtuelle Uhr der SPS-Simulation ist deshalb, die virtuelle Uhrzeit aus der Systemzeit des Betriebssystems zu berechnen. Für diese Berechnung können die für den Zeitfortschritt erwähnten Funktionen verwendet werden. Eine Implementierung für die jeweilige Funktion wäre zum Beispiel die folgende: tv = tv Start + T . (l — L ) (3) The system time of a real PLC is usually continued via timer interrupts and updated to new values. In the case of PLC emulation, the system can instead be used by the operating system, which corresponds to the real time t R of the simulation environment and which has not been modified by the emulator. A useful approach for the virtual clock of the PLC simulation is therefore to calculate the virtual time from the system time of the operating system. For this calculation the functions mentioned for the time progress can be used. An implementation for the respective function would be, for example, the following: t v = t v start + T. (l - L) (3)
^ lR lR ^ l R l R
D Alternativ dazu kann die folgende Formel verwendet werden: ^R ^R Start ) x / Λ \ tv=tr start+T*(l-e — ) (4) Hier entspricht tv der aktuellen virtuellen Zeit, tv_start der virtuellen Anfangszeit der aktuellen Ausführung, T der geplanten Zyklusdauer, tR der aktuellen Systemzeit, tR_start der realen Anfangszeit der aktuellen Ausführung und D dem Annähe- rungsgeschwindigkeitsfaktor . D Alternatively, the following formula can be used: ^ R ^ R Start) x / Λ \ t v = t r start + T * (le -) (4) Here t v corresponds to the current virtual time, t v _start to the virtual start time the current execution, T of the planned cycle duration, t R of the current system time, t R _ st type of the real start time of the current execution and D the approximation speed factor.
Der vorgestellte Lösungsansatz für die Abbildung der realen Zeitdauer tR auf die virtuelle Zeit tv bei einer SPS- Simulation basiert auf einer asymptotischen Funktion, während die bisher verwendete Abbildungsfunktion bei Simulationspro- grammen üblicherweise linear ist. Im Gegensatz zu linearenThe proposed solution for the mapping of the real time t R to the virtual time t v in a PLC simulation is based on an asymptotic function, while the mapping function used hitherto is usually linear in simulation programs. Unlike linear
Abbildungen werden mit einer asymptotischen Zeitabbildung irreführende Zykluszeitverletzungen komplett vermieden. Pictures are completely avoided with an asymptotic time mapping misleading cycle time violations.
FIG 4 zeigt ein Diagramm 34, in dem das Verhalten einer line- aren Zeitabbildung (Kurve 36) und einer asymptotischen Zeitabbildung (Kurve 38) dargestellt sind. Analog zur Abbildung gemäß FIG 4 wird ein Grenzwert T von 10 Zehneinheiten betrachtet. Der Anstieg bei der linearen Abbildung entspricht einem Faktor von 0,1. Der Annäherungsgeschwindigkeitsfaktor D bei der asymptotischen Abbildung entspricht dem Wert 5. 4 shows a diagram 34 in which the behavior of a linear time map (curve 36) and an asymptotic time map (curve 38) are shown. Analogous to the illustration according to FIG. 4, a limit value T of 10 ten units is considered. The increase in linear mapping corresponds to a factor of 0.1. The approaching speed factor D in the asymptotic mapping corresponds to the value 5.
Die lineare Zeitabbildung (Kurve 36) erreicht den Grenzwert 10 der virtuellen Zeit tv bei einer realen Zeit tR von 100. Dabei ergeben sich zwei mögliche Situationen bei der Ausfüh- rung eines Programmzyklus. Zum einen wird die Ausführung unter 100 realen Zeiteinheiten tR abgeschlossen. Unabhängig vom verwendeten Ansatz wird keine irreführende Zykluszeitverletzung verursacht. Alternativ dazu benötigt die Ausführung 100 oder mehr reale Zeiteinheiten tR. Dies kann beispielsweise bei einer höheren Auslastung des Betriebssystems der Fall sein. Bei der linearen Zeitabbildung findet eine Zykluszeitverletzung statt. Dies hat zur Folge, dass Alarm ausgelöst und eine Zeitverschiebung bei der nächsten Ausführung des nächsten Programmzyklus erfasst . Bei der asymptotischen Zeitabbildung wird weiterhin keine irreführende Zykluszeitverletzung verursacht. Die Verwendung des kleineren Anstiegs bei der linearen Abbildung senkt die Wahrscheinlichkeit von Zykluszeitverletzungen bei der Emulation, schließt aber dieses Problem nie vollständig aus. Der vorgestellte asymptotische Ansatz löst dabei dieses Problem für alle möglichen Ausführungszeitdauern . The linear time map (curve 36) reaches the limit value 10 of the virtual time t v at a real time t R of 100. This results in two possible situations in the execution of a program cycle. First, the execution is completed under 100 real time units t R. Regardless of the approach used, no misleading cycle time violation is caused. Alternatively, the embodiment requires 100 or more real time units t R. This can be the case, for example, with a higher load on the operating system. In linear time mapping, a cycle time violation occurs. As a result, the alarm is triggered and detects a time shift in the next execution of the next program cycle. Asymptotic time mapping still does not cause a misleading cycle time violation. Using the smaller increase in linear imaging reduces the likelihood of cycle time violations in the emulation, but never completely eliminates this problem. The presented asymptotic approach solves this problem for all possible execution times.
Bezugszeichenliste LIST OF REFERENCE NUMBERS
10 Diagramm 10 diagram
12 Programm  12 program
14 Programm  14 program
16 Programm  16 program
18 Programm  18 program
20 Diagramm  20 diagram
22 Diagramm  22 diagram
24 Diagramm  24 diagram
26 Kurve  26 curve
28 Kurve  28 curve
30 Kurve  30 curve
32 Kurve  32 curve
34 Diagramm  34 diagram
36 Kurve  36 curve
38 Kurve  38 curve
tR reale Zeitdauer tv virtuelle Zeitdauert R real time duration t v virtual time duration
T Grenzwert T limit

Claims

Patentansprüche claims
1. Verfahren zum Emulieren einer speicherprogrammierbaren Steuerung durch A method of emulating a programmable logic controller
- Bereitstellen einer Recheneinrichtung mit einem Betriebssystem, welches bezüglich einer an die speicherprogrammierbare Steuerung gestellte Echtzeitanforderung ungenügend ist,Providing a computing device with an operating system which is insufficient with respect to a real-time request made to the programmable logic controller,
- Abbilden einer realen Zeitdauer (tR) auf eine virtuelle Zeitdauer (tv) anhand einer vorbestimmten Funktion, Mapping a real time duration (t R ) to a virtual time duration (t v ) based on a predetermined function,
- Vorbestimmen eines Grenzwerts (T) für die zum Emulieren zumindest eines Programmzyklus eines Programms (12) der speicherprogrammierbaren Steuerung benötigte virtuelle Zeitdauer (tv) , Predetermining a limit value (T) for the virtual time duration (t v ) required for emulating at least one program cycle of a program (12) of the programmable logic controller;
- Emulieren des zumindest eines Programmzyklus mit der Re- cheneinrichtung,  Emulating the at least one program cycle with the computing device,
und and
- Überprüfen eines Vorhandenseins einer Zykluszeitüberschreitung des emulierten Programmzyklus in Abhängigkeit von dem Grenzwert (T) ,  Checking a presence of a cycle timeout of the emulated program cycle as a function of the limit value (T),
gekennzeichnet durch marked by
- Abbilden der realen Zeitdauer (tR) auf die virtuelle Zeitdauer (tv) anhand einer asymptotischen Funktion. Mapping the real time duration (t R ) to the virtual time duration (t v ) using an asymptotic function.
2. Verfahren nach Anspruch 1, dadurch gekennzeichnet, dass die asymptotische Funktion, mit der die reale Zeitdauer (tR) auf die virtuelle Zeitdauer (tv) abgebildet wird, sich an den vorbestimmten Grenzwert (T) annähert. 2. The method according to claim 1, characterized in that the asymptotic function, with which the real time duration (t R ) is mapped to the virtual time period (t v ), approaches the predetermined limit value (T).
3. Verfahren nach einem der vorhergehenden Ansprüche, dadurch gekennzeichnet, dass die asymptotische Funktion, mit der die reale Zeitdauer (tR) auf die virtuelle Zeitdauer (tv) abgebildet wird, indirekt proportional zu der realen Zeitdauer (tR) ist. 3. The method according to any one of the preceding claims, characterized in that the asymptotic function, with which the real time duration (t R ) is mapped to the virtual time period (t v ), is indirectly proportional to the real time duration (t R ).
4. Verfahren nach einem der Ansprüche 1 bis 3, dadurch gekennzeichnet, dass die asymptotische Funktion, mit der die reale Zeitdauer (tR) auf die virtuelle Zeitdauer (tv) abgebildet wird, einer Sprungantwort eines Übertragungsglieds, das ein proportionales Übertragungsverhalten mit einer Verzögerung erster Ordnung aufweist, entspricht. 4. The method according to any one of claims 1 to 3, characterized in that the asymptotic function, with which the real time duration (t R ) is mapped to the virtual time period (t v ), a step response of a transmission element, which has a proportional transmission behavior with a first-order delay corresponds.
5. Verfahren nach einem der vorhergehenden Ansprüche, dadurch gekennzeichnet, dass die Recheneinrichtung einen virtuellen5. The method according to any one of the preceding claims, characterized in that the computing device is a virtual
Zeitgeber umfasst, mit dem bei einem Start der Emulation des Programmzyklus eine virtuelle Uhrzeit eingestellt wird. Timer that sets a virtual time when the program cycle emulation starts.
6. Verfahren nach Anspruch 5, dadurch gekennzeichnet, dass die virtuelle Uhrzeit von dem virtuellen Zeitgeber aus einer6. The method according to claim 5, characterized in that the virtual time of the virtual timer from a
Systemzeit des Betriebssystems der Recheneinrichtung bestimmt wird . System time of the operating system of the computing device is determined.
7 . Verfahren nach Anspruch 6 , dadurch gekennzeichnet, dass die virtuelle Uhrzeit aus der Systemzeit des Betriebssystems anhand einer asymptotischen Funktion abgebildet wird. 7. A method according to claim 6, characterized in that the virtual time from the system time of the operating system is mapped using an asymptotic function.
8. Verfahren nach einem der vorhergehenden Ansprüche, dadurch gekennzeichnet, dass parallel zu dem zumindest einen Pro- grammzyklus ein zweiter Programmzyklus eines zweiten Programms (14) mit einer zweiten Recheneinrichtung emuliert wird . 8. The method according to any one of the preceding claims, characterized in that parallel to the at least one program cycle, a second program cycle of a second program (14) is emulated with a second computing device.
9. Vorrichtung zum Emulieren einer speicherprogrammierbaren Steuerung mit 9. Device for emulating a programmable logic controller with
- einer Recheneinrichtung mit einem Betriebssystem, welches bezüglich einer an die speicherprogrammierbare Steuerung gestellte Echtzeitanforderung ungenügend ist, wobei  a computing device having an operating system which is insufficient with respect to a real-time request made to the programmable logic controller, wherein
- die Recheneinrichtung dazu ausgebildet ist, zumindest einen Programmzyklus eines Programms (12) der speicherprogrammierbaren Steuerung mit der Recheneinrichtung zu emulieren und wobei  - The computing device is adapted to emulate at least one program cycle of a program (12) of the programmable logic controller with the computing device and wherein
- die Vorrichtung dazu ausgebildet ist, eine reale Zeitdauer (tR) auf eine virtuelle Zeitdauer (tv) anhand einer vorbe- stimmten Funktion abzubilden, einen Grenzwerts (T) für die zum Emulieren des zumindest einen Programmzyklus benötigte virtuelle Zeitdauer (tv) vorzubestimmen und ein Vorhandensein einer Zykluszeitüberschreitung des emulierten Programmzyklus in Abhängigkeit von dem Grenzwert (T) zu überprüfen, the device is designed to map a real time duration (t R ) to a virtual time duration (t v ) on the basis of a predetermined function, a limit value (T) for the virtual time duration (t v ) required for emulating the at least one program cycle to predict and a presence cycle time over the emulated program cycle as a function of the limit value (T),
dadurch gekennzeichnet, dass characterized in that
- die Vorrichtung dazu ausgebildet ist, die reale Zeitdauer (tR) auf die virtuelle Zeitdauer (tv) anhand einer asymptotischen Funktion abzubilden. - The device is adapted to the real time duration (t R ) to the virtual time period (t v ) using an asymptotic function.
PCT/EP2014/053120 2014-02-18 2014-02-18 Method and apparatus for emulating a programmable logic controller WO2015124170A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/EP2014/053120 WO2015124170A1 (en) 2014-02-18 2014-02-18 Method and apparatus for emulating a programmable logic controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/EP2014/053120 WO2015124170A1 (en) 2014-02-18 2014-02-18 Method and apparatus for emulating a programmable logic controller

Publications (1)

Publication Number Publication Date
WO2015124170A1 true WO2015124170A1 (en) 2015-08-27

Family

ID=50115894

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/EP2014/053120 WO2015124170A1 (en) 2014-02-18 2014-02-18 Method and apparatus for emulating a programmable logic controller

Country Status (1)

Country Link
WO (1) WO2015124170A1 (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105279335A (en) * 2015-10-30 2016-01-27 南京河海南自水电自动化有限公司 Simulation method of variable speed simulator based on time scaling of operating system
EP3196717A1 (en) * 2016-01-20 2017-07-26 Rockwell Automation Technologies, Inc. Emulated industrial control execution rate scaling
WO2018024390A1 (en) * 2016-08-01 2018-02-08 Siemens Aktiengesellschaft Determining the execution time of a user program
EP3349082A1 (en) * 2017-01-16 2018-07-18 Siemens Aktiengesellschaft System and simulator for deactivatable simulation of installations or machines within programmable controllers
EP3521949A1 (en) * 2018-02-01 2019-08-07 Siemens Aktiengesellschaft Device for simulating a controlled machine or installation and method
US12032876B2 (en) 2018-02-01 2024-07-09 Siemens Aktiengesellschaft Device and method for simulating a controlled machine or installation

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001209411A (en) * 2000-01-25 2001-08-03 Omron Corp Plc simulator

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001209411A (en) * 2000-01-25 2001-08-03 Omron Corp Plc simulator

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105279335A (en) * 2015-10-30 2016-01-27 南京河海南自水电自动化有限公司 Simulation method of variable speed simulator based on time scaling of operating system
EP3196717A1 (en) * 2016-01-20 2017-07-26 Rockwell Automation Technologies, Inc. Emulated industrial control execution rate scaling
US10012979B2 (en) 2016-01-20 2018-07-03 Rockwell Automation Technologies, Inc. Emulated industrial control execution rate scaling
CN109478052A (en) * 2016-08-01 2019-03-15 西门子股份公司 Determine the execution time of application program
WO2018024390A1 (en) * 2016-08-01 2018-02-08 Siemens Aktiengesellschaft Determining the execution time of a user program
CN109478052B (en) * 2016-08-01 2022-07-12 西门子股份公司 Method and device for determining execution time of application program
US10901794B2 (en) 2016-08-01 2021-01-26 Siemens Aktiengesellschaft Determining an execution time of an application program
CN108319533A (en) * 2017-01-16 2018-07-24 西门子股份公司 The system and simulator of the equipment inside simulation control device can be turned off
US20180203973A1 (en) * 2017-01-16 2018-07-19 Siemens Aktiengesellschaft System and simulator for the disengageable simulation of installations or machines within programmable logic controllers
CN108319533B (en) * 2017-01-16 2021-07-06 西门子股份公司 System and simulator for the turn-off simulation of a device within a control unit
EP3349082A1 (en) * 2017-01-16 2018-07-18 Siemens Aktiengesellschaft System and simulator for deactivatable simulation of installations or machines within programmable controllers
EP3521949A1 (en) * 2018-02-01 2019-08-07 Siemens Aktiengesellschaft Device for simulating a controlled machine or installation and method
CN110109372A (en) * 2018-02-01 2019-08-09 西门子股份公司 For simulating the equipment and method of controlled machines or facility
US12032876B2 (en) 2018-02-01 2024-07-09 Siemens Aktiengesellschaft Device and method for simulating a controlled machine or installation

Similar Documents

Publication Publication Date Title
EP1898282B1 (en) Method of testing an electronic control system
WO2015124170A1 (en) Method and apparatus for emulating a programmable logic controller
EP2897011B1 (en) Method and simulation assembly for the simulation of an automated industrial plant
EP2453326B1 (en) Method and system for operating an automated machine
EP2120143B1 (en) Method to perform tasks for calculating a signal to be simulated in real time
EP3499470B1 (en) Method for status based maintenance of access device
EP3188053A1 (en) Method for configuring a co-simulation for an overall system
EP2221697A1 (en) Method for testing a control device and testing device
EP2645200A1 (en) Method and data processing assembly for producing a timestamp
EP2083339A1 (en) Method and device for performing tests through functionally cascaded test and experimentation devices
DE102014219709A1 (en) Method for power plant simulation for testing and training purposes by means of a distributed simulation hardware
WO1997019392A2 (en) Simulator unit for simulating a peripheral unit of a modular programmable controller
WO2015124320A1 (en) Dynamic programmable logic controller for emulating a controller
DE102015207270A1 (en) Method and apparatus for simulation coupling of an event-driven controller subsystem and a plant subsystem
EP3422218A1 (en) Synchronization of a plurality of simulations
EP3521949B1 (en) Device for simulating a controlled machine or installation and method
EP3475775B1 (en) Determining the execution time of a user program
EP2686769B1 (en) Display device having a stepper motor and a watchdog timer
EP2477085B1 (en) System and method for analysing a time behaviour of the execution of a control program in an industrial control device
DE102019006642A1 (en) Numerical control
DE102021132235B4 (en) Method for simulating an ECU on a computer based on the AUTOSAR standard and computer therefor
EP3413204B1 (en) Method for parallel administration of continuous and task-synchronous input data of a real-time system
DE102016005928B4 (en) Monitoring device and method for determining a reset duration of a reset of a control unit of a motor vehicle
EP0972232A1 (en) Programmable control system
EP3264267A1 (en) Method and assembly for presenting or updating a graphical user interface of an industrial operating and observation system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14705169

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14705169

Country of ref document: EP

Kind code of ref document: A1