Method for generating a control program for an automation system, and development environment
Patent Information
- Authority / Receiving Office
- EP · EP
- Patent Type
- Applications
- Current Assignee / Owner
- BECKHOFF AUTOMATION GMBH
- Filing Date
- 2024-09-19
- Publication Date
- 2026-06-24
Smart Images

Figure EP2024076290_27032025_PF_FP_ABST
Abstract
Description
[0001] Description
[0002] Method for generating a control program for an automation system and development environment
[0003] The invention relates to a method for generating a control program for an automation system and a development environment.
[0004] Graphic programming languages are well-known for the graphical programming of programmable logic controllers (PLCs) in automation technology. The IEC 61131-3 standard defines three graphical programming languages: ladder diagram, function block diagram, and sequential function chart. These graphical programming languages enable user-friendly graphical programming by adding and / or removing predefined graphical program objects to graphically generate graphical diagrams as graphical representations for control programs to be created for programmable logic controllers.
[0005] For graphical programming languages, state-of-the-art conversions of graphical diagrams into intermediate representations are known. However, these state-of-the-art conversions are not compatible with version control systems. Version control systems provide helpful support for the programming process. Version control systems can manage the versions of the code being programmed created during the programming process. Version control systems thus enable the tracking of the programming process by comparing different versions of the created program code. Furthermore, managing program code in version control systems enables the restoration of older versions of the program code.
[0006] It is therefore an object of the invention to provide an improved method for generating a control program for an automation system and an improved development environment.
[0007] The object is achieved by the method and development environment of the independent claims. Preferred embodiments are specified in the dependent claims. According to one aspect of the invention, a computer-implemented method for generating a control program for an automation system is provided, comprising:
[0008] Translating a graphical diagram of a graphical programming language into a textual intermediate representation of the graphical diagram by a translation module of a development environment in a first translation step, wherein the graphical diagram graphically depicts at least part of a control program for an automation system according to the graphical programming language, wherein the textual intermediate representation provides a textual description of the graphical diagram, and wherein the first translation step comprises:
[0009] Carrying out a line-by-line translation in a line translation step, wherein in the line-by-line translation, graphical program objects of the graphical diagram are each assigned a textual program object in the form of at least one textual line of the textual intermediate representation, wherein the graphical program objects are sub-elements of the graphical diagram and represent program objects of the control program, and wherein the textual lines of the textual program objects provide unique descriptions of the respective graphical program objects; and
[0010] Saving the intermediate textual representation in a representation file in one save step.
[0011] This makes it possible to achieve the technical advantage of providing an improved method for programming a control program for an automation system. The method according to the invention enables graphical programming of the control program using a graphical programming language known from the prior art. Furthermore, the method according to the invention enables programming progress to be tracked during the graphical programming process of the control program using a version control system. For this purpose, a graphical diagram programmed according to a selected graphical programming language is first translated into a textual intermediate representation.
[0012] The translation is performed by a translation module of a development environment used to program the control program. According to the graphical programming languages known from the prior art, the graphical diagram represents a graphical representation of at least part of the control program to be programmed. The graphical diagram comprises at least one graphical program object. The graphical program object is accordingly a graphical representation of at least one program object of the control program to be programmed.
[0013] The translation module translates the graphical diagram into the aforementioned textual intermediate representation. The textual intermediate representation is a textual representation or description of the graphical diagram. The textual intermediate representation comprises at least one textual program object corresponding to the graphical diagram. The textual program object is a textual representation or description of the graphical program object of the graphical diagram.
[0014] According to the invention, the translation of the graphical diagram into the textual intermediate representation is achieved by performing a line-by-line translation of the graphical diagram. For this purpose, the graphical program objects of the graphical diagram are converted into corresponding textual program objects of the textual intermediate representation. The textual program objects are represented by at least one textual line of the line-by-line structured textual intermediate representation. The textual line completely describes each textual program object and the graphical program object correspondingly assigned to the textual program object.
[0015] The resulting textual intermediate representation is then saved in a representation file. This representation file can be read by a state-of-the-art version control system. The information from the line-by-line textual intermediate representation can be captured by the version control system, enabling the version control system to track the programming progress of the control program based on the created textual intermediate representations of the graphical diagrams.
[0016] The version control system is capable of comparing the textual program objects, written in the form of textual lines, of different textual intermediate representations of different graphical diagrams, which may be based on different versions of the programmed control program, in order to determine differences within the various textual intermediate representations. The aforementioned programming progress of the control program can be determined based on the differences between the various textual intermediate representations.
[0017] By translating the graphical diagrams programmed using the graphical programming language line by line into the textual intermediate representations, all functions of the state-of-the-art version control system can also be used for program code created using a graphical programming language. This simplifies the programming process and facilitates the programming of control programs in graphical programming languages.
[0018] According to one embodiment, the method further comprises:
[0019] Displaying the graphical diagram in a graphical editor unit of the development environment in a first display step; and / or displaying the textual intermediate representation of the graphical diagram in a textual editor unit of the development environment in a second display step; and generating the control program based on the textual intermediate representation of the graphical diagram of the graphical programming language and / or based on the graphical diagram in a generation step.
[0020] This allows the technical advantage of providing the user with the programmed program code at any time, both in graphical and textual representation, by displaying the graphical diagram in the graphical editor unit of the development environment or by displaying the textual intermediate representation in the textual editor unit of the development environment. The user is thus able to track the created program code of the control program, or to check its accuracy, both in the graphical editor unit in the form of the correspondingly created graphical diagrams and in the textual editor unit in the form of the textual intermediate representation.
[0021] The control program can then be generated based on both the graphical diagram and the textual intermediate representation. The textual intermediate representation thus serves not only as a textual form of the graphical diagram, which enables the use of state-of-the-art version control systems. Furthermore, the graphical intermediate representation also serves as an intermediate representation of the graphical diagrams required for a compilation process to generate the control program. An additional intermediate representation, on the basis of which the compilation of the graphical diagrams is enabled, is thus eliminated. This leads to a more streamlined programming process.
[0022] According to one embodiment, the method further comprises: receiving textual difference information from a version management system by the development environment in a receiving step, wherein the difference information describes a difference between a first version of the textual intermediate representation and a second version of the textual intermediate representation, wherein the first version and the second version of the textual intermediate representation are respectively representations of a first version and a second version of the graphical diagram, wherein the first and second versions of the graphical diagram were created in a programming process based on one another or on a common base diagram, and wherein the textual difference information defines at least one textual program object that is contained in only one of the two versions of the textual intermediate representation;and displaying the at least one textual program object of the textual;
[0023] Difference information in the textual editor unit of the development environment in a textual display step; and / or
[0024] Translating the textual difference information into graphical difference information by translating the at least one textual program object into a corresponding graphical program object in a difference translation step; and displaying the at least one graphical program object of the graphical difference information in a graphical editor unit of the development environment in a graphical display step.
[0025] This can achieve the technical advantage of allowing the user to be shown a difference between at least two versions of the textual intermediate representation in the development environment. For this purpose, difference information from the version control system used is taken into account. As is known from the state of the art for version control systems, the difference information includes information regarding the differences between two versions of the textual intermediate representation managed by the version control system. The different versions of the textual intermediate representation represent different versions of the control program programmed with the graphical programming language. The different versions were created at different times and / or by different authors during the graphical programming process.
[0026] In the embodiment shown, the difference information of the version control system is received and read by the development environment. The difference information includes information regarding at least one textual program object that is contained exclusively in one of the two versions.
[0027] According to the invention, changes in the graphical diagram are implemented by adding or deleting graphical program objects. Similarly, changes in corresponding textual intermediate representations are implemented by adding or removing textual program objects. Differences between different versions of textual intermediate representations are thus determined by program objects that have been added or removed in relation to one version of the intermediate representation in the other intermediate representation.
[0028] The correspondingly received textual difference information is then displayed in the textual editor unit of the development environment. For this purpose, the correspondingly added or deleted textual program objects can be displayed in one of the versions of the textual intermediate representation as a correspondingly added or deleted textual program object.
[0029] Alternatively or additionally, the textual difference information can be translated into corresponding graphical difference information. For this purpose, the aforementioned textual program objects of the textual difference information, which are contained exclusively in one of the two versions of the textual intermediate representation, are translated into corresponding graphical program objects. The translation is performed by the translation module in a manner analogous to the translation processes described above.
[0030] The correspondingly translated graphical program objects of the graphical difference information can then be displayed in the graphical editor unit of the development environment. For this purpose, the corresponding graphical program objects of the graphical difference information can be integrated into one of the two versions of the graphical diagrams and displayed as correspondingly deleted or added graphical program objects. By using the difference information from the version control system and displaying the corresponding difference information in textual or graphical form, the user can be directly shown the difference between two versions of the control program, in the form of the difference between two versions of the corresponding textual intermediate representation.The user is thus able to immediately view the programming progress between the two versions of the control program in both graphical and textual form. This, in turn, simplifies the programming process.
[0031] If only a few graphical program objects are changed between two versions of the graphical diagram, then correspondingly only a few lines, i.e., textual program objects, are changed between the respective versions of the corresponding textual intermediate representations. In this case, the corresponding difference information of the version control system also includes only a few changed lines.
[0032] The difference information thus requires only a small amount of storage space. By translating the graphical diagrams into the textual intermediate representations line by line, the storage space required by a version control system can be reduced.
[0033] Furthermore, the reduced-size difference information can be transmitted more quickly over a medium, such as the Internet.
[0034] By translating the graphical diagram line by line into the textual intermediate representation, the difference information can be transmitted, recorded and displayed to a user in text form.
[0035] The textual difference information shows a developer compactly and directly which graphical elements are affected.
[0036] The difference information can also be represented graphically. This representation is easier for developers to understand and familiarize themselves with.
[0037] Meta information of recordings, such as the author and the
[0038] The creation date can be automatically displayed in the graphical representation or graphical diagram. This information does not need to be added to the program as explicit documentation. This reduces the effort and ensures consistency with the information in the version control system.
[0039] The graphical diagram can be displayed in the user interface of a machine to be controlled. The representation of a sequence control of the machine to be controlled can be displayed in an SFC language.
[0040] In the user interface, the machine operator can be made aware of changes in the control program by highlighting and / or annotating them. According to one embodiment, the second version of the graphical diagram has a later creation date than the first version of the graphical diagram, wherein in the corresponding second version of the textual intermediate representation, at least one textual program object is added or removed compared to the first version of the textual intermediate representation, and wherein the at least one textual program object is identified in the textual difference information as a textual program object added or deleted compared to the first version of the textual intermediate representation.
[0041] This provides the technical advantage of allowing the user to immediately see the difference between two different versions of the control program. For this purpose, the textual program objects of the textual difference information are marked in the textual intermediate representation as added or deleted textual program objects. Similarly, the graphical program objects of the graphical difference information are marked in the graphical diagram as added or deleted graphical program objects.
[0042] By appropriately marking the program objects as added or deleted textual or graphical program objects, the user can not only be shown that two versions of the control program are different, but the actual differences in the form of the added or deleted program objects can be immediately viewed through the appropriate marking.
[0043] According to one embodiment, the textual display step and / or the graphical display step comprise: marking the textual program object of the textual difference information and / or the graphical program object of the graphical difference information as an added textual program object or an added graphical program object or as a deleted textual program object or as a deleted graphical program object in a marking step.
[0044] This can achieve the technical advantage that by marking the added or deleted program objects, the difference between two versions of the control program can be clearly represented both graphically and textually.
[0045] According to one embodiment, a textual program object changed from the first version to the second version of the textual intermediate representation is represented in the difference information as a pair of a deleted textual program object of the first version of the textual intermediate representation and an added textual program object of the second version of the textual intermediate representation, wherein the deleted textual program object represents an original version of the changed textual program object and the added textual program object represents a changed version of the changed textual program object.
[0046] This can achieve the technical advantage of enabling a clear representation of program objects changed between two versions of the textual intermediate representation or the graphical diagram. For this purpose, textual program objects changed between two versions of the textual intermediate representation are represented as a pair of textual lines. The pair of textual lines comprises a textual line deleted in a first version of the textual intermediate representation and a textual line added in the second version of the textual intermediate representation.
[0047] Both lines describe the same textual program object or represent a textual representation of the same graphical program object. The difference between the two textual lines primarily relates to the actual description of the respective graphical program object. However, both textual lines continue to represent the same graphical program object. By deleting one textual line in the first version of the textual intermediate representation and adding the other textual line in the second version of the textual intermediate representation, where both lines each refer to the same graphical program object, a change in the textual description of the graphical program object and thus a change in the textual program object can be indicated.Such a representation of the change to a textual program object in the form of a pair of a deleted textual line and an added textual line thus enables a clear representation of changed textual program objects. The user can thus clearly see at a glance which textual program objects have been modified in the different versions of the textual intermediate representation.
[0048] According to one embodiment, the deleted graphical program object corresponding to the deleted textual program object and / or the added graphical program object corresponding to the added textual program object and / or a changed graphical program object corresponding to the changed textual program object are shown in the graphical diagram as a deleted graphical program object and / or as an added graphical program object and / or as a changed graphical program object.
[0049] This can achieve the technical advantage that by displaying the added or deleted textual program objects in the current version of the textual intermediate representation, or by displaying the corresponding deleted or added graphical program objects in the corresponding graphical diagram, the user can see at a glance the changes between two versions of the textual intermediate representation and the corresponding changes between two versions of the corresponding graphical diagrams. The correspondingly deleted or added textual and graphical program objects can, for example, be color-coded accordingly, so that the deleted or added textual and graphical program objects are recognizable at a glance.
[0050] According to one embodiment, the method further comprises: receiving textual conflict information from the version management system and performing a conflict check between the first version of the textual intermediate representation and the second version of the textual intermediate representation in a conflict check step, wherein the textual conflict information comprises textual program objects associated with the first version of the textual intermediate representation and textual program objects associated with the second version of the textual intermediate representation; and
[0051] Determining a conflict in a conflict determination step if at least one textual program object associated with the first version of the textual intermediate representation and one textual program object associated with the second version of the textual intermediate representation have been detected which have an identical identity and are changed relative to each other.
[0052] This provides the technical advantage of being able to detect conflicts between two existing versions of the textual intermediate representation or the control program by taking textual conflict information from the version control system into account. The textual conflict information includes information regarding textual program objects that are assigned to both the first version of the textual intermediate representation and the second version of the textual intermediate representation and that have been modified relative to each other.
[0053] As described above, modified textual program objects are represented by a pair of textual lines, where a first line is a line deleted from the first version of the intermediate textual representation, while a second line of the pair is a textual line inserted into the second version of the intermediate textual representation. Both lines refer to the same graphical program object. Subsequently, both textual lines contain the same identity of the respective graphical program object, but are different or modified relative to each other.
[0054] Such conflicts can occur when several developers independently develop the same program code and the two versions of the textual intermediate representation were thus created by different developers and have a common version of the textual intermediate representation as a basis.
[0055] By taking the conflict information into account, a conflict between two existing versions of the textual intermediate representation can be identified by performing a conflict detection if the conflict information includes a first textual line associated with the first version of the textual intermediate representation and a second textual line associated with the second version of the textual intermediate representation, and if the two lines each have the same identity, thus refer to the same program object, and are modified or different relative to each other. By taking the conflict information into account, conflicts between the two versions of the textual intermediate representation can be identified and resolved accordingly.
[0056] According to one embodiment, the conflict determination step comprises:
[0057] Translating the textual conflict information into graphical conflict information by the translation module in a conflict translation step, wherein the graphical conflict information comprises graphical program objects corresponding to the textual program objects of the textual conflict information; and
[0058] Resolving the conflict by deleting the at least one graphical program object that corresponds to a textual program object that is assigned to the first version of the textual intermediate representation and that has an identical identity to another graphical program object that corresponds to a textual program object that is assigned to the second version of the textual intermediate representation
[0059] This can achieve the technical advantage that, by translating the textual conflict information into graphical conflict information, the conflict between the two versions of the textual intermediate representation or between the two versions of the corresponding graphical diagrams in the graphical diagrams can be displayed or resolved. To this end, the conflict is resolved by deleting at least one of the two graphical program objects corresponding to the two textual program objects of the textual conflict information. By deleting one of the two graphical program objects, the conflict is resolved in such a way that only one of the two graphical program objects remains.
[0060] A conflict between at least two versions of the control program can be displayed both textually and graphically. This graphical representation is familiar to developers and facilitates comparison and conflict resolution.
[0061] The graphical representation enables automatic conflict resolution.
[0062] This reduces the workload and the likelihood of incorrect resolution. Consider two identical machines controlled by the same graphical control program. By making changes to various parts of the control program, a first feature can be added to the first machine and a second feature to the second machine independently of each other. The control programs of the two machines can then be automatically merged into one control program that includes both features. This control program can be transferred to both machines and / or a third machine. The control of the two or three machines can thus be aligned, and the control of the machines includes both features.
[0063] According to one embodiment, the method further comprises:
[0064] Receiving graphical input commands from a user of the development environment by a graphical editor unit of the development environment in a graphical programming step, wherein the graphical input commands comprise programming commands for adding and / or removing graphical program objects of the graphical diagram; and / or
[0065] Reading a program file in one reading step, wherein the graphical diagram and the graphical program objects of the graphical diagram are described in a textual description in the program file;
[0066] Translating the textual description into the graphical diagram by the translation module in a second translation step.
[0067] This makes it possible to achieve the technical advantage that the method according to the invention can take into account graphical programming of the control program.
[0068] In an alternative, the case is described in which the user creates or modifies the graphical diagram by entering corresponding input commands in the graphical editor unit, for example, by adding or removing corresponding graphical program objects. This graphical diagram, modified or newly created by the graphical programming process, can subsequently be translated into a corresponding textual intermediate representation according to the embodiments described above, and this can be displayed to the user in the textual editor unit. Subsequently, the control program to be generated is created based on the graphical diagram created in the graphical programming process and / or based on the corresponding textual intermediate representation.The user can thus create the control program by performing a graphical programming operation and generating a corresponding graphical diagram according to the rules of the selected graphical programming language.
[0069] In a further alternative, the graphical diagram can be generated based on a pre-stored program file. This describes the case in which a graphical diagram already generated in a previous graphical programming process, which is stored in textual form in the pre-stored program file, is read in by the development environment and displayed to the user in the form of the graphical diagram in the graphical editor unit and in the form of the textual intermediate representation generated by the translation process and presented to the user in a readable form in the corresponding textual editor unit. Based on this, the user can execute a further graphical programming process according to the embodiment described above and, according to the described graphical input commands, modify the graphical editor unit accordingly by adding or removing graphical program objects.
[0070] According to one embodiment, the method further comprises:
[0071] Receiving textual input commands from the user by the textual editor unit of the development environment in a textual programming step, wherein the textual input commands add or remove textual program objects as textual representations of corresponding graphical program objects of the graphical diagram to or from the textual intermediate representation of the graphical diagram;
[0072] Generating a modified textual intermediate representation based on the textual input commands and the textual intermediate representation of the graphical diagram in a second generation step;
[0073] Translating the modified textual intermediate representation into a correspondingly modified graphical diagram and / or translating the textual program objects of the textual input commands into corresponding graphical program objects by the translation module in a third translation step;
[0074] Displaying the modified graphical diagram instead of the graphical diagram and / or displaying the graphical program objects translated from the textual program objects of the textual input commands in the graphical diagram as a modified graphical diagram in the graphical editor unit in a third display step;
[0075] Generating the control program based on the modified textual intermediate representation of the modified graphical diagram and / or based on the modified graphical diagram in the generating step; and
[0076] Displaying the modified textual intermediate representation of the modified graphical diagram in the textual editor unit in a fourth display step.
[0077] This can achieve the technical advantage that, through the described method, the user of the development environment can modify the existing graphical diagram based on the textual intermediate representation by executing a textual programming operation while taking the textual editor unit into account. Thus, by executing a textual programming operation, the user can make changes to the textual intermediate representation of the graphical diagram displayed in the textual editor unit and thereby create a modified textual intermediate representation. To do so, the user can enter appropriate input commands into the textual editor unit in order to modify the displayed textual intermediate representation. The textual input commands include adding or removing textual program objects from the textual intermediate representation.According to the invention, the textual program objects are textual representations of the graphical program objects of the graphical diagram. The graphical program objects are predefined by the rules of the selected graphical programming language.
[0078] When the textual intermediate representation is changed during the textual programming process, the textual editor unit receives the textual input commands entered by the user and makes a corresponding change to the textual intermediate representation displayed in the textual editor unit. This generates a modified textual intermediate representation.
[0079] Subsequently, the translation module translates the modified textual intermediate representation and generates a correspondingly modified graphical diagram. The graphical diagram is then displayed to the user in the graphical editor unit. The user can thus modify the graphical diagram, which was previously generated based on the graphical input commands executed in the graphical programming process or based on the program file, by executing a textual programming process in the textual editor unit and, based on this, generate a modified textual intermediate representation and a correspondingly modified graphical diagram.
[0080] The modified graphical diagram and the modified textual intermediate representation represent graphical and textual equivalents of one and the same control program to be generated. The same applies to the graphical diagram described above and the corresponding textual intermediate representation.
[0081] The aforementioned embodiment of the method according to the invention thus provides the user with the possibility of generating the control program in the selected graphical programming language both in a graphical programming process and in a textual programming process. The user can switch freely between graphical programming and textual programming, since the changes made in the graphical editor unit are immediately incorporated into the corresponding textual intermediate representation, and conversely, the changes made in the textual intermediate representation are immediately incorporated into the corresponding graphical diagram. The graphical diagram and the textual intermediate representation thus represent a unique equivalent of each other at all times, regardless of the editor unit in which the user made changes.
[0082] This further substantially simplifies the programming process. Some control program programming operations are easier to perform in the graphical editor unit, while others are easier to accomplish textually. For example, replicating program objects in the textual intermediate representation using a simple copy-and-paste approach is significantly easier than in the graphical diagram, where each graphical program object must be replicated individually and linked to the existing graphical program objects.
[0083] In addition, a simplification of the resulting control program can be achieved by taking into account the textual programming in the textual editor unit, where appropriate, generating a simplified graphical diagram, which can lead to a simplified control program with reduced runtime and reduced computing capacity.
[0084] Furthermore, the technical advantage can be achieved that by displaying the textual intermediate representation modified in the textual programming process in the textual editor unit, the user is immediately able to recognize errors or weaknesses of the modified graphical diagram corresponding to the modified textual intermediate representation based on the displayed modified textual intermediate representation.
[0085] According to one embodiment, the first translation step further comprises: determining the graphical program objects, a graphical behavior of the graphical diagram and at least one behavior position in a behavior determination step, wherein the graphical behavior describes a graphical representation of a program flow of the control program, and wherein the behavior position defines a position in a program code predefined by the IEC 61131-3 standard at which a behavior of a control program is to be positioned;
[0086] Translating the graphical program objects and the graphical behavior of the graphical diagram into textual program objects and a textual behavior of the textual intermediate representation in a behavior translation step, wherein the textual behavior represents a textual intermediate representation of the flow of the control program; and
[0087] Arranging the textual behavior at the behavior position within the textual intermediate representation in an ordering step.
[0088] This can achieve the technical advantage that, by taking the graphical behavior into account in the textual intermediate representation, an executable representation of the graphical diagram is provided by the textual intermediate representation. By arranging the correspondingly generated textual behavior, which represents a corresponding textual representation of the graphical behavior, within the textual intermediate representation at the behavior position specified in the IEC 61131-3 standard, the code provided by the textual intermediate representation complies with the requirements of the IEC 61131-3 standard. The graphical behavior describes a program flow of the graphical diagram. The graphical diagram can represent a function, a method, a function block, or a program section with multiple functions, methods, and / or function blocks.The graphical behavior describes the processes of the functions, methods, or function modules. According to the invention, the textual behavior represents a textual description of the graphical behavior. The readable representation of the textual intermediate representation enables the user to directly view the textual behavior. By arranging the textual behavior at the designated behavior positions within the textual intermediate representation, the user is immediately able to identify the textual behavior as such. This facilitates the readability of the textual intermediate representation.
[0089] In the context of the application, a behavior is a description of the functionality or effect of a program function. The behavior includes, for example, a procedure for calculating the function's result based on the function's parameters.
[0090] A behavior position, in the sense of the application, defines a location within the program code where the behavior must be located. The behavior position can be defined by guidelines of the respective programming language. In the automation field and the programming languages used there, the behavior position can be defined in the IEC 61131-3 standard.
[0091] According to one embodiment, the first translation step further comprises: determining identities of the graphical program objects of the graphical diagram in an identity determination step, wherein the identities of the graphical program objects enable a unique identification of the respective graphical program objects; and
[0092] Integrating the identities of the graphical program objects into the respective textual program objects of the textual intermediate representation assigned to the graphical program objects and written in textual lines in one integration step.
[0093] This can achieve the technical advantage that by determining the identities of the graphical program objects and integrating the respective identities into the corresponding textual program objects, a clear correspondence between the graphical program objects of the graphical diagram and the textual program objects of the textual intermediate representation is ensured. Furthermore, by integrating the identities of the graphical program objects into the corresponding textual program objects, it can be ensured that links between the graphical program objects in the graphical diagram are correctly incorporated into the textual program objects of the textual intermediate representation.By clearly specifying the identities within the textual program objects, which not only identify the respective textual program objects but also indicate the link to other textual program objects, the correctness of the textual intermediate representation with respect to the graphical diagram can be easily determined by the user by viewing the textual intermediate representation displayed in the textual editor unit. This, in turn, facilitates the verification of the correctness of the textual intermediate representation, which in turn facilitates the programming process and can lead to improved control programs.
[0094] According to one embodiment, the graphical program objects comprise graphically displayable meta-information, wherein the meta-information comprises at least one of the following list: author, creation date, version of the graphical diagram.
[0095] This can achieve the technical advantage that additional information regarding the creation of the graphical diagram or the creation of the corresponding textual intermediate representation can be provided in the graphical diagrams, which can be viewed by the user. Because the metainformation is directly visible to the user on the respective graphical program objects within the graphical diagram, the user can directly read the metainformation by simply viewing the graphical diagram and use this to draw conclusions about the creation of the graphical diagram. Furthermore, the user can directly see which version of the graphical diagram or the textual intermediate representation the respective graphical program object originates from. This allows the user to read the programming progress directly from the graphical diagram.
[0096] According to one embodiment, for interconnected graphical program objects, the identities of the interconnected graphical program objects are integrated into the corresponding textual program objects. This can achieve the technical advantage that the integration of the identities into the respective textual lines of the interconnected graphical program objects enables a clear structuring and arrangement of the textual lines in the textual intermediate representation. Furthermore, the integrated identities allow users to directly see the structure of the graphical diagram. The individual links are immediately legible. Furthermore, the identities can be used to arrange the textual lines by arranging the lines in the textual intermediate representation according to the identities.
[0097] According to one embodiment, the method further comprises: combining the textual intermediate representation of the graphical diagram with at least one further intermediate representation of at least one further graphical diagram to form a textual overall intermediate representation in a combining step, wherein in the overall intermediate representation a plurality of different textual intermediate representations of a plurality of different graphical diagrams are combined to form a coherent code in textual form.
[0098] This provides the technical advantage of providing a coherent code for the entire control program in the form of the overall textual intermediate representation. Individual executable objects of the control program can be represented or programmed using different graphical diagrams, if necessary, using different graphical programming languages. The respective textual intermediate representations can be combined in the overall textual intermediate representation. This means that only one coherent code, in the form of the overall textual intermediate representation, is required to represent the entire control program.
[0099] Furthermore, the text of the textual overall intermediate representation is readable by the user as a coherent text. The entire control program is thus stored in a common file and is available to the user in a readable form. The behavior of the respective graphical diagrams is arranged in the textual overall intermediate representation at the behavior positions specified by the IEC 61131-3 standard. The textual overall intermediate representation thus provides a textual form of an executable control program that meets the requirements of the IEC 61131-3 standard. According to one embodiment, the generation step comprises:
[0100] Performing a debugging operation based on the intermediate textual representation of the graphical diagram in a debugging step; and / or generating a binary representation of the control program in a binary code generation step.
[0101] This provides the technical advantage of enabling debugging of the created control program directly based on the textual intermediate representation of the graphical diagram. The textual intermediate representation thus not only represents a textual representation of the graphical diagram that can be displayed to the user in the textual editor unit for correction purposes, but also serves as a basis for subsequent compilation processes of the control program. The graphical diagram, on the other hand, merely represents a graphical representation of the textual intermediate representation that can be displayed to the user in the graphical editor unit and that the user can modify using the graphical programming process, as is known for graphical programming languages in the prior art.The textual intermediate representation, on the other hand, represents the representation that is relevant for generating the control program during the compilation process.
[0102] Furthermore, the technical advantage can be achieved that the binary representation of the control program can provide an executable representation of the control program.
[0103] According to one embodiment, the graphical programming language is one of the following group: ladder diagram, function block diagram, sequential function chart.
[0104] This makes it possible to achieve the technical advantage that the method according to the invention can be applied to the graphical programming languages commonly used in automation technology and defined in the IEC 61131-3 standard.
[0105] According to one embodiment, a syntax of the textual intermediate representation and the modified textual intermediate representation are conflict-free with a syntax of the graphical programming language. This can achieve the technical advantage that, due to the conflict-free nature of the syntax of the textual intermediate representation and the syntax of the graphical programming language, a unique textual intermediate representation can be provided that can be reliably used for programming a control program based on the graphical programming language.
[0106] According to one aspect, a development environment is provided with a graphical editor unit, a textual editor unit and a translation module, wherein the development environment is configured to execute the method for generating a control program for an automation system according to one of the preceding embodiments.
[0107] This makes it possible to achieve the technical advantage that an improved development environment can be provided which is configured to carry out the method according to the invention for generating a control program for an automation system with the above-mentioned technical advantages
[0108] The invention is explained in more detail with reference to the accompanying figures. Herein:
[0109] Fig. 1 is a schematic representation of a system for generating a control program for an automation system according to an embodiment;
[0110] Fig. 2 shows a further schematic representation of a system for generating a control program for an automation system according to a further embodiment;
[0111] Fig. 3 is a graphical representation of steps of a method for generating a control program for an automation system according to an embodiment;
[0112] Fig. 4 is a further graphical representation of further steps of the method for generating a control program for an automation system according to an embodiment;
[0113] Fig. 5 is a flowchart of the method for generating a control program for an automation system according to an embodiment; Fig. 6 is a further flowchart of the method for generating a
[0114] Control program for an automation system according to another embodiment; and
[0115] Fig. 7 shows a further flowchart of the method for generating a control program for an automation system according to a further embodiment.
[0116] Fig. 1 shows a schematic representation of a system for generating a control program 209 for an automation system according to one embodiment.
[0117] According to the invention, a development environment 200 suitable for executing the method according to the invention for generating a control program 209 for an automation system comprises a graphical editor unit 201, a textual editor unit 203 and a translation module 205.
[0118] The graphical editor unit 201 is designed to execute a graphical programming process according to a graphical programming language known from the prior art. The graphical editor unit 201 can have all input devices and display devices known from the prior art that are required to execute a graphical programming process.
[0119] The textual editor unit 203 is designed for a textual programming process. For this purpose, the textual editor unit 203 can include all display devices and input devices known from the prior art that are required to execute a textual programming process.
[0120] According to the invention, the translation module 205 is configured to translate a translation process between the graphical diagrams 211 of a predefined graphical programming language displayed or generated in the graphical editor unit 201 into corresponding textual intermediate representations 213. Furthermore, the translation module 205 is configured to perform an opposite translation, in which the textual intermediate representations 213 displayed or generated in the textual editor unit 203 are translated into corresponding graphical diagrams 211 of a previously selected graphical programming language.
[0121] According to one embodiment, the graphical programming languages taken into account by the method according to the invention or the development environment 200 according to the invention include the ladder diagram, function block diagram and sequential function chart languages, which are each predefined in the IEC 61131-3 standard for automation technology.
[0122] The translation module 205 is accordingly able to convert the aforementioned programming languages into textual intermediate representations 213.
[0123] According to the invention, the textual intermediate representations 213 are written in a form readable by the user. For this purpose, the textual intermediate representations 213 are written in a form based on a known and readable language, for example, English, German, Spanish, Mandarin, or a similar common world language. The letters, terms, or characters / special characters used are taken from the aforementioned natural languages. Furthermore, the textual intermediate representations 213 are displayed in line form and enable readability within a display field of the textual editor unit 203 from top left to bottom right, or follow another recognized readability convention.
[0124] In addition to the components shown, the development environment 200 may include additional components required for a compilation process or a programming process of a control program, which, however, are not shown in this illustration for reasons of clarity. These may include input or output interfaces, a compiler, a debugging module, and other components known from the prior art for programming.
[0125] To execute the method according to the invention for generating a control program for an automation system, a graphical diagram 211 is first translated by the translation module 205 into a corresponding textual intermediate representation 213. The graphical diagram 211 is a graphical representation of at least part of the control program 209 to be programmed. For this purpose, the graphical diagram 211 comprises at least one graphical program object 217. The graphical program object 217 represents a graphical representation of a program object 219 of the control program 209.
[0126] The graphical diagram 211 represents at least one executable structure of the control program 209, for example a function, a method or a function block.
[0127] By translating the graphical diagram 211 by the translation module 205, a textual intermediate representation 213 is generated. The textual intermediate representation 213 represents a textual description of the graphical diagram 211 and includes at least one textual program object 225.
[0128] The textual program object 225 corresponds to the graphical program object 217 of the graphical diagram 211 and represents a textual description of the graphical program object 217. The textual program object 225 includes at least a description of the type and function of the graphical program object 217. The types or functions of the graphical program objects 217 are defined by the standard IEC 61131-3.
[0129] If the graphical diagram 211 comprises a plurality of interconnected graphical program objects 217, as shown in Fig. 1, the corresponding textual program objects 225 further comprise information regarding the link to other textual program objects 225.
[0130] According to the invention, the translation of the graphical diagram 211 into the textual intermediate representation 213 is performed line by line. A corresponding textual program object 225 is assigned to each graphical program object 217. The textual program object 225 is defined by at least one textual line 241 of the textual intermediate representation 213. Preferably, in general, the textual program objects 225 are each represented by exactly one textual line 241 within the textual intermediate representation 213.
[0131] The correspondingly generated textual intermediate representation 213 thus comprises, depending on the number of graphical program objects 217 of the graphical diagram 211, a plurality of textual program objects 225 written as textual lines 241.
[0132] In the example shown in Fig. 1, the graphical diagram 211 comprises five graphical program objects 217. The five graphical program objects 217 comprise three node objects 249, which are each connected to one another via two edge objects 251.
[0133] The graphical diagram 211 shown here is merely an example of possible graphical diagrams 211 of the programming languages ladder diagram, function block diagram and sequential function chart.
[0134] In graphical diagrams 211 with a plurality of graphical program objects 217, the graphical program objects 217 are each provided with an identity 243. The graphical program objects 217 can be uniquely identified via the identities 243. The identities 243 can be formed, for example, as character and / or digit sequences.
[0135] When translating the graphical diagram 211 into the textual intermediate representation 213, the identities 243 of the graphical program objects 217 are integrated into the corresponding textual program objects 225. For this purpose, the identities 243 are integrated into the textual lines 241 of the textual program objects 225. This enables a unique assignment between the graphical diagram objects 217 and the corresponding textual program objects 225.
[0136] In the case of interconnected graphical program objects 217, the textual program objects 225 can incorporate, in addition to the identities 243 of the respective corresponding graphical program objects 217, the identities 243 of the graphical program objects 217 linked to the respective graphical program objects 217. From this, the user can directly determine the link between the various graphical program objects 217 from the textual intermediate representation 213 based on the identities 243.
[0137] The textual program objects 225 represented in the form of textual lines 241 can be arranged in the textual intermediate representation 213 according to the respective identities 243 of the graphical program objects 217 integrated into the textual program objects 225. In addition to the information regarding the type and / or functions of the respective graphical program objects 217, the corresponding textual program objects 225 can also include additional information.
[0138] For example, position information of the graphical program objects 217 can be integrated into the textual program objects 225. The position information describes position information regarding a positioning of the respective graphical program objects 217 of the graphical diagram 211 within the display device of the graphical editor unit 201. The position information can include, for example, x- and y-coordinates.
[0139] In addition to the position information, size information may be included, which also defines a size of the respective graphical program object 217 within the display device of the graphical editor unit 201 via the x and y coordinates.
[0140] The position or size information, which exclusively concerns the graphical representation of the graphical program objects 217 in the graphical editor unit 201, can, for example, be individually defined on a manufacturer-specific basis.
[0141] According to the invention, the correspondingly generated textual intermediate representation 213 is stored in a representation file 245.
[0142] The textual intermediate representation 213 stored in the representation file 245, including the plurality of textual program objects 225 embodied as textual lines 241, can be read by a version management system 207. The control programs 209 generated according to the inventive method for generating a control program and created according to a graphical programming language can thus be managed in the form of the corresponding textual intermediate representations 213 in a version management system 207.
[0143] In an embodiment not shown, the textual lines 241 of the textual intermediate representation 213 can be read by the version management system 207. This enables the version management system 207 to determine changes between different versions of the textual intermediate representations 213 uploaded to the version management system 207. Different versions of the textual intermediate representations 213 describe different versions of the graphical diagram 211, which in turn represent different versions of the control program 209.
[0144] According to one embodiment, the development environment 200 may further receive textual difference information 235.
[0145] According to the invention, the textual intermediate representation 213 is written in a readable form. The representation file 245 comprising the textual intermediate representation 213 is stored in a format that can be read by a version management system 207.
[0146] According to one embodiment, the development environment 200 is configured to receive difference information 235 from a version management system 207. The difference information 235 provides textual information describing a difference between a first version and a second version of the textual intermediate representation 213. The two versions of the textual intermediate representation 213 describe program code of the control program to be generated and can, for example, have been written at different times or by different authors. Using the textual difference information 235, the version management system 207 can thus represent in a compact form the difference between the versions of the textual intermediate representation 213 written, for example, at different times or by different authors.The textual difference information 235 provided by the version management system 207 thus makes it possible to track a programming progress of the control program 209 to be generated based on the different versions of the textual intermediate representation 213 loaded into the version management system 207.
[0147] The textual intermediate representations 213 are generated, as described above, by executing a graphical programming process using the graphical programming language. Different textual intermediate representations 213, which describe a common program code and are thus based on common graphical diagrams 211, are thus distinguished by at least one textual program object 225, which corresponds to a corresponding graphical program object 217 of the associated graphical diagram 211 and is contained exclusively in one of the two versions of the textual intermediate representation 213. To change the graphical diagrams 211 during the graphical programming process, graphical program objects 217 can be added to the existing graphical diagram 211 and / or removed from the graphical diagram 211.The newly added graphical program object 217 can be a new graphical program object 217 or a modified graphical program object 217. Accordingly, the textual intermediate representations 213 generated from the graphical diagrams 211 by the translation process are modified by adding or removing corresponding textual program objects 225. The textual difference information 235 thus comprises at least one textual program object 225 that is contained exclusively in one of the two versions of the textual intermediate representation 213. It is assumed here that the two versions of the textual intermediate representation 213 represent a common control program.
[0148] In the application, a change to graphical and / or textual program objects 217, 225 comprises deleting the graphical and / or textual program object 217, 225 to be changed and adding a correspondingly changed graphical and / or textual program object 217, 225. The same applies to other objects to be changed in this application.
[0149] The development environment 200 is further configured to display the information of the textual difference information 235 in one of the two versions of the textual intermediate representation 213 within the textual editor unit 203. The corresponding deleted or added textual program objects 225 can be displayed in one or both versions of the textual intermediate representation 213 within the textual editor unit 203 with appropriate identification as a deleted or added textual program object 217. The identification of the deleted or added textual program objects 225 can be effected, for example, by color or graphic identification, in the form of hatching or other graphic identification.
[0150] The correspondingly deleted or added textual program objects 225 of the textual difference information 235 can thus be displayed in one or both of the versions of the textual intermediate representation 213 together with the respective version of the textual intermediate representation 213 within the textual editor unit 203. The correspondingly added or deleted textual program objects 225 of the textual difference information 235 can thus be displayed in the textual editor unit 203 with the corresponding labeling inserted into the respective versions of the textual intermediate representation 213.
[0151] Alternatively, the added or deleted textual program objects 225 of the textual difference information 235 can be displayed individually in the textual editor unit 203.
[0152] In a further embodiment, alternatively or additionally, a translation of the added or deleted textual program objects 225 of the textual difference information 235 into correspondingly added or deleted graphical program objects 217 can be carried out and corresponding graphical difference information can be generated in this way.
[0153] The added or deleted graphical program objects 265, 267 of the graphical difference information can then be graphically displayed in the versions of the associated graphical diagram 211 corresponding to the textual intermediate representation 213 in the graphical editor unit 201.
[0154] Analogous to the deleted or added textual program objects 225, the corresponding deleted or added graphical program objects 217 can be displayed with corresponding graphic or color markings. The added or deleted graphical program objects 217 of the graphical difference information can be displayed in one or both versions of the graphical diagrams 211 in the graphical editor unit 201, analogous to the above description. The deleted or added graphical program objects 217 can be integrated into the respective versions of the graphical diagram 211. Alternatively or additionally, the deleted or added graphical program objects 217 of the graphical difference information can be displayed separately in the graphical editor unit 201.
[0155] By taking into account the textual difference information 235 or the corresponding graphical difference information, the corresponding added or deleted textual program objects 225 or graphical program objects 217 can be displayed to the user at a glance. The corresponding color or graphical marking can immediately indicate to the user whether a textual or graphical program object 225, 217 has been deleted or added. This can be displayed to the user, for example, based on the identities 243 of the graphical or textual program objects 217, 225. Thus, the user can see the programming progress at a glance in the form of the differences between the two versions of the program code.
[0156] The two versions of the textual intermediate representation 213 can be constructed based on one another, with the first version being created at an earlier point in time than the second version, for example. Changes between the two versions by inserting a modified textual program object 217 can be represented, for example, by a pair of textual program objects, the pair comprising a deleted textual program object and an added textual program object. The pair can be determined based on the identities 243 of the respective textual program objects 225.
[0157] The deleted textual program object 225 is deleted from the first version of the textual intermediate representation 213, while the added textual program object 225 is added to the second version of the textual intermediate representation 213. The two program objects, the deleted and the added program object 225, each describe the same program object 219 of the control program 209 in terms of the same identities 243 and based on the same graphical program object 217 of the graphical diagram 211. The added textual program object 217 represents a change to the original textual program object 217, i.e., the textual program object 225 deleted from the first version of the textual intermediate representation 213.
[0158] According to a further embodiment, the development environment 200 is further configured to receive textual conflict information 269 from the version management system 207. The textual conflict information 269 describes possible conflicts between the two versions of the textual intermediate representation 213. Possible conflicts between versions of the textual intermediate representation 213 can occur in cases where a textual program object 225 is assigned to the first version of the textual intermediate representation 213 and another textual program object 225 is assigned to the second version of the textual intermediate representation 213. The two textual program objects 225 describe the same program object 219 of the control program 209 in the sense of identical identities 243 and are based on the same graphical program object 217 of the graphical diagram 211.The two textual program objects 225 accordingly have the same identity 243 of the corresponding graphical program object 217, but are changed or different relative to each other.
[0159] The development environment 200 is further configured to determine corresponding conflicts between the two versions of the textual intermediate representation 213 based on the textual conflict information 269. For this purpose, a corresponding conflict check is performed, and an existing conflict between two versions of the textual intermediate representation 213 is determined if the textual conflict information 269 lists a pair of textual program objects 217, of which both textual program objects 217 have the same identity 243 of a corresponding graphical program object 217, but of which one textual program object 225 is assigned to the first version of the textual intermediate representation 213, while the other textual program object 225 is assigned to the corresponding second version of the textual intermediate representation 213.
[0160] Corresponding conflicts can occur, for example, with modified textual program objects 225 which, as described above, consist of a pair consisting of a deleted textual program object 225 and an added textual program object 225, each of which refers to the same graphical program object 217.
[0161] The two versions of the textual intermediate representation 213 may have been edited and modified by two different developers. The corresponding versions of the textual intermediate representation 213 may be based on a common textual intermediate representation 213, compared to which the versions of the textual intermediate representation 213 have been modified. The modified textual program objects 225 have the same identity 243 but are defined differently from one another.
[0162] According to a further embodiment, the textual conflict information 269 can be translated into graphical conflict information. In this case, the corresponding textual program objects 225 of the textual conflict information 269 are translated into corresponding graphical program objects 217. The correspondingly generated graphical conflict information 271 can then be displayed in the graphical editor unit 201.
[0163] Resolving the conflict may subsequently involve deleting one of the textual or graphical program objects 217, 225 from one of the two versions of the graphical intermediate representation 213 or the graphical diagram 211.
[0164] To generate the graphical diagram 211, the method for generating a control program for an automation system further comprises taking into account graphical input commands 215 that are entered into the development environment 200 by a user during a graphical programming process and / or information from a program file 221 for creating the graphical diagram 211.
[0165] A graphical diagram 211 is stored in text form in the program file 221. By reading the information from the program file 221 through the development environment 200, the graphical editor unit 201 can generate a corresponding graphical diagram 211 based on the information from the program file 221 and display it to the user in the graphical editor unit 201.
[0166] In this alternative, the case is described that an already existing graphical diagram 211 stored in the program file 221 is loaded by the development environment 200 and displayed to the user in the graphical editor unit 201 for further processing.
[0167] According to a further alternative, the aforementioned graphical input commands 215 are taken into account to generate the graphical diagram 211. The graphical input commands 215 are programming commands that are transmitted by a user of the development environment 200 to the graphical editor unit 201 in a graphical programming process. The graphical input commands 215 can, for example, include adding or removing graphical program objects 217 of the graphical diagram 211.
[0168] This alternative describes the case where, during a graphical programming process, a user of the development environment 200 changes a graphical diagram 211 within the graphical editor unit 201 or completely regenerates a graphical diagram 211. The present invention also encompasses a combination of the two alternatives, in which, for example, an existing graphical diagram 211 stored in text form in the program file 221 is first uploaded to the graphical editor unit 201 by reading in the information from the program file 221 and is displayed to the user therein for further processing.
[0169] By executing a graphical programming process in which the user transmits graphical input commands 215 in the form of adding or removing graphical program objects 217 to or from the graphical diagram 211 to the graphical editor unit 201, and thus the graphical diagram 211 previously loaded into the graphical editor unit 201 based on the information of the program file 221 is modified or further developed.
[0170] Based on the graphical input commands 215 and / or based on the information of the program file 221, the graphical diagram 211 is subsequently generated by the graphical editor unit 201.
[0171] According to one embodiment, the graphical diagram 211 thus generated may further be displayed in the graphical editor unit 201.
[0172] Analogously, the textual intermediate representation 213 generated by the translation of the graphical diagram 211 can be displayed in the textual editor unit 203.
[0173] This allows the user to detect errors in the graphical diagram 211 and correct them if necessary.
[0174] The control program 209 can subsequently be generated based on the graphical diagram 211 and / or based on the textual intermediate representation 213.
[0175] According to one embodiment, in order to translate the graphical diagram 211 into the textual intermediate representation 213, the graphical program objects 217 and a graphical behavior 233 of the graphical diagram 211 as well as a behavior position 239 of the graphical behavior 233 are first determined.
[0176] The graphical behavior 233 describes the program flow of the graphical diagram
[0177] 211. Behavior position 239, on the other hand, describes a position predefined in the IEC 61131-3 standard at which corresponding behaviors are to be arranged in a program code.
[0178] The graphical behavior can be determined by considering volatile representations of the graphical diagram 211. As is known from the prior art, graphical diagrams 211 written in graphical programming languages are represented in volatile representations. The volatile representations are not permanently stored in memory, but exist exclusively during the creation or display of the graphical diagrams in the graphical editor unit 201 in the working memory of the computer executing the development environment 200. The volatile representations are present as bit sequences and represent the individual components, including the graphical program objects 217 of the graphical behavior, of the graphical diagram 211.
[0179] By reading the volatile representations by the development environment 200, the graphical program objects 217 and the graphical behavior can be identified. Furthermore, the position and size information of the graphical diagram 211 and the graphical program objects 217 contained therein can be determined by reading them. The position and size information describe the positions and sizes at and with which the individual components, i.e., the graphical program objects 217, are displayed in the graphical editor unit 201.
[0180] Taking into account the ephemeral representations of the graphical diagram 211, the corresponding textual intermediate representation 213, including the textual program objects 225 and the textual behavior 237, can be translated from the graphical diagram 211.
[0181] According to one embodiment, after the generation of the textual intermediate representation 213 and the display of the textual intermediate representation 213 in the textual editor unit 203, the control program 209 represented by the graphical diagram 211 and the textual intermediate representation 213 is generated based on the graphical diagram 211 and / or based on the textual intermediate representation 213.
[0182] For this purpose, according to one embodiment, a debugging process can first be performed based on the textual intermediate representation 213. For this purpose, the development environment 200 can comprise a component configured to perform a debugging process, for example, in the form of a compiler.
[0183] According to one embodiment, the control program 209 is generated in a binary representation. The binary representation can, in turn, be stored in the representation file 245.
[0184] Fig. 2 shows a further schematic representation of a system for generating a control program 209 for an automation system according to a further embodiment.
[0185] The embodiment in Fig. 2 is based on the embodiment in Fig. 1 and includes all features described therein. As long as these remain unchanged in the embodiment in Fig. 2, a detailed description will be omitted.
[0186] In the embodiment shown, the development environment 200 is capable of providing the user with the option of a textual programming operation. The textual programming operation is performed on the textual intermediate representation 213. Through the textual programming operation, the user can thus modify the textual intermediate representation 213 of Fig. 1, for example, by adding or removing textual program objects 225 to or from the textual intermediate representation 213, modify the textual intermediate representation 213, and generate a modified textual intermediate representation 227.
[0187] For this purpose, the textual editor unit 203 receives corresponding textual input commands 223. The textual input commands 223 describe the programming commands entered by the user during the textual programming process, through which textual program objects 225 are added or removed. The textual input commands 223 can individually depend on the language used to display the textual intermediate representations 213 or modified textual intermediate representations 227 or the textual program objects 225, and on the respective individual textual descriptions of the graphical program objects 217 in the textual program objects 225.
[0188] The syntax of the textual intermediate representation 213 or modified textual
[0189] Intermediate representations 227 corresponds to the syntax of the graphical
[0190] Programming language predefined in the above-mentioned IEC 61131 / 3 standard. In the embodiment shown, the modifications to the textual intermediate representation 213 of Fig. 1 based on the user's textual input commands 223 include the addition of two additional textual program objects 247. The two additional textual program objects 247 are textually represented by textual lines 241 according to the original textual program objects 225, according to the properties described above.
[0191] By executing a translation process by the translation module 205, a correspondingly modified graphical diagram 231 is generated from the modified textual intermediate representation 227. Two additional graphical program objects 229 are integrated into the modified graphical diagram 231, corresponding to the modified textual intermediate representation 227. In the embodiment shown, the two additional graphical program objects 229 are linked to the graphical program objects 217 to form a coherent graphical diagram.
[0192] In the embodiment shown, the user is thus able to modify a previously generated graphical diagram 217 by executing a corresponding textual programming operation. The user is thus able to generate the control program 209 based on the previously selected graphical programming language both by executing a graphical programming operation, as described for Fig. 1, and by executing a textually based programming operation, as described for Fig. 2.
[0193] The user can thus freely select the most convenient programming method and can also switch between the various textual or graphical programming processes during programming. Changes made during one programming process are immediately displayed in the other representation through translation. Changes made in the graphical diagram 211 are immediately displayed in the textual intermediate representation 213 or modified textual intermediate representations 227 through translation. Similarly, changes made in the textual intermediate representation 213 or modified textual intermediate representations 227 are immediately displayed in the graphical diagram 211 or the modified graphical diagram 231 after translation.Graphical program objects 217 newly added or deleted in the graphical diagram 211 are correspondingly displayed as newly added or deleted textual program objects 225 in the textual intermediate representation 213 or are integrated into it or deleted from it.
[0194] Fig. 3 shows a graphical representation of steps of a method 100 for generating a control program 209 for an automation system according to one embodiment.
[0195] Fig. 3 graphically illustrates the consideration of the difference information 235 of the version management system 207 by the development environment 200. The difference information 235 includes information regarding a difference between a first version 253 of the textual intermediate representation 213 and a second version 255 of the textual intermediate representation 213.
[0196] Figure a) shows the first version 253 of the textual intermediate representation 213, figure b) shows the textual difference information 235 and figure c) shows the second version 255 of the textual intermediate representation 213.
[0197] In the first version 253 of the textual intermediate representation 213, there are, by way of example, five textual program objects 225, in the form of a first textual program object 293, a second textual program object 295, a third textual program object 297, a fourth textual program object 299 and a fifth textual program object 301.
[0198] The second version 255 of the textual intermediate representation 213 also comprises five textual program objects 225 in the form of a sixth textual program object 303, the fourth textual program object 299, the fifth textual program object 301, a seventh textual program object 305 and an eighth textual program object 307.
[0199] The textual difference information 235 represents the differences between the first version 253 of the textual intermediate representation 213 and the second version 255 of the textual intermediate representation 213 in textual form. In the embodiment shown, the individual textual program objects 225 of the two first and second versions 253, 255 of the textual intermediate representation 213 are represented with the respective identities ID1, ID2, ID3, ID4, ID5, ID6. Furthermore, the represented textual program objects 225 are represented by the represented plus or minus signs as deleted or added textual program objects 261, 263. Thus, a transition from the first version 253 of the textual intermediate representation 213 to the second version 255 of the textual intermediate representation 213, or in the opposite direction, can be effected via the textual difference information 235.
[0200] The first textual program object 293 describes a first node object 273 of a graphical diagram 211. The second textual program object 295 describes a second node object 275, the fourth textual program object 299 describes a third node object 277, the third textual program object 297 describes an edge object 283 between the first node object 273 and the second node object 275, the fifth textual program object 301 describes an edge object 285 between the first node object 273 and the third node object 277. The sixth textual program object 303 describes a fourth node object 279, and the seventh textual program object 305 describes a fifth node object 281. The eighth textual program object 307 describes an edge object 287 between the third node object 277 and the fifth node object 281.
[0201] Analogous to the embodiment in Fig. 1, the textual program objects 225 of the two first and second versions 253, 255 of the textual intermediate representation 213 are provided with identities 243 of the corresponding graphical program objects 217.
[0202] The first textual program object 293 comprises a first identity ID1, the second textual program object 295 comprises a second identity ID2, the third textual program object 297 comprises a third identity ID3, the fourth textual program object 299 comprises a fifth identity ID5, the sixth textual program object 303 comprises a sixth identity ID6, the seventh textual program object 305 comprises a seventh identity ID7, and the eighth textual program object an eighth identity ID8. The identities 243 identify the respective graphical program objects 217 of the graphical diagram 211, which are referenced by the textual program objects 225.
[0203] The textual program objects 225 are represented in the first and second versions 253, 255 of the textual intermediate representation 213 according to the invention in textual lines 241. In the first version 253 of the textual intermediate representation 213, the first textual program object 293, the second textual program object 295, and the third program object 297 are each marked as deleted textual program objects 263. The aforementioned first to third textual program objects 293, 295, 297 are thus not listed in their form in the first version 253 of the textual intermediate representation 213 in the second version 255 of the textual intermediate representation 213.
[0204] The fourth textual program object 299 and the fifth textual program object 301, however, are adopted unchanged in the second version 255 of the textual intermediate representation 213.
[0205] The seventh textual program object 305 and the eighth textual program object 307, however, represent textual program objects 265 that have been newly added to the second version 255 of the textual intermediate representation 213 compared to the first version 253 of the textual intermediate representation 213.
[0206] Compared to the first version 253 of the textual intermediate representation 213, the sixth textual program object 303 represents a textual program object that has been modified in the second version 255 of the textual intermediate representation 213. The sixth textual program object 303 is based on the first textual program object 293. This is characterized in that the first identity ID1 of the first textual program object 293 has the identical numerical value as the sixth identity ID6 of the sixth textual program object 303.
[0207] The first textual program object 293 and the sixth textual program object 303 represent a pair of a deleted textual program object 263 and an added textual program object 261. The sixth textual program object 303 newly added in the second version 255 of the textual intermediate representation 213 is changed compared to the first textual program object 293 of the first version 253 of the textual intermediate representation 213.
[0208] Graphics d) to g) show graphical diagrams 211 that depict different stages of a transition between the first version 253 of the textual intermediate representation 213 and the second version 255 of the textual intermediate representation 213. A graphical diagram 211 depicted in graphic d) describes the first version 253 of the textual intermediate representation 213. The graphical diagram 211 of graphic d) comprises the first node object 273, the second node object 275, and the third node object 277. The first node object 273 and the second node object 275 are connected to one another by the edge object 283. The first node object 273 and the third node object 277 are correspondingly connected via the edge object 285. The graphical diagram 211 of graphic d) depicts a first version 257 of the graphical diagram 211.
[0209] The graphical diagram 211 of figure g), on the other hand, describes the second version 255 of the textual intermediate representation 213 and thus represents a second version 259 of the graphical diagram 211. The graphical diagram 211 accordingly comprises the fourth node object 279, the third node object 277, and the fifth node object 281. The fourth node object 279 is connected to the third node object 277 via the edge object 285. The third node object 277 is connected to the fifth node object 281 via the edge object 287.
[0210] Both graphics e) and f) now show steps in which the second version 259 of the graphical diagram 211 can be created from the first version 257 of the graphical diagram 211. In graphic e), the fifth node object 281 is first added relative to the first version 257 of the graphical diagram 211 and connected to the third node object 277 via the edge object 287.
[0211] In figure e), the first node object 273 is marked as a deleted graphical program object 267. The same applies to the second node object 275, which is also marked as a deleted graphical program object 267. Furthermore, the fifth node object 281 and the edge object 287 are marked as added graphical program objects 265, respectively.
[0212] In figure f), compared to figure e), the first node object 273 is replaced by the fourth node object 279. Analogous to the first node object 273, the fourth node object 279 is connected to the second node object 275 and the third node object 277 via the edge objects 283, 285.
[0213] Starting from graphic f), to achieve the second version 259 of the graphical diagram 211 of graphic g), the second node object 275 and the edge object 283 are deleted according to the second version 255 of the textual intermediate representation 213. In graphics d) to g), the difference between the first node object 273 and the fourth node object 279 is primarily determined by the position of the node object within the graphical diagram 211. Further differences in the functionalities or effects of the node objects 273, 279 may exist.
[0214] The design of the graphical diagrams 211 as well as the textual intermediate representations 213 in Fig. 3 are merely exemplary and are intended exclusively to illustrate the functionality of the present method.
[0215] Fig. 4 shows a further graphical representation of further steps of the method 100 for generating a control program 209 for an automation system according to an embodiment
[0216] Fig. 4 shows the first and second versions 253, 255 of the textual intermediate representation 213 of Fig. 3. Furthermore, textual conflict information 269 is shown. The textual conflict information 269 displays, in textual form, the various textual program objects 225 of the various versions 253, 255 of the textual intermediate representation. The textual program objects 225 are represented analogously to the difference information 235 of Fig. 3 based on their identities ID1, ID2, ID3, ID4, ID5, ID6, ID7, ID8. Furthermore, the textual conflict information 269 specifies, for each represented textual program object 225, the corresponding version 253, 255 of the textual intermediate representation 213 to which the respective textual program object 225 is assigned.
[0217] In graphic d), the diagram includes all elements of the first and second versions 253, 255 of the textual intermediate representation 213 and thereby shows the conflicts between the two versions 253, 255. Thus, the graphical diagram 211 of graphic d) includes the first node object 273, the second node object 275, and the third node object 277, as well as the edge object 283 and the edge object 285 of the first version 253 of the textual intermediate representation 213. Furthermore, the graphical diagram 211 includes the fourth node object 279, the fifth node object 281, and the edge object 287 of the second version 255 of the textual intermediate representation 213.
[0218] In the embodiment shown, the first node object 273 and the fourth node object 279 are based on a common node object as a basis, but are different from one another. This can occur, for example, if the control program is developed by different developers, each of whom creates different versions of the control program or the graphical diagrams 211 and / or the textual intermediate representations 213. In the respective versions, the aforementioned node objects 273, 279 were developed in different forms. Both node objects 273, 279 are thus based on the same object and consequently have the same identity, which is represented by the same numerical value of the first identity ID1 of the first textual program object 293 or the first node object 273 and the sixth identity ID6 of the sixth textual program object 303 or the fourth node object 279, but differ from one another.
[0219] The two node objects 273, 279 thus represent a conflict because both node objects 273, 279 have the same identity and thus refer to the same program object 219 of the control program 209, but are assigned to different versions 253, 255 of the textual intermediate representation 213 or the program code of the control program 209, respectively, and are different relative to each other. For example, both node objects 273, 279 describe a function or a variable, but these are defined differently in the respective versions.
[0220] Furthermore, the graphical diagram 211 of graphic d) comprises the third node object 277 and the edge object 285 connecting the first node object 273 and the third node object 277 or the fourth node object 279 and the third node object 277. Both the third node object 277 and the edge object 285 are adopted in the second version 255 of the textual intermediate representation 213 without changes from the first version 253 and thus do not represent a conflict.
[0221] To resolve the conflict, the development environment 200 is able to identify the individual textual program objects 225 from the textual conflict information 269 and assign them to the different versions 253, 255 of the textual intermediate representation 213.
[0222] In the example shown, the development environment 200 is explicitly able to determine that the first textual program object 293 and the sixth textual program object 303 are based on a common object. The development environment 200 thus recognizes that the first textual program object 293 of the first version 253 of the textual intermediate representation 213 and the sixth textual program object 303 of the second version 255 of the textual intermediate representation 213 are based on a common textual program object 225 and were changed independently of one another in the respective versions of the textual intermediate representation 213. To resolve the conflict, in the example shown, the development environment 200 deletes the first node object 273 corresponding to the first program object 293 from the diagram 211 of graphic d) and replaces it with the fourth node object 279, which corresponds to the sixth textual program object 303 of the second version 255.
[0223] Alternatively, the fourth node object 279 corresponding to the sixth textual program object 303 can also be deleted from the graphical diagram 211.
[0224] Alternatively, the program object 293 to be deleted is displayed to the user by the development environment 200 so that the user can delete the program object 293 manually.
[0225] The fourth textual program object 299 and the fifth textual program object 301, however, are adopted unchanged in the second version 255 of the textual intermediate representation 213, since there is no conflict here.
[0226] Accordingly, the graphical diagram 211 of figure e) is generated in which the conflict is resolved and which corresponds to the second version 255 of the textual intermediate representation 213.
[0227] If further conflicts occur, the development environment 200 proceeds accordingly with further objects of the textual conflict information 269 and deletes the corresponding graphical program objects 217 or leaves them in the respective graphical diagram 211. Alternatively, this can also be done manually by the user.
[0228] Fig. 4 shows the case where the two versions 253, 255 of the textual intermediate representation 213 are based on a common version.
[0229] Alternatively, based on the conflict information 269, the conflicts are displayed to a user by the development environment 200 so that the conflicts can be manually resolved by the user. Figure 5 shows a flowchart of the method 100 for generating a control program 209 for an automation system according to one embodiment.
[0230] To generate a control program 209, a graphical diagram 213 of a graphical programming language is first translated into a textual intermediate representation 213 of the graphical diagram 211 by the translation module 205 of the development environment 200 in a first translation step 101.
[0231] The graphical diagram 211 graphically depicts at least a portion of the control program 209 to be generated according to the graphical programming language. The textual intermediate representation 213 further provides a textual description of the graphical diagram 211. For this purpose, the graphical diagram comprises at least one graphical program object 217, each of which depicts a graphical representation of a program object 219 of the control program 209. The textual intermediate representation 213 accordingly comprises at least one textual program object 225, which is a textual description of the graphical program object 217 of the graphical diagram 211.
[0232] To translate the graphical diagram 211, a line-by-line translation of the graphical diagram 211 into the intermediate representation 213 is performed in a line-by-line translation step 103. In the line-by-line translation, each graphical program object 217 is assigned at least one textual program object 225 in the form of a textual line 241 of the textual intermediate representation 213. The textual lines 241 represent a unique description of the respective graphical program objects 217.
[0233] The graphical programming language can be a graphical programming language defined by the IEC 61131-3 standard, for example ladder diagram, function block diagram, sequential function chart.
[0234] The textual intermediate representation 213 is preferably written in a version that is readable by the user of the development environment 200.
[0235] Finally, in a storage step 105, the textual intermediate representation 213, or the representation on which the generated control program 209 is based, is stored in a representation file 245. Preferably, the textual intermediate representation 213 is stored in the representation file 245 in a form that can be read by a version control system known from the prior art.
[0236] Fig. 6 shows a flowchart of the method 100 for generating a control program 209 for an automation system according to an embodiment.
[0237] The embodiment shown in Fig. 6 is based on the embodiment in Fig. 5 and includes all the method steps shown there. As long as these remain unchanged, a repeated description will be omitted.
[0238] In the embodiment shown, the graphical diagram 211 is displayed in a first display step 107 in the graphical editor unit 201 of the development environment 200. The graphical editor unit 201 can comprise a corresponding display device for this purpose.
[0239] Furthermore, in a receiving step 113, the development environment 200 first receives textual difference information 235 from a version management system 207.
[0240] The textual difference information 235 describes a difference between a first version 253 of the textual intermediate representation 213 and a second version 255 of the textual intermediate representation 213. The first version 253 and the second version 255 of the textual intermediate representation 213 are each representations of a first version 257 and a second version 259 of the graphical diagram 211. The first and second versions 257, 259 of the graphical diagram 211 can each have been written sequentially in the programming process and / or by different users.
[0241] The textual difference information 235 further defines at least one textual program object 225 that is contained in only one of the two versions 253, 255 of the textual intermediate representation 213. The textual difference information 235 thus describes in textual form the differences between the versions 253, 255 of the textual intermediate representation 213. The different versions 253, 255 of the textual intermediate representation 213 correspond to different versions of the graphical diagram 211, which in turn represent different versions of the generated program code of the control program 209.
[0242] Subsequently, in a second display step 109, the textual intermediate representation 213 generated by the translation of the graphical diagram 211 is displayed in a textual editor unit 203 of the development environment 200.
[0243] The user can thus check the functionality or error-freeness of the graphical diagram 211 or the control program 209 by inspecting the displayed graphical diagram 211 or the displayed textual intermediate representation 213.
[0244] In the embodiment shown, the method further comprises a conflict determination step 123. In the conflict determination step 123, the development environment 200 receives textual conflict information 269 from the version management system 207 and performs a conflict check between the first version 253 of the textual intermediate representation 213 and the second version 255 of the textual intermediate representation 213.
[0245] The textual conflict information 269 includes textual program objects 225 associated with a first version 253 of the textual intermediate representation 213, and textual program objects 225 associated with a second version 255 of the textual intermediate representation 213. The two versions of the textual intermediate representation 213 describe two versions of the graphical diagram 211, or of the control program 209, respectively. The two versions were written at different times and / or by different authors during the programming process.
[0246] After receiving the textual conflict information 269, a conflict determination step 125 determines whether at least one textual program object 225 associated with the first version 253 of the textual intermediate representation 213 and one textual program object 225 associated with the second version 255 of the textual intermediate representation 213 have been identified, which have an identical identity 243 but different definitions. Two textual program objects 225 have different definitions if the textual program objects 225 comprise different semantics, i.e., if the textual program objects 225 define different program-technical objects.
[0247] This can occur, for example, when different developers independently program the same program code.
[0248] Conflict determination step 125 includes a conflict translation step 159. In conflict translation step 159, translation module 205 translates textual conflict information 269 into graphical conflict information 271. Graphical conflict information 269 includes the graphical program objects 217 corresponding to textual program objects 225 of textual conflict information 269.
[0249] In a conflict resolution step 161, the conflict is resolved. For this purpose, the at least one graphical program object 217 corresponding to a textual program object 225 assigned to the first version 253 of the textual intermediate representation 213 and having an identical identity 243 to another graphical program object 217 corresponding to a textual program object 225 assigned to the second version 255 of the textual intermediate representation 213 is deleted.
[0250] Conflict resolution 200 can be initiated by the development environment or alternatively by a user.
[0251] In a textual display step 115, the at least one textual program object 225 of the textual difference information 235 is displayed in the textual editor unit 203.
[0252] For this purpose, in a marking step 121, the textual program object 225 of the textual difference information 235 and / or the graphical program object 217 of the graphical difference information 289, 291 is displayed as an added textual program object 261 or an added graphical program object 265 or as a deleted textual program object 263 or as a deleted graphical program object 267.
[0253] In a difference translation step 117, the textual difference information 235 is translated into graphical difference information by translating the at least one textual program object 225 into a corresponding graphical program object 217. In a graphical display step 119, the at least one graphical program object 217 of the graphical difference information 235 is displayed in the graphical editor unit 201 of the development environment 200.
[0254] For this purpose, in a marking step 121, the textual program object 225 of the textual difference information 235 and / or the graphical program object 217 of the graphical difference information 289, 291 is displayed as an added textual program object 261 or an added graphical program object 265 or as a deleted textual program object 263 or as a deleted graphical program object 267.
[0255] The identification of the textual or graphical program objects can be effected, for example, by appropriate coloring or hatching of the respective program object 217, 225 within the graphical diagram 211 or within the textual intermediate representation 213.
[0256] In the textual intermediate representation 213, the added or deleted textual program objects 261, 263 can be represented as correspondingly added or deleted textual lines 241, optionally with corresponding graphic or color identification.
[0257] Accordingly, the added or deleted graphical program objects 265, 267 can be represented within the graphical diagram 211 by the aforementioned graphical or color identification, for example as added or deleted node objects 249 and / or edge objects 251.
[0258] Subsequently, in a generation step 111, the control program 209 is generated based on the textual intermediate representation 213 and / or based on the graphical diagram 211.
[0259] Fig. 7 shows a further flowchart of the method 100 for generating a control program 209 for an automation system according to a further embodiment.
[0260] The embodiment in Fig. 7 is based on the embodiment in Fig. 6 and includes all method steps described therein. As long as these remain unchanged, a detailed description will be omitted. In the embodiment shown, two cases for providing the graphical diagram 211 are described, among other things.
[0261] In one case, a program file 221 is read by the development environment 200 in a reading step 129. A description of the graphical diagram 211 is stored in text form in the program file 221.
[0262] In a second translation step 131, the textual information of the program file 221 is translated into the graphical diagram 211.
[0263] This describes the case in which, to generate the graphical diagram 211, a previously generated graphical diagram 211, temporarily stored in text form in the program file 221, is generated by the development environment 200 reading the information from the program file 221. This encompasses the case in which a graphical diagram 211, previously generated at an earlier point in time, is loaded into the development environment 200 in order to subsequently be further processed or modified by executing corresponding programming operations.
[0264] In the second case, in a graphical programming step 127, graphical input commands 215 from a user of the development environment 200 are first received by the graphical editor unit 201. The graphical input commands 215 include programming commands for adding and / or removing graphical program objects 217. The graphical program objects 217 are subelements of the graphical diagram 211 and represent program objects 219 of the control program 209 to be generated.
[0265] This describes the case of a graphical programming process. The graphical input commands 215 correspond to programming actions that are entered by the user during programming according to the graphical programming language. Through the graphical programming process, an existing graphical diagram 211 displayed in the graphical editor unit 201 can be modified by adding or removing graphical program objects 217. Alternatively, a completely new graphical diagram 211 can be generated by executing the graphical programming process. Furthermore, the first translation step 101 comprises a behavior determination step 143. In the behavior determination step 143, the graphical program objects 217 and a graphical behavior 233 of the graphical diagram 211 are determined. Furthermore, a behavior position 239 of the graphical behavior 233 of the graphical diagram 211 is determined.
[0266] The graphical behavior 233 is a graphical representation of a program flow of the control program 209. The behavior position 239 of the graphical behavior 233 describes a position of the graphical diagram 211 within the corresponding program code comprising at least the graphical diagram 211.
[0267] In a behavior translation step 145, the graphical program objects 217 and the graphical behavior 233 are subsequently translated into textual program objects 225 and a textual behavior 237 of the textual intermediate representation 213. The textual behavior 237 represents a textual representation of the program flow of the control program 209.
[0268] In an arrangement step 147, the textual behavior 237 is subsequently arranged within the textual intermediate representation 213 at the behavior position 239. The behavior position 239 defines the arrangement of the textual behavior 237 within the textual intermediate representation 213.
[0269] The individual textual program objects 225 represented as textual lines 241 can be arranged according to the integrated identities 243.
[0270] In an identity determination step 149, identities 243 of the graphical program objects 217 of the graphical diagram 211 are determined. The identities 243 enable a unique identification of the respective graphical program objects 217.
[0271] The determined identities 243 of the graphical program objects 217 are subsequently integrated into the respective textual program objects 225 represented by the textual lines 241 in an integration step 151. Conversely, the identities 243 of the textual program objects 225 can also be integrated into the graphical program objects 217. In the embodiment shown, furthermore, in a textual programming step 133, the textual editor unit 203 of the development environment 200 first receives textual input commands 223 from the user. The textual input commands 223 add or remove textual program objects 225 as textual representations of corresponding graphical program objects 217 of the graphical diagram 211 to the textual intermediate representation 213. The textual program objects 225 are textual representations of the graphical program objects 217 of the graphical diagram 211.
[0272] In a second generation step 135, a modified textual intermediate representation 227 is generated based on the textual input commands 223 and the textual intermediate representation 213.
[0273] In a third translation step 137, the modified textual intermediate representation 227 is subsequently translated into a correspondingly modified graphical diagram 231. Alternatively or additionally, the textual modifications of the textual intermediate representation 213 effected by the textual input commands can be translated into graphical modifications of the graphical diagram 211. The textual modifications comprise at least one textual program object 225 newly added to the textual intermediate representation 213 or deleted from the textual intermediate representation 213. The graphical modifications translated from the textual modifications accordingly comprise at least one graphical program object 217 newly added to the graphical diagram 211 or deleted from the graphical diagram 211.
[0274] In a third display step 139, the modified textual intermediate representation 227 of the modified graphical diagram 231 is displayed in the textual editor unit 203.
[0275] In a fourth display step 141, the modified graphical diagram 231 is displayed in the graphical editor unit 201 instead of the graphical diagram 211.
[0276] Alternatively or additionally, the graphical modifications are displayed in the graphical diagram 211. For this purpose, the graphical diagram 211 is modified in the graphical editor unit 210 according to the modifications by inserting at least one newly added graphical program object 217 of the graphical modifications into the existing graphical diagram 211. The newly added graphical program object 217 can be marked accordingly as a new graphical program object 217, for example, by color.
[0277] Accordingly, the graphical program object 217 deleted from the graphical diagram 211 according to the graphical modifications is marked accordingly, if necessary also in color.
[0278] Furthermore, in a summarizing step 153, the textual intermediate representation 213 of the graphical diagram 211 and at least one further intermediate representation of at least one further graphical diagram are combined into a textual overall intermediate representation. In the overall intermediate representation, a plurality of different textual intermediate representations 213 of a plurality of different graphical diagrams 211 are thus combined into a coherent code in textual form.
[0279] The textual behaviors of the multiple textual intermediate representations 213 are arranged at the corresponding behavioral positions in the overall textual intermediate representation.
[0280] Between the textual behaviors 237 of the various graphical diagrams, additional textual information is arranged in the overall intermediate textual representation. The additional information can include, for example, data types, variable types, or other information. The additional information arranged in the overall intermediate representation between the behaviors of the various graphical diagrams can be written in a basic language predefined by the IEC 61131-3 standard.
[0281] The basic language describes the form specified by the standard in which the additional information must be written.
[0282] The behavior of the various graphical diagrams, however, is written in a sublanguage with a syntax that corresponds to the syntax of the programming languages defined by the IEC 61131-3 standard: ladder diagram, function block diagram, or sequential function chart. The sublanguage represents the aforementioned graphical programming languages textually and is designed in a user-readable format.
[0283] In the overall textual intermediate representation, the base language represents the framework of the coherent code, while the sublanguages are textual representations of the graphical diagrams, and in particular of the behavior of the graphical diagrams 211 .
[0284] According to one embodiment, the textual intermediate representation 213, which represents only a graphical diagram 211, can also comprise a textual basic language predefined by the IEC 61131-3 standard, in which the additional information, including the basic conditions such as data types and / or variable types of the textual behavior 237 representing the graphical behavior 233, is provided. The corresponding textual behavior 237 is, as described above, written in a sublanguage corresponding to the programming languages ladder diagram, function block diagram, or sequential function chart.
[0285] In the embodiment shown, the control program 209 is generated in the generation step 111 based on the modified textual intermediate representation 227 or based on the overall textual intermediate representation and / or based on the modified graphical diagram 231 or the plurality of modified graphical diagrams 231.
[0286] In the embodiment shown, the case is described in which, by executing a textual programming operation by the user based on the textual intermediate representation 213, a modification of the textual intermediate representation 213 and, based thereon, a modification of the graphical diagram 211 is effected.
[0287] For this purpose, the user removes textual program objects 225 from the textual intermediate representation 213 in the form of textual input commands 223 or adds further textual program objects 247 to the textual intermediate representation 213. By modifying the textual intermediate representation 213 by the user by executing the textual programming process, a correspondingly modified graphical diagram 231 can be generated after translating the modified textual intermediate representation 227 generated by executing the modification. The user can thus advance the programming of the control program 209 based on the graphical programming language both by executing a graphical programming process and by executing a textual programming process. Furthermore, the generation step 111 in the embodiment shown includes a debugging step 155.In debugging step 155, a debugging process of the control program 209 is performed based on the textual intermediate representation 213 or the modified textual intermediate representation 227. Furthermore, the generation step 111 includes a binary code generation step 157. In the binary code generation step 157, a binary representation of the control program 209 is generated to generate the control program 209.
[0288] List of reference symbols
[0289] 100 procedures
[0290] 101 first translation step
[0291] 103 line translation step
[0292] 105 Storage step
[0293] 107 first display step
[0294] 109 second display step
[0295] 111 Generation step
[0296] 113 Receiving step
[0297] 115 textual display step
[0298] 117 Differential translation step
[0299] 119 graphic display step
[0300] 121 Labeling step
[0301] 123 Conflict checking step
[0302] 125 Conflict determination step
[0303] 127 graphical programming step
[0304] 129 reading steps
[0305] 131 second translation step
[0306] 133 textual programming step
[0307] 135 second generation step
[0308] 137 third translation step
[0309] 139 third display step
[0310] 141 fourth display step
[0311] 143 Behavioral assessment step
[0312] 145 Behavioral translation step
[0313] 147 Arrangement step
[0314] 149 Identity verification step
[0315] 151 Integration step
[0316] 153 Summary step
[0317] 155 Debugging step
[0318] 157 Binary code generation step
[0319] 159 Conflict translation step
[0320] 161 Conflict resolution step
[0321] 200 development environment
[0322] 201 graphical editor unit textual editor unit translation module version control system control program graphical diagram textual intermediate representation graphical input command graphical program object executable program object program file textual input command textual program object modified textual intermediate representation further graphical program object modified graphical diagram graphical behavior textual difference information textual behavior behavior position textual line identity
[0323] Representation file additional textual program object node object edge object first version of the textual intermediate representation second version of the textual intermediate representation first version of the graphical diagram second version of the graphical diagram added textual program object deleted textual program object added graphical program object deleted graphical program object textual conflict information graphical conflict information first node object second node object 277 third node object
[0324] 279 fourth node object
[0325] 281 fifth node object
[0326] 283 Edge object between first node object and second node object
[0327] 285 Edge object between first node object and third node object
[0328] 287 Edge object between third node object and fifth node object
[0329] 289 first graphical difference information
[0330] 291 second graphical difference information
[0331] 293 first textual program object
[0332] 295 second textual program object
[0333] 297 third textual program object
[0334] 299 fourth textual program object
[0335] 301 fifth textual program object
[0336] 303 sixth textual program object
[0337] 305 seventh textual program object
[0338] 307 eighth textual program object
[0339] ID1 Identity of the first textual program object
[0340] ID2 Identity of the second textual program object
[0341] ID3 identity of the third textual program object
[0342] ID4 Identity of the fourth textual program object
[0343] ID5 Identity of the fifth textual program object
[0344] ID6 Identity of the sixth textual program object
[0345] ID7 Identity of the seventh textual program object
[0346] ID8 Identity of the eighth textual program object
Claims
Claims 1. A computer-implemented method (100) for generating a control program (209) for an automation system, comprising: Translating a graphical diagram (211) of a graphical programming language into a textual intermediate representation (213) of the graphical diagram (211) by a translation module (205) of a development environment (200) in a first translation step (101), wherein the graphical diagram (211) graphically depicts at least part of a control program (209) for an automation system according to the graphical programming language, wherein the textual intermediate representation (213) provides a textual description of the graphical diagram (211), and wherein the first translation step (101) comprises: Carrying out a line-by-line translation in a line translation step (103), wherein in the line-by-line translation, graphical program objects (217) of the graphical diagram (211) are each assigned a textual program object (225) in the form of at least one textual line (241) of the textual intermediate representation (213), wherein the graphical program objects (217) are sub-elements of the graphical diagram (211) and represent program objects (219) of the control program (209), and wherein the textual lines (241) of the textual program objects (225) provide unique descriptions of the respective graphical program objects (217); and Storing the textual intermediate representation (213) in a representation file (245) in a storage step (105).
2. The method (100) of claim 1, further comprising: Displaying the graphical diagram (211) in a graphical editor unit (201) of the development environment (200) in a first display step (107); and / or Displaying the textual intermediate representation (213) of the graphical diagram (211) in a textual editor unit (203) of the development environment (200) in a second display step (109); and Generating the control program (209) based on the textual intermediate representation (213) of the graphical diagram (211) of the graphical programming language and / or based on the graphical diagram (211) in a generation step (111).
3. The method (100) of claim 1, further comprising: Receiving a textual difference information (235) from a version management system (207) by the development environment in a receiving step (113), wherein the textual difference information (235) describes a difference between a first version (253) of the textual intermediate representation (213) and a second version (255) of the textual intermediate representation (213), wherein the first version (253) and the second version (255) of the textual intermediate representation (213) are each representations of a first version (257) and a second version (259) of the graphical diagram (211), wherein the first and second versions (257, 259) of the graphical diagram (211) were created in a programming process based on one another or on a common base diagram, and wherein the textual difference information (235) defines at least one textual program object (225) that can only be used in one of the two versions (253,255) of the textual intermediate representation (213); and, Displaying the at least one textual program object (225) of the textual difference information (235) in the textual editor unit (203) of the development environment (200) in a textual display step (115); and / or translating the textual difference information (235) into graphical difference information by translating the at least one textual program object (225) into a corresponding graphical program object (217) in a difference translation step (117); and Displaying the at least one graphical program object (217) of the graphical difference information (235) in the graphical editor unit (201) of the development environment (200) in a graphical display step (119).
4. The method (100) according to claim 1, wherein the second version of the graphical diagram (200) has a later creation date than the first version of the graphical diagram (211), wherein in the corresponding second version (255) of the textual intermediate representation (213) at least one textual program object (225) is added or removed compared to the first version of the textual intermediate representation (213), and wherein in the textual difference information (235) the at least one textual program object (225) is identified as a compared to the first version (253) of the textual Intermediate representation (213) added textual program object (225) or deleted textual program object (225) is marked.
5. The method (100) according to claim 4, wherein the textual display step (115) and / or the graphical display step (119) comprise: Identifying the textual program object (225) of the textual difference information (235) and / or the graphical program object (217) of the graphical difference information (289, 291) as an added textual program object (261) or an added graphical program object (265) or as a deleted textual program object (263) or as a deleted graphical program object (267) in a marking step (121).
6. The method (100) according to any one of the preceding claims 3 to 5, wherein a textual program object changed from the first version (253) of the textual intermediate representation (213) to the second version (255) of the textual intermediate representation (213) is represented in the difference information (235) as a pair of a deleted textual program object (263) of the first version (253) of the textual intermediate representation (213) and an added textual program object (261) of the second version (255) of the textual intermediate representation (213), wherein the deleted textual program object (263) represents an original version of the changed textual program object and the added textual program object (261) represents a changed version of the changed textual program object.
7. The method (100) according to claim 6, wherein in the graphical diagram (211) the deleted graphical program object (267) corresponding to the deleted textual program object (263) and / or the added graphical program object (265) corresponding to the added textual program object (261) and / or a changed graphical program object corresponding to the changed textual program object are correspondingly marked as a deleted graphical program object (267) and / or as an added graphical program object (265) and / or as a changed graphical program object.
8. The method (100) according to any one of the preceding claims 3 to 7, further comprising: Receiving textual conflict information (269) from the version control system (207) and performing a conflict check between the first version (253) of the textual intermediate representation (213) and the second version (255) of the textual intermediate representation (213) in a conflict checking step (123), wherein the textual conflict information (269) comprises textual program objects (225) associated with the first version (253) of the textual intermediate representation (213) and textual program objects (225) associated with the second version (255) of the textual intermediate representation (213); and Determining a conflict in a conflict determination step (125) if at least one textual program object (225) associated with the first version (253) of the textual intermediate representation (213) and at least one textual program object (225) associated with the second version (255) of the textual intermediate representation (213) are determined, which have the same identity (243) and are changed relative to one another.
9. The method (100) of claim 8, wherein the conflict detection step (125) comprises: translating the textual conflict information (269) into graphical conflict information (271) by the translation module (205) in a conflict translation step (159), wherein the graphical conflict information (269) comprises graphical program objects (217) corresponding to the textual program objects (225) of the textual conflict information (269); and Resolving the conflict by deleting the at least one graphical program object (217) corresponding to a textual program object (225) associated with the first version (253) of the textual intermediate representation (213) and having the same identity (243) as another graphical program object (217) corresponding to a textual program object (225) associated with the second version (255) of the textual intermediate representation (213) in a conflict resolution step (161).
10. The method (100) according to any one of the preceding claims, further comprising: receiving graphical input commands (215) of a user of the development environment (200) by a graphical editor unit (201) of the development environment (200) in a graphical programming step (127), wherein the graphical input commands (215) comprise programming commands for adding and / or removing graphical program objects (217) of the graphical diagram (211); and / or Reading in a program file (221) in a reading step (129), wherein the graphical diagram (211) and the graphical program objects (217) of the graphical diagram (211) are described in a textual description in the program file (221); Translating the textual description into the graphical diagram (211) by the translation module (205) in a second translation step (131).
11. The method (100) according to any one of the preceding claims, further comprising: receiving textual input commands (223) of the user by the textual editor unit (203) of the development environment (200) in a textual programming step (133), wherein the textual input commands (223) add or remove textual program objects (225) as textual representations of corresponding graphical program objects (217) of the graphical diagram (211) to or from the textual intermediate representation (213) of the graphical diagram (211); Generating a modified textual intermediate representation (227) based on the textual input commands (223) and the textual intermediate representation (213) of the graphical diagram (211) in a second generation step (135); translating the modified textual intermediate representation (227) into a correspondingly modified graphical diagram (231) and / or translating the textual program objects (225) of the textual input commands into corresponding graphical program objects (217) by the translation module (205) in a third translation step (137); Displaying the modified graphical diagram (231) instead of the graphical diagram (211) and / or displaying the graphical program objects (217) translated from the textual program objects (225) of the textual input commands in the graphical diagram (211) as a modified graphical diagram (231) in the graphical editor unit (201) in a third display step (139); Generating the control program (209) based on the modified textual intermediate representation (227) of the modified graphical diagram (231) and / or based on the modified graphical diagram (231) in the generating step (111); and Displaying the modified textual intermediate representation (227) of the modified graphical diagram (231) in the textual editor unit (203) in a fourth display step (141).
12. Method (100) according to one of the preceding claims, wherein the first translation step (101) further comprises: Determining the graphical program objects (217), a graphical behavior (233) of the graphical diagram (211) and at least one behavior position (239) in a behavior determination step (143), wherein the graphical behavior (233) describes a graphical representation of a program flow of the control program (209), and wherein the behavior position (239) defines a position in a program code predefined by a standard IEC 61131-3 at which a behavior of a control program is to be positioned; Translating the graphical program objects (217) and the graphical behavior (233) of the graphical diagram (211) into textual program objects (225) and a textual behavior (237) of the textual intermediate representation (213) in a behavior translation step (145), wherein the textual behavior (237) represents a textual intermediate representation (213) of the flow of the control program (209); and Arranging the textual behavior at the behavior position (239) within the textual intermediate representation (213) in an arranging step (147).
13. Method (100) according to one of the preceding claims, wherein the first translation step (101) further comprises: Determining identities (243) of the graphical program objects (217) of the graphical diagram (211) in an identity determination step (149), wherein the identities (243) of the graphical program objects (217) enable a unique identification of the respective graphical program objects (217); and integrating the identities (243) of the graphical program objects (217) into the respective textual program objects (225) of the textual intermediate representation (213) assigned to the graphical program objects (217) and written in textual lines (241) in an integration step (151).
14. The method (100) according to claim 13, wherein for interconnected graphical program objects (217) the identities (243) of the interconnected graphical program objects (217) are integrated into the corresponding textual program objects (225).
15. Method (100) according to one of the preceding claims, wherein the graphical program objects (217) comprise graphically displayable meta-information, and wherein the meta information comprises at least one of the following list: Author, creation date, version (257, 259) of the graphical diagram (211).
16. The method (100) according to any one of the preceding claims, further comprising: combining the textual intermediate representation (213) of the graphical diagram (211) with at least one further intermediate representation of at least one further graphical diagram to form a textual overall intermediate representation in a combining step (153), wherein in the overall intermediate representation a plurality of different textual intermediate representations (213) of a plurality of different graphical diagrams (211) are combined to form a coherent code in textual form.
17. The method (100) according to any one of the preceding claims, wherein the generating step (111) comprises: Performing a debugging process based on the textual intermediate representation (213) of the graphical diagram (211) in a debugging step (155); and / or generating a binary representation of the control program (209) in a binary code generation step (157).
18. The method (100) according to any one of the preceding claims, wherein the graphical programming language is one of the following group: ladder diagram, function block diagram, sequential function chart.
19. The method (100) according to any one of the preceding claims, wherein a syntax of the textual intermediate representation (213) and the modified textual intermediate representation (213) is free of conflict with a syntax of the graphical programming language.
20. Development environment (200) with a graphical editor unit (201), a textual editor unit (203) and a translation module (205), wherein the development environment (200) is configured to carry out the method (100) according to one of the preceding claims 1 to 19.