Method for computer-assisted simulation of the operation of a machine operating in an automated manner
By setting virtual time on the simulation computer to ensure that the implementation time of each process is zero and adjusting the virtual time, the problem of mismatch in computing speed between the simulation computer and the programmable logic controller CPU is solved, achieving fast and deterministic automated machine operation. Simulation, simplifying the simulation process and improving efficiency.
Patent Information
- Application Number
- CN201980019077.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2018-03-15
- Filing Date
- 2019-03-07
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2039-03-07
AI Technical Summary
When the existing technology simulates the operation of automated machines on a simulated computer, due to the mismatch between the computing speed of the processor and the computing speed of the programmable logic controller CPU, the program module implementation sequence deviates, making it difficult to quickly and effectively identify and test the software code, which prolongs the Simulation duration.
By setting virtual time on the simulation computer, setting the implementation time of each process to zero, and adjusting the virtual time after the process ends, ensuring the certainty of the implementation sequence and avoiding interruptions due to high-priority processes, the process on the simulation computer can be quickly simulated. implementation.
It realizes the rapid and deterministic simulation of automated machine operation on the simulation computer, simplifies the simulation process, avoids guessing the command implementation time on the programmable logic controller, and improves the simulation efficiency and accuracy.
Smart Images

Figure CN112005176B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a method for computer-assisted simulation of the operation of a machine operating in an automated manner. The invention also relates to a simulation computer and a computer program product and a computer program. Background Art
[0002] Programmable logic controllers (PLCs) are used in industrial automation systems for the operation of machines that work in an automated manner. PLCs store software codes that control the operation of the corresponding machines. In this case, different program modules of the software code are implemented, which perform the predefined tasks of the machine. The program modules are usually repeated cyclically and can take over various functions. For example, a program module can control a machine drive, and another program module can execute a route plan for the movement of the machine. Priorities are usually determined for the program modules, so that program modules with a higher priority are preferably executed compared to program modules with a lower priority.
[0003] Software codes for programmable logic controllers are often further developed, for example in order to implement new functions in the software code. Therefore, there is a need to test the software code before actual use in the corresponding programmable logic controller on a simulation computer, i.e. to simulate the operation of a machine controlled by the programmable logic controller with the corresponding software code. Such simulations make it possible to identify program errors that lead to erroneous behavior of the machine in actual operation.
[0004] When simulating the operation of a machine by means of a simulation computer, there is a problem that the computing speed of the processor of the simulation computer usually deviates significantly from the computing speed of the CPU of the programmable logic controller. This can lead to the execution sequence of the program modules on the simulation computer deviating from the execution sequence on the actual programmable logic controller, so that the simulation provides different results from the actual programmable logic controller.
[0005] In order to avoid this problem, the prior art provides a method that estimates the time consumption of the corresponding instructions of the software code on the actual programmable logic controller and matches the execution time of the corresponding instructions on the simulation computer with this. This process is complicated because a plurality of commands must be analyzed taking into account the duration of the instructions. In addition, the simulation duration on the simulation computer is prolonged by this method. Summary of the invention
[0006] The object of the present invention is therefore to provide a method for computer-assisted simulation of the operation of a machine operating in an automated manner, with which the actual operation of the machine can be simulated simply and quickly with the aid of a simulation computer.
[0007] This object is achieved by a method according to the invention or a simulation computer according to the invention. Improvements of the invention are defined in individual embodiments.
[0008] The method according to the invention is used for computer-assisted simulation of the operation of a machine working in an automated manner, which can be controlled on a programmable logic controller by means of a software code in actual operation. The concept of a machine working in an automated manner can be understood broadly. In particular, such a machine can also have multiple components and in this sense represent a technical facility. Here, the machine can be configured to automatically perform any process. In particular, the machine can be a machine tool. A machine tool is understood to be a machine for cutting and machining workpieces, such as a lathe or a milling machine. Similarly, a machine working in an automated manner can also be a production machine, such as a packaging machine. In addition, the machine can also be a logistics facility or a part of a logistics facility, such as an automatically operated high-rise shelf.
[0009] In the context of the method according to the invention, a simulated control of a machine is performed on a simulation computer by means of a software code. In other words, the software code is not implemented on a programmable logic controller in the context of the simulation, but on a simulation computer (e.g., the corresponding CPU of the computer). Here, the simulated control is based on a preset implementation template. In the preset implementation template, the temporal implementation sequence of the processes implemented by the software code is determined based on virtual time. Similarly, the starting time point of the process is specified based on virtual time. In addition, the implementation time of each process in virtual time is set to zero. Therefore, the implementation template corresponding to the actual operation is preset in the virtual time corresponding to the time in the actual operation of the simulation.
[0010] By setting the execution time of the corresponding process to zero, the execution template is executed deterministically, but not on the basis of the priority of the process, because in virtual time each process ends immediately after it starts, so that it cannot cause process interruptions due to other processes with higher priority.
[0011] According to the invention, in the scope of the simulated control of the machine, the next process is started only after the end of a process in the real time of the simulation computer, and the next process follows the end of the process according to the execution order, wherein, when the next process starts, the virtual time is set to the starting time point of the next process. This feature ensures that, according to the real time of the simulation computer, the actual process execution follows the simulated process execution and the virtual time is readjusted accordingly, although the execution time of the corresponding process in the virtual time is set to zero. As a result of the simulation, the output is generated by executing the software code in the scope of the simulation. Here, the simulation causes the corresponding input (for example, the machine position) by the operation of the actual machine. The output obtained by the simulation can be evaluated later to determine whether the simulated operation of the machine corresponds to the desired behavior.
[0012] The method according to the invention has the advantage that a defined execution template for a process in the simulation computer can be formed in a simple manner. This is achieved by fixing the execution time of the process to zero in the virtual time and by adjusting the virtual time at the end of the corresponding process on the simulation computer. In this case, the simulation can be carried out at the full speed of the simulation computer. Furthermore, it is not necessary to estimate the execution time of the corresponding command on the programmable logic controller, as is done in the prior art.
[0013] In a preferred variant of the method according to the invention, based on the actual process execution, a predefined execution template is executed according to the actual process of the machine operating in an automated manner by means of a software code on a programmable logic memory, wherein the temporal execution sequence of the processes and the starting times of the processes in the actual process execution correspond to the execution sequence and the starting times of the processes in the predefined execution template. In other words, the predefined execution template differs from the actual process execution in that the execution time of the individual processes is set to zero, which is not the case in the actual process execution.
[0014] In a variant of this embodiment, the predefined implementation template is calculated from the digital details of the actual process implementation in the context of the method according to the invention. It is also possible that the predefined implementation template is already present in digital form at the beginning of the method according to the invention based on the actual process implementation and is read in the context of the method.
[0015] In a variant according to the invention, the software code used in the actual process implementation corresponds to the software code running on the simulation computer. Nevertheless, the software code on the simulation computer can also have differences from the software code of the actual process implementation. For example, the software code on the simulation computer can be a further development of the software code of the actual process implementation, wherein the object of the method according to the invention is to test the further developed software code in the context of the simulation. Such testing is usually referred to as regression testing.
[0016] In another variant of the method according to the invention, in a predefined execution template, a task executed by a program module of a software code and interrupted once or multiple times by another program module is represented by an execution section of the task adjacent to the interruption being represented by a separate process having a start time at the beginning of the execution section and an execution time set to zero. In this way, the priorities of the tasks can also be simulated deterministically within the scope of the method according to the invention.
[0017] Depending on the application purpose of the method according to the invention, a predefined implementation template can be read by a programmable logic controller with a predefined computing capacity during operation of a machine operating in an automated manner and / or the control of a machine operating in an automated manner. In this way, various fault situations or various types of programmable logic controllers can be taken into account during the simulation.
[0018] In another design, in the method according to the present invention, before the process is implemented, a check is performed on a simulation computer according to a preset implementation template: whether the preset implementation template can be implemented on the actual working machine, and a fault state is generated when the preset implementation template cannot be implemented on the actual working machine. With this design, the generated fault state can have different follow-ups. Where possible, only the corresponding fault can be digitally stored, and then the fault can be read out in the scope of the simulation check. It is also possible that an alarm message is issued via a user interface when the fault state is generated. The user is thereby prompted that according to the preset implementation template, the simulation cannot ultimately be applied in practice. The corresponding check whether the preset implementation template can be implemented exists in the scope of processing by professionals. For example, the situation where the preset implementation template cannot be implemented is that the implemented program module cannot comply with the determined priority order.
[0019] In addition to the above method, the present invention discloses a simulation computer for computer-assisted simulation of the operation of a machine working in an automated manner, which machine can be controlled on a programmable logic controller with the aid of software code during actual operation, wherein the simulation computer is configured to implement the method according to the present invention or one or more preferred variants of the method according to the present invention.
[0020] The invention further relates to a computer program having a program code stored on a machine-readable medium for implementing the method according to the invention or one or more preferred variants of the method according to the invention, which program code is executed on a computer corresponding to the above-mentioned analog computer.
[0021] The invention further comprises a computer program having a program code for carrying out the method according to the invention or one or more preferred variants of the method according to the invention, which program code is executed on a computer corresponding to the above-mentioned simulation computer. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Next, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
[0023] Shows:
[0024] Figure 1 is a time diagram which describes the implementation of a process in a real machine working in an automated manner based on different programmable logic controllers with different computing power, according to the same software code on the controllers;
[0025] Figure 2 is a schematic diagram showing the basic components of a simulation computer which are used in embodiments of the present invention to simulate the operation of a machine working in an automated manner; and
[0026] Figure 3 is a time graph based on Figure 1 The actual process implementation is described in Figure 2 Implementation of the process on a simulated computer. DETAILED DESCRIPTION
[0027] In the following, a variant of the method according to the invention is described, with which the operation of a machine operating in an automated manner (e.g. a machine tool or a production machine) is simulated for two programmable logic controllers with different computing power. As a basis for the simulation, an implementation template is used, which in the embodiment described here is represented by Figure 1 Based on the corresponding process implementations EX1, EX2, the process implementations are tested for the actual machine.
[0028] The process implementation EX1 involves the execution of a process in a machine M operating in an automated manner by a programmable logic controller CO with a high processor power and a fast computing time, whereas the process implementation EX2 is executed by a programmable logic controller CO with a low processor power and a low computing speed. Both programmable logic controllers use the same software code COD', but different process implementations EX1 and EX2 result due to the different computing powers of the programmable logic controllers.
[0029] according to Figure 1 The horizontal axis of the table shows the actual time of the two processes EX1 and EX2. Figure 1 The columns with different filling patterns described in the figure represent program modules of the software code COD' implemented by the corresponding programmable logic controller CO. In this case, columns with the same filling pattern refer to the same program module. The labels OB1, OB30 and OB90 are used for the numbering of the program modules. Figure 1 In the figure, the white bars can be read as time segments, in which no program module is executed. In addition, the end time point of the execution of the corresponding program module is indicated by the symbol E. In other words, the transition between different bars without a mark does not indicate the end of the program module located to the left of the transition, but rather the interruption of the program module that can be read thereby.
[0030] The height of the bar indicates the priority of the program module during its execution. In other words, the higher the priority of the corresponding program module, the higher the bar. Figure 1 In the case of , program module OB1 has the lowest priority, which means that the program modules OB30 and OB90 to be executed interrupt the program module OB1 that is being executed. In contrast, program module OB30 has an intermediate priority, i.e. it is only interrupted by program module OB90. Program module OB90 has the highest priority, i.e. the pending execution of this program module always leads to the interruption of the two other program modules OB1 and OB30.
[0031] According to the process implementation EX1 of the faster programmable logic controller, process OB1 is interrupted once by process OB30 and another time by process OB90. In contrast, process OB30 is not interrupted once by process OB90. In contrast, in the process implementation EX2 of the slower programmable logic controller, not only the left program module OB30 but also the right program module OB which is later in time is interrupted once by the corresponding program module OB90. In addition, there are a large number of interruptions of program module OB1. The large number of interruptions is due to the high computing time when implementing each program module, so that interruptions by program modules of higher priority often occur.
[0032] In the specific embodiment of the method according to the invention described here, execution templates for simulating the operation of the machine M are used both based on a fast programmable logic controller corresponding to process execution EX1 and based on a slower programmable logic controller corresponding to process execution EX2.
[0033] Described later Figure 2 The implementation templates marked with SP (SP=Sequence Pattern) describe program modules represented in the form of processes in the corresponding process implementations EX1 and EX2. Here, a process corresponds to the continuous implementation of the corresponding program module until its end or interruption. In other words, a program module that is interrupted once or multiple times by another program module is composed of multiple processes, which represent corresponding sub-segments of the program module that are temporally adjacent to the program module that caused the interruption. If a program module does not need to be interrupted, then the program module corresponds to a single process of the implementation template. In addition, the starting time point of the corresponding process is stored in the implementation template.
[0034] The execution template can be calculated in advance and read from a memory. It is also possible to use the corresponding process and its starting time in the scope of the simulation method from Figure 1 The implementation template is calculated from the corresponding process implementation.
[0035] also, Figure 1 Two time points t1 and t2 are also indicated by dotted arrows. At time point t1, a command can be read by program module OB90 of process implementation EX1 to read the current time. This command is also executed in the corresponding program module OB90 of process implementation EX2, but due to the slower process implementation, it is executed at a later time point t2. The method described here is based on the following assumption: such differences between times within the corresponding program modules are not relevant to other process implementations, so that the start time point of the corresponding program module can also be used for this time.
[0036] Figure 2 A virtual execution system VES (VES = Virtual Execution System) for a programmable logic controller is described, which is a component of a simulation computer SC. In addition to the execution system, the simulation computer includes a CPU or a processor (in Figure 2 The software code COD is implemented by means of a processor. The software code indicates Figure 1Further development of the corresponding software code COD'. From now on, in the scope of regression testing, it should be determined by simulation whether the further developed software code COD leads to faults in machine operation when the further developed software code COD is used in an actual programmable logic controller. For this purpose, the software code COD is executed on the computer SC by the processor PRO, which is indicated by the arrow P1 and the right rectangle in the virtual execution system VES. In this case, the processor PRO works in real time RT.
[0037] In order to test the software code COD, an implementation template SP is applied, wherein the template is based on a faster programmable logic controller process implementation EX1 or a slower programmable logic controller process implementation EX2 according to the test to be implemented. The implementation template SP includes the implementation sequence of the above-mentioned processes, corresponding to the process implementations EX1 and EX2. Figure 2 In the example, EO (EO=Execution Order) is used to mark the execution order, whereas PR is used to mark the process. In addition, the corresponding starting time point of the corresponding process PR is marked with ST.
[0038] For the implementation template SP, the virtual implementation system VES uses a virtual time VT, which represents the time of the process implementation on the corresponding programmable logic controller. In other words, the starting time ST of the implementation template SP is given in the virtual time VT. An important aspect of the invention is that the implementation duration for the corresponding process PR is set to zero. In this way, it is ensured that the implementation sequence EO is adhered to and no interruptions occur in the implementation process, because the corresponding implementation of the process ends immediately.
[0039] Furthermore, the virtual execution system VES comprises a time management unit TM, which is based on the virtual time VT, as indicated by the arrow P2. Furthermore, the time management unit is used to execute a time read command at a certain point in time according to a command from the software code COD, which is indicated by the arrow P3. Since the corresponding execution time of the process is zero, Figure 1 The times t1 and t2 output in are mapped onto the corresponding virtual start times of program module OB90.
[0040] also, Figure 2The virtual implementation system VES includes a deterministic time planner, which is labeled with the reference SBS (SBS=Sequence based Scheduler). The planner processes the implementation template SP, as indicated by the arrow P4. The time planner is triggered by the time management unit TM based on the virtual time VT, as indicated by the arrow P5. The time planner SBS starts the program according to the program module of the software code COD, as indicated by the arrow P6.
[0041] In order to ensure that the virtual time VT is tracked after the corresponding process is implemented, the virtual time is adjusted based on the implementation template SP, which is represented by the arrow P7. The process of this adjustment is: only after the corresponding process ends in the real time RT of the processor PRO, the virtual time VT is reset, that is, the virtual time is set to the start time point of the next process of the implementation template SP.
[0042] As mentioned above, through Figure 2 The system of the invention realizes deterministic process execution for the simulated control of machines based on fast and slow programmable logic controllers in a simple manner. The invention is based on setting the execution time of a process to zero in virtual time in order to thereby maintain the execution sequence and, in addition, setting the virtual time to the start time of the next process if the previous process ends according to the real time of the simulation computer.
[0043] Figure 3 By way of example, the Figure 2 The process implementation EX2' of the implementation template SP is specifically based on the process implementation EX2 of the slow programmable logic controller. Here, the abscissa represents virtual time. Figure 3 As shown, for Figure 1 The process of implementing EX2 for each associated segment of the column is Figure 3 There are corresponding processes in Figure 3 The process is described as a schematic column. Figure 1 The process in is not interrupted, then Figure 3 The columns in the table correspond to program modules. This is the case for program module OB90.
[0044] In contrast, for Figure 1 For the sub-segments of the program modules in Figure 3 There are corresponding separate processes in the process implementation EX2'. Therefore, for the program module OB1, there are four processes OB1-a, OB1-b, OB1-c and OB1-d due to its interruption. In addition, Figure 1The left program module OB30 is also interrupted by the program module OB90, thereby resulting in two processes OB30-a and OB30-b. Correspondingly, the interruption of the right program module OB30 also results in two processes OB30-a and OB30-b.
[0045] By describing Figure 3 The narrow and long bars indicate that the program module or its subsection has an implementation time of zero in the implementation template SP. Figure 3 The positions of the bars in correspond to the start time points of the corresponding processes.
[0046] The above-described embodiment of the present invention has a series of advantages. By applying virtual time in the scope of the simulation machine operation, the implementation time can be determined to zero for the corresponding process. In this way, a deterministic time process of the process implementation can be achieved. In addition, it is possible to interrupt the code by defining a separate process mapping for the corresponding sub-sections of the program module and thus simulate priority-based behavior. In this case, the processor of the simulation computer can work at full speed and is not delayed by virtual time. By applying predefined process behaviors based on corresponding implementation templates, programmable logic controllers with different performance levels can be considered in the scope of the simulation.
Claims
1. A method for computer-assisted simulation of the operation of a machine (M) operating in an automated manner, which machine can be controlled by means of a software code on a programmable logic controller (CO) during actual operation, wherein: - executing the simulated control of the machine (M) on a simulation computer by means of the software code based on a preset implementation template (SP), wherein in the preset implementation template (SP), the temporal implementation order (EO) of the processes (PR) implemented by the software code and the start time (ST) of the processes (PR) are determined based on a virtual time (VT), and the implementation time of each process (PR) in the virtual time (VT) is set to zero, so that the implementation order (EO) is adhered to and no interruption occurs during the implementation process, - wherein, within the scope of the simulated control, a next process is started only after a process in the real time (RT) of the simulation computer has ended, and the next process follows the ended process according to the execution sequence (EO), wherein at the start of the next process the virtual time (VT) is set to the start time point (ST) of the next process.
2. The method according to claim 1, wherein: Based on the actual process implementation (EX1, EX2), according to the actual process of the machine (M) working in an automated manner, the preset implementation template (SP) is implemented with the help of a software code (COD') on the programmable logic controller (CO), wherein the temporal implementation sequence of the processes and the starting time point of the processes in the actual process implementation (EX1, EX2) correspond to the implementation sequence (EO) and the starting time point (ST) of the process (PR) in the preset implementation template (SP).
3. The method according to claim 1 or 2, wherein: In the preset implementation template (SP), a task that is implemented by a program module of the software code and interrupted once or multiple times by another program module is represented so that an implementation section of the task adjacent to the interruption is represented by a separate process (PR), which has a start time point (SP) at which the implementation section starts and an implementation time set to zero.
4. The method according to claim 1 or 2, wherein: The predefined implementation template (SP) represents a predefined fault situation in the operation of the machine (M) operating in an automated manner and / or the control of the machine (M) operating in an automated manner via the programmable logic controller (CO) having a predefined computing power.
5. The method according to claim 1 or 2, wherein: In the method, before implementing the process (PR), it is checked on the simulation computer according to the preset implementation template (SP) whether the preset implementation template (SP) can actually be implemented on the actually working machine (M), and a fault state is generated when the preset implementation template (SP) cannot be implemented on the actually working machine (M).
6. The method according to claim 1 or 2, wherein: The operation of the machine (M) in the form of a machine tool or a production machine or at least a part of a logistics facility working in an automated manner is simulated.
7. A simulation computer for computer-assisted simulation of the operation of a machine (M) operating in an automated manner, which machine can be controlled by means of a software code on a programmable logic controller (CO) during actual operation, wherein: The simulation computer is configured to execute a method in which: - executing a simulated control of the machine (M) on the simulation computer by means of the software code based on a preset execution template (SP) of the processes (PR), wherein in the preset execution template (SP) the temporal execution order (EO) of the processes (PR) executed by the software code and the start time (ST) of the processes (PR) are determined based on a virtual time (VT), and the execution time of each process (PR) in the virtual time (VT) is set to zero, so that the execution order (EO) is observed and no interruption occurs during the execution, - wherein, within the scope of the simulated control, a next process is started only after a process in the real time (RT) of the simulation computer has ended, and the next process follows the ended process according to the execution sequence (EO), wherein at the start of the next process the virtual time (VT) is set to the start time point (ST) of the next process.
8. The simulation computer according to claim 7, wherein: The simulation computer is configured to execute the method according to any one of claims 2 to 6 .
9. A computer-readable storage medium having a program code installed thereon, wherein when the program code is implemented on a computer corresponding to an analog computer, the program code is used to execute the method according to any one of claims 1 to 6.
