CN109765838B - Method and device for generating configuration file of programmable logic controller - Google Patents

Method and device for generating configuration file of programmable logic controller Download PDF

Info

Publication number
CN109765838B
CN109765838B CN201910160817.8A CN201910160817A CN109765838B CN 109765838 B CN109765838 B CN 109765838B CN 201910160817 A CN201910160817 A CN 201910160817A CN 109765838 B CN109765838 B CN 109765838B
Authority
CN
China
Prior art keywords
file
configuration file
generator
programmable logic
logic controller
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910160817.8A
Other languages
Chinese (zh)
Other versions
CN109765838A (en
Inventor
邬惠峰
严义
陈佰平
孙洁香
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Dianzi University
Original Assignee
Hangzhou Dianzi University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Dianzi University filed Critical Hangzhou Dianzi University
Priority to CN201910160817.8A priority Critical patent/CN109765838B/en
Publication of CN109765838A publication Critical patent/CN109765838A/en
Application granted granted Critical
Publication of CN109765838B publication Critical patent/CN109765838B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention provides a method and a device for generating a configuration file of a programmable logic controller, wherein the method comprises the following steps: acquiring a programmable logic controller program file input by a user; normalizing the programmable logic controller program file to generate a first configuration file of the programmable logic controller program file, wherein the first configuration file comprises a preset configuration file structure; and taking the first configuration file as the input of the generator, and acquiring a second configuration file of the programmable logic controller program file output by the generator, wherein the generator is preset with a first file description specification, and the second configuration file conforms to the first file description specification. The method for generating the configuration file of the programmable logic controller reduces the program development difficulty of developers.

Description

Method and device for generating configuration file of programmable logic controller
Technical Field
The invention relates to the field of industrial control, in particular to a method and a device for generating a configuration file of a programmable logic controller.
Background
Programmable Logic Controller (PLC) platform software produced by different manufacturers supports IEC61131-3 language standard, but does not adopt the same program description standard. That is, the same development language is used, but the format of the program when saved is different. When a user replaces different types of PLCs, the original PLC program cannot be identified by the new PLC platform and needs to be re-developed in the new PLC platform, thereby causing an obstacle to the user to select the new PLC.
In the prior art, in order to solve the above problem, after a program description standard of a PLC based on an Extensible Markup Language (XML) is given, a PLC platform stores a PLC program as an XML file according to the program description standard, and then checks the XML file through a standard XML Schema Definition (XSD) file, thereby determining that the XML file is applicable to all PLC platforms.
However, in the conventional method for generating the PLC configuration file, developers need to fully understand and master the XML interactive standard, and format the generated XML file according to the standard, which makes program development of the developers difficult due to the complex XML interactive standard.
Disclosure of Invention
The invention provides a method and a device for generating a configuration file of a programmable logic controller, which are used for reducing the program development difficulty of developers.
The first aspect of the present invention provides a method for generating a configuration file of a programmable logic controller, including:
acquiring a programmable logic controller program file input by a user;
normalizing the programmable logic controller program file to generate a first configuration file of the programmable logic controller program file, wherein the first configuration file comprises a preset configuration file structure;
and taking the first configuration file as the input of a generator, and acquiring a second configuration file of the programmable logic controller program file output by the generator, wherein a first file description specification is preset in the generator, and the second configuration file conforms to the first file description specification.
Optionally, before the obtaining the program file of the programmable logic controller input by the user, the method further includes:
acquiring a first mode file input by a user, wherein the first mode file comprises the first file description specification;
taking the first schema file as a parameter of the generator so that the output of the generator conforms to the first file description specification.
Optionally, before the obtaining the second configuration file of the program file of the programmable logic controller output by the generator by using the first configuration file as the input of the generator, the method further includes:
acquiring a second mode file input by a user, wherein the second mode file comprises a second file description specification;
using the second schema file as parameters of the generator to replace the parameters provided by the first schema file and to conform the output of the generator to the second file description specification.
Optionally, the generator includes: a class file generation layer, an instance object creation layer, an element assignment layer and a serialization layer;
the class file generation layer is used for converting the mode file into the class file by using a mode tool;
the instance object creating layer is used for generating an instance object containing corresponding elements according to the elements in the class file;
the element assignment layer is used for assigning the elements in the instance object according to the first configuration file;
the serialization layer is used for serializing the instance object and generating the second configuration file.
Optionally, before the normalizing the program file of the programmable logic controller to generate the first configuration file of the program file of the programmable logic controller, the method further includes:
and checking the description language of the first configuration file.
A second aspect of the present invention provides an apparatus for generating a configuration file of a programmable logic controller, including:
the first acquisition module is used for acquiring a programmable logic controller program file input by a user;
the normalization module is used for performing normalization processing on the programmable logic controller program file to generate a first configuration file of the programmable logic controller program file, wherein the first configuration file comprises a preset configuration file structure;
and the generator module is used for taking the first configuration file as the input of the generator and acquiring a second configuration file of the programmable logic controller program file output by the generator, wherein a first file description specification is preset in the generator, and the second configuration file conforms to the first file description specification.
Optionally, the method further includes:
the second acquisition module is used for acquiring a first mode file input by a user, and the first mode file comprises the first file description specification;
a first input module, configured to use the first schema file as a parameter of the generator, so that an output of the generator conforms to the first file description specification.
Optionally, the method further includes:
the third acquisition module is used for acquiring a second mode file input by a user, and the second mode file comprises a second file description specification;
and the second input module is used for taking the second mode file as the parameter of the generator so as to replace the parameter provided by the first mode file and enable the output of the generator to conform to the second file description specification.
Optionally, the generator includes: a class file generation layer, an instance object creation layer, an element assignment layer and a serialization layer;
the class file generation layer is used for converting the mode file into the class file by using a mode tool;
the instance object creating layer is used for generating an instance object containing corresponding elements according to the elements in the class file;
the element assignment layer is used for assigning the elements in the instance object according to the first configuration file;
the serialization layer is used for serializing the instance object and generating the second configuration file.
Optionally, the method further includes:
and the verification module is used for verifying the description language of the first configuration file.
A third aspect of the present invention provides an electronic apparatus comprising: a memory and a processor;
the memory for storing executable instructions of the processor;
the processor is configured to perform the method referred to in the first aspect and alternatives thereof via execution of the executable instructions.
In a fourth aspect of the present invention, there is provided a storage medium having stored thereon a computer program which, when executed by a processor, implements the method of the first aspect and its alternatives.
According to the method and the device for generating the configuration file of the programmable logic controller, the programmable logic controller program file input by a user is obtained and is subjected to normalization processing to generate the first configuration file containing the preset configuration file structure, then the first configuration file is used as the input of the generator to enable the generator to output the second configuration file meeting the first file description specification, so that developers can develop PLC programs without mastering standardized file description specifications, the developed programs can generate the configuration file meeting the standardized file description specifications through the normalization and standard generator, and the program development difficulty of the developers is reduced.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic flowchart of a method for generating a configuration file of a programmable logic controller according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of another method for generating a configuration file of a programmable logic controller according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of a method for generating a configuration file of a programmable logic controller according to another embodiment of the present invention;
fig. 4 is a schematic flowchart of a method for generating a configuration file of a programmable logic controller according to another embodiment of the present invention;
fig. 5 is a schematic structural diagram of a device for generating a configuration file of a programmable logic controller according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of another apparatus for generating a configuration file of a programmable logic controller according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a device for generating a configuration file of a programmable logic controller according to another embodiment of the present invention;
fig. 8 is a schematic structural diagram of a device for generating a configuration file of a programmable logic controller according to another embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "first," "second," and the like in the description of the invention and the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein.
It should be understood that, in various embodiments of the present invention, the sequence numbers of the processes do not mean the execution sequence, and the execution sequence of the processes should be determined by the functions and the internal logic of the processes, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
It should be understood that in the present application, "comprising" and "having" and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be understood that in the present invention, "B corresponding to a", "a corresponds to B", or "B corresponds to a" means that B is associated with a, from which B can be determined. Determining B from a does not mean determining B from a alone, but may be determined from a and/or other information.
As used herein, "if" may be interpreted as "at … …" or "when … …" or "in response to a determination" or "in response to a detection", depending on the context.
The technical solution of the present invention will be described in detail below with specific examples. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments.
First, an application scenario of the present invention is described:
when developers develop standardized configuration files capable of running on each PLC platform, PLC program development can be carried out by utilizing PLC language standards, and only the generation device of the configuration files of the programmable logic controller needs to be input after the program development is finished. Then, the generating device of the configuration file of the programmable logic controller firstly carries out normalization processing on the input PLC program to generate a first configuration file containing a preset configuration file structure, and then inputs the first configuration file into the generator to enable the standardized generator to output a second configuration file which meets the first file description specification preset by the standardized generator. The execution subject related in the embodiment of the present invention is the generation apparatus of the configuration file of the programmable logic controller.
Fig. 1 is a schematic flowchart of a method for generating a configuration file of a programmable logic controller according to an embodiment of the present invention.
Referring to fig. 1, the method for generating the configuration file of the plc includes steps S11-S13, which are as follows:
s11: and acquiring a programmable logic controller program file input by a user.
The programmable logic controller program file can be a program file which is programmed and designed by a developer through a PLC programming language according to the control requirement of a control system.
The PLC programming language may specifically include a ladder diagram Language (LD), an instruction list language (IL), a function block diagram language (FBD), a sequential function flow diagram language (SFC), a structured text language (ST), and the like.
In practical application, a developer can develop a PLC program file on any PLC software platform, and in the development process, the PLC program file only needs to support IEC61131-3 language standard (the language standard of a programming system formulated by International electrotechnical Commission), and only needs to be sent to a generating device of a configuration file of a programmable logic controller after the development is completed, and the program file does not need to be stored as an XML file according to the standard like the prior art, so that the development difficulty of the developer is reduced.
S12: and carrying out normalization processing on the programmable logic controller program file to generate a first configuration file of the programmable logic controller program file, wherein the first configuration file comprises a preset configuration file structure.
The configuration file may be an XML file.
The first configuration file may specifically be an XML file having a unified XML structure.
The normalization process may be to convert a dimensional expression into a dimensionless expression, i.e., into a scalar quantity.
In practical application, after acquiring the PLC program files of different platforms, the device for generating the configuration file of the programmable logic controller performs normalization processing on the PLC program files, and generates a first configuration file, so that the first configuration file conforms to a preset configuration file structure, where the preset configuration file structure may be a unified XML structure. The unified XML structure specifies the structure of a non-standard XML file. Compared with standard files, the structure is more in line with the habits of software developers, and is easy for the software developers to convert. Meanwhile, the unified XML structure contains the ADDdata node, so that software developers can define undefined contents in the standard class conveniently.
S13: and taking the first configuration file as the input of the generator, and acquiring a second configuration file of the programmable logic controller program file output by the generator, wherein the generator is preset with a first file description specification, and the second configuration file conforms to the first file description specification.
A generator, comprising: a class file generation layer, an instance object creation layer, an element assignment layer and a serialization layer;
the class file generation layer is used for converting the mode file into the class file by using a mode tool;
the instance object creating layer is used for generating an instance object containing corresponding elements according to the elements in the class file;
the element assignment layer is used for assigning the elements in the instance object according to the first configuration file;
the serialization layer is used for serializing the instance object and generating the second configuration file.
According to the actual situation, for example, the schema file may be an XSD file, and if the XSD file includes FileHeader, ContentHeader, Types, Instances, AddData, and Documentation elements, the class file generation layer of the generator may generate a class file generation layer including FileHeader field, ContentHeader field, typefield, Instances field, and other elements. Then, an instance object creating layer of the generator creates an instance object of the class file, and an element assignment layer assigns values to elements in the instance object according to the first configuration file. Specifically, if the first configuration file is defined by a Function Block, the instance object includes a project types element, and a corresponding item entry of the Function Block type may be generated according to each Function _ Block type child node. And then, grouping the generated Items item group into the ProjectTypes element, and further completing the creation and assignment of the instance object. And finally, serializing the instance object into an XML file through an XmlSerializer to generate a second configuration file.
According to the method for generating the configuration file of the programmable logic controller, the programmable logic controller program file input by the user is obtained and normalized to generate the first configuration file containing the preset configuration file structure, and then the first configuration file is used as the input of the generator to enable the generator to output the second configuration file meeting the first file description specification, so that developers can develop the PLC program without mastering the standardized file description specification, the developed program can generate the configuration file meeting the standardized file description specification through the normalization and the standard generator, and the difficulty in program development of the developers is reduced.
Fig. 2 is a schematic flowchart of another method for generating a configuration file of a programmable logic controller according to an embodiment of the present invention.
Referring to fig. 2, the method for generating the configuration file of the plc includes steps S21-S25, which are as follows:
s21: the method comprises the steps of obtaining a first mode file input by a user, wherein the first mode file comprises a first file description specification.
S22: the first schema file is used as a parameter for the generator to conform the output of the generator to the first file description specification.
The first schema file may be a schema file that conforms to the configuration file description specification and is input by a user in advance.
In practical application, before the device for generating the configuration file of the programmable logic controller acquires the PLC program file, a first mode file input by a user needs to be acquired in advance, so that the generator generates a corresponding class file according to a first file description specification in the first mode file.
S23: and acquiring a programmable logic controller program file input by a user.
S24: and carrying out normalization processing on the programmable logic controller program file to generate a first configuration file of the programmable logic controller program file, wherein the first configuration file comprises a preset configuration file structure.
S25: and taking the first configuration file as the input of the generator, and acquiring a second configuration file of the programmable logic controller program file output by the generator, wherein the generator is preset with a first file description specification, and the second configuration file conforms to the first file description specification.
The technical terms, technical effects, technical features, and alternative embodiments of steps S23 through S25 can be understood with reference to steps S11 through S13 shown in fig. 1, and repeated contents will not be described herein.
According to the method for generating the configuration file of the programmable logic controller, the first mode file is input into the generator in advance, the generator generates the instance object containing the corresponding element according to the element in the mode file, and then the generator outputs the second configuration file conforming to the first file description specification according to the input first configuration file, so that a developer can develop a PLC program without mastering a standardized file description specification, the developed program generates the configuration file conforming to the standardized file description specification through the normalization and the generator, and the difficulty in program development of the developer is reduced.
Fig. 3 is a schematic flowchart of a method for generating a configuration file of a programmable logic controller according to another embodiment of the present invention.
Referring to fig. 3, the method for generating the configuration file of the plc includes steps S31-S37, which are as follows:
s31: the method comprises the steps of obtaining a first mode file input by a user, wherein the first mode file comprises a first file description specification.
S32: the first schema file is used as a parameter for the generator to conform the output of the generator to the first file description specification.
S33: and acquiring a programmable logic controller program file input by a user.
S34: and carrying out normalization processing on the programmable logic controller program file to generate a first configuration file of the programmable logic controller program file, wherein the first configuration file comprises a preset configuration file structure.
The technical terms, technical effects, technical features and optional embodiments of steps S31 to S34 can be understood by referring to steps S21 to S24 shown in fig. 2, and repeated contents will not be described herein.
S35: and acquiring a second mode file input by the user, wherein the second mode file comprises a second file description specification.
S36: using the second schema file as parameters of the generator to replace the parameters provided by the first schema file and to conform the output of the generator to the second file description specification.
In practical application, if the file description specification of the configuration file is updated, the second configuration file generated after the file description specification is updated is only required to be used as a parameter of the generator, so that the standard generator can generate a new class file according to the second configuration file description specification to replace the original class file. The second configuration file generated by the standardized generator may then conform to the updated file description specification.
S37: and taking the first configuration file as the input of the generator, and acquiring a second configuration file of the programmable logic controller program file output by the generator, wherein the generator is preset with a first file description specification, and the second configuration file conforms to the first file description specification.
The technical terms, technical effects, technical features, and alternative embodiments of step S37 can be understood with reference to step S13 shown in fig. 1, and repeated contents will not be described herein.
According to the method for generating the configuration file of the programmable logic controller, after the description specification of the configuration file is updated, only a new mode file needs to be submitted to the generator, so that the generator creates a new class file, the configuration file is further updated along with the change of the description specification of the configuration file, meanwhile, a developer does not need to update a device for generating the configuration file of the programmable logic controller, and the updating process of the description specification of the configuration file is simplified.
Fig. 4 is a schematic flowchart of a method for generating a configuration file of a programmable logic controller according to another embodiment of the present invention.
Referring to fig. 4, the method for generating the configuration file of the plc includes steps S41-S44, which are as follows:
s41: and acquiring a programmable logic controller program file input by a user.
S42: and carrying out normalization processing on the programmable logic controller program file to generate a first configuration file of the programmable logic controller program file, wherein the first configuration file comprises a preset configuration file structure.
The technical terms, technical effects, technical features, and alternative embodiments of steps S41 through S42 can be understood with reference to steps S11 through S12 shown in fig. 1, and repeated contents will not be described herein.
S43: and checking the description language of the first configuration file.
In practical application, before the first configuration file is input into the generator, the programming language of the first configuration file needs to be verified, and the first configuration file is determined to meet the IEC61131-3 language standard.
S44: and taking the first configuration file as the input of the generator, and acquiring a second configuration file of the programmable logic controller program file output by the generator, wherein the generator is preset with a first file description specification, and the second configuration file conforms to the first file description specification.
The technical terms, technical effects, technical features, and alternative embodiments of step S44 can be understood with reference to step S13 shown in fig. 1, and repeated contents will not be described herein.
In the method for generating the configuration file of the programmable logic controller provided in this embodiment, before the first configuration file is input into the generator, the language standard of the first configuration file is also checked, so that it is guaranteed that the first configuration file meets the language standard, and it is guaranteed that the configuration file output by the generator meets the standard language standard.
Fig. 5 is a schematic structural diagram of a device for generating a configuration file of a programmable logic controller according to an embodiment of the present invention.
Referring to fig. 5, the apparatus for generating a configuration file of a programmable logic controller includes:
a first obtaining module 51, configured to obtain a programmable logic controller program file input by a user;
the normalization module 52 is configured to perform normalization processing on the program file of the programmable logic controller, and generate a first configuration file of the program file of the programmable logic controller, where the first configuration file includes a preset configuration file structure;
a generator module 53, configured to take the first configuration file as an input of the generator, and obtain a second configuration file of the program file of the programmable logic controller output by the generator, where the generator is preset with a first file description specification, and the second configuration file conforms to the first file description specification
The generator, comprising: a class file generation layer, an instance object creation layer, an element assignment layer and a serialization layer;
the class file generation layer is used for converting the mode file into the class file by using a mode tool;
the instance object creating layer is used for generating an instance object containing corresponding elements according to the elements in the class file;
the element assignment layer is used for assigning the elements in the instance object according to the first configuration file;
the serialization layer is used for serializing the instance object and generating the second configuration file.
According to the method for generating the configuration file of the programmable logic controller, the programmable logic controller program file input by the user is obtained and normalized to generate the first configuration file containing the preset configuration file structure, and then the first configuration file is used as the input of the generator to enable the generator to output the second configuration file meeting the first file description specification, so that developers can develop the PLC program without mastering the standardized file description specification, the developed program can generate the configuration file meeting the standardized file description specification through the normalization and the standard generator, and the difficulty in program development of the developers is reduced.
Fig. 6 is a schematic structural diagram of another apparatus for generating a configuration file of a programmable logic controller according to an embodiment of the present invention.
Referring to fig. 6, an apparatus for generating a configuration file of a plc includes:
a second obtaining module 61, configured to obtain a first mode file input by a user, where the first mode file includes a first file description specification;
a first input module 62, configured to take the first schema file as a parameter of the generator, so that the output of the generator conforms to the first file description specification;
a first obtaining module 63, configured to obtain a programmable logic controller program file input by a user;
the normalization module 64 is configured to perform normalization processing on the program file of the programmable logic controller to generate a first configuration file of the program file of the programmable logic controller, where the first configuration file includes a preset configuration file structure;
the generator module 65 is configured to use the first configuration file as an input of the generator, and obtain a second configuration file of the program file of the programmable logic controller output by the generator, where the first file description specification is preset in the generator, and the second configuration file conforms to the first file description specification.
According to the method for generating the configuration file of the programmable logic controller, the first mode file is input into the generator in advance, the generator generates the instance object containing the corresponding element according to the element in the mode file, and then the generator outputs the second configuration file conforming to the first file description specification according to the input first configuration file, so that a developer can develop a PLC program without mastering a standardized file description specification, the developed program generates the configuration file conforming to the standardized file description specification through the normalization and the generator, and the difficulty in program development of the developer is reduced.
Fig. 7 is a schematic structural diagram of a device for generating a configuration file of a programmable logic controller according to another embodiment of the present invention.
Referring to fig. 7, the apparatus for generating a configuration file of a programmable logic controller includes:
a second obtaining module 71, configured to obtain a first schema file input by a user, where the first schema file includes a first file description specification;
a first input module 72 for using the first schema file as a parameter of the generator to conform the output of the generator to the first file description specification.
A first obtaining module 73, configured to obtain a programmable logic controller program file input by a user;
the normalization module 74 is configured to perform normalization processing on the program file of the programmable logic controller, and generate a first configuration file of the program file of the programmable logic controller, where the first configuration file includes a preset configuration file structure;
a third obtaining module 75, configured to obtain a second mode file input by the user, where the second mode file includes a second file description specification;
a second input module 76 for using the second schema file as parameters of the generator to replace the parameters provided by the first schema file and to conform the output of the generator to the second file description specification.
The generator module 77 is configured to use the first configuration file as an input of the generator, and obtain a second configuration file of the program file of the programmable logic controller output by the generator, where the generator is preset with a first file description specification, and the second configuration file conforms to the first file description specification.
According to the method for generating the configuration file of the programmable logic controller, after the description specification of the configuration file is updated, only a new mode file needs to be submitted to the generator, so that the generator can create a new embodiment, the configuration file can be updated along with the change of the description specification of the configuration file, meanwhile, a developer does not need to update a device for generating the configuration file of the programmable logic controller, and the updating process of the description specification of the configuration file is simplified. Referring to fig. 8, the apparatus for generating a configuration file of a programmable logic controller includes:
a first obtaining module 81, configured to obtain a programmable logic controller program file input by a user;
the normalization module 82 is configured to perform normalization processing on the program file of the programmable logic controller to generate a first configuration file of the program file of the programmable logic controller, where the first configuration file includes a preset configuration file structure;
and the checking module 83 is configured to check the description language of the first configuration file.
The generator module 84 is configured to use the first configuration file as an input of the generator, and obtain a second configuration file of the program file of the programmable logic controller output by the generator, where the first file description specification is preset in the generator, and the second configuration file conforms to the first file description specification.
In the method for generating the configuration file of the programmable logic controller provided in this embodiment, before the first configuration file is input into the generator, the language standard of the first configuration file is also checked, so that it is guaranteed that the first configuration file meets the language standard, and it is guaranteed that the configuration file output by the generator meets the standard language standard.
The present invention also provides an electronic device, comprising: a memory and a processor;
a memory for storing executable instructions of the processor;
the processor is configured to execute the method for generating the plc configuration file according to fig. 1-4 by executing the executable instructions.
The readable storage medium may be a computer storage medium or a communication medium. Communication media includes any medium that facilitates transfer of a computer program from one place to another. Computer storage media may be any media that can be accessed by a general purpose or special purpose computer. For example, a readable storage medium is coupled to the processor such that the processor can read information from, and write information to, the readable storage medium. Of course, the readable storage medium may also be an integral part of the processor. The processor and the readable storage medium may reside in an Application Specific Integrated Circuits (ASIC). Additionally, the ASIC may reside in user equipment. Of course, the processor and the readable storage medium may also reside as discrete components in a communication device.
The present invention also provides a storage medium, on which a computer program is stored, which when executed by a processor implements the method for generating the configuration file of the programmable logic controller of fig. 1-4.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (6)

1. A method for generating a configuration file of a programmable logic controller is characterized by comprising the following steps:
acquiring a programmable logic controller program file input by a user;
normalizing the programmable logic controller program file to generate a first configuration file of the programmable logic controller program file, wherein the first configuration file comprises a preset configuration file structure;
taking the first configuration file as the input of a generator, and acquiring a second configuration file of the programmable logic controller program file output by the generator, wherein a first file description specification is preset in the generator, and the second configuration file conforms to the first file description specification;
before the obtaining of the program file of the programmable logic controller input by the user, the method further comprises:
acquiring a first mode file input by a user, wherein the first mode file comprises the first file description specification;
using the first schema file as a parameter of the generator to conform the output of the generator to the first file description specification;
before the obtaining the second configuration file of the programmable logic controller program file output by the generator with the first configuration file as the input of the generator, the method further includes:
acquiring a second mode file input by a user, wherein the second mode file comprises a second file description specification;
using the second schema file as parameters of the generator to replace the parameters provided by the first schema file and to conform the output of the generator to the second file description specification.
2. The method of claim 1, wherein the generator comprises: a class file generation layer, an instance object creation layer, an element assignment layer and a serialization layer;
the class file generation layer is used for converting the mode file into the class file by using a mode tool;
the instance object creating layer is used for generating an instance object containing corresponding elements according to the elements in the class file;
the element assignment layer is used for assigning the elements in the instance object according to the first configuration file;
the serialization layer is used for serializing the instance object and generating the second configuration file.
3. The method of claim 1, further comprising, before the normalizing the plc program file to generate the first configuration file of the plc program file:
and checking the description language of the first configuration file.
4. An apparatus for generating a configuration file of a programmable logic controller, comprising:
the first acquisition module is used for acquiring a programmable logic controller program file input by a user;
the normalization module is used for performing normalization processing on the programmable logic controller program file to generate a first configuration file of the programmable logic controller program file, wherein the first configuration file comprises a preset configuration file structure;
a generator module, configured to take the first configuration file as an input of a generator, and obtain a second configuration file of the program file of the programmable logic controller, where the generator is preset with a first file description specification, and the second configuration file conforms to the first file description specification;
the second acquisition module is used for acquiring a first mode file input by a user, and the first mode file comprises the first file description specification;
a first input module for taking the first schema file as a parameter of the generator so that the output of the generator conforms to the first file description specification;
the third acquisition module is used for acquiring a second mode file input by a user, and the second mode file comprises a second file description specification;
and the second input module is used for taking the second mode file as the parameter of the generator so as to replace the parameter provided by the first mode file and enable the output of the generator to conform to the second file description specification.
5. The apparatus of claim 4, wherein the generator comprises: a class file generation layer, an instance object creation layer, an element assignment layer and a serialization layer;
the class file generation layer is used for converting the mode file into the class file by using a mode tool;
the instance object creating layer is used for generating an instance object containing corresponding elements according to the elements in the class file;
the element assignment layer is used for assigning the elements in the instance object according to the first configuration file;
the serialization layer is used for serializing the instance object and generating the second configuration file.
6. The apparatus of claim 4, further comprising:
and the verification module is used for verifying the description language of the first configuration file.
CN201910160817.8A 2019-03-04 2019-03-04 Method and device for generating configuration file of programmable logic controller Active CN109765838B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910160817.8A CN109765838B (en) 2019-03-04 2019-03-04 Method and device for generating configuration file of programmable logic controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910160817.8A CN109765838B (en) 2019-03-04 2019-03-04 Method and device for generating configuration file of programmable logic controller

Publications (2)

Publication Number Publication Date
CN109765838A CN109765838A (en) 2019-05-17
CN109765838B true CN109765838B (en) 2020-12-15

Family

ID=66456560

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910160817.8A Active CN109765838B (en) 2019-03-04 2019-03-04 Method and device for generating configuration file of programmable logic controller

Country Status (1)

Country Link
CN (1) CN109765838B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111475159B (en) * 2020-03-20 2023-03-14 吉利汽车研究院(宁波)有限公司 Method, device and storage medium for automatically generating program

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1744114A (en) * 2005-08-23 2006-03-08 杨波 Electronic file transmission method
KR101440707B1 (en) * 2010-02-12 2014-09-17 미쓰비시덴키 가부시키가이샤 Programmable controller
CN103226551B (en) * 2012-01-31 2016-05-25 中国科学技术大学 The matching process of the non deterministic finite automaton based on TCAM and device
CN203732935U (en) * 2013-12-17 2014-07-23 西门子公司 Connecting unit for connecting programmable logic controller to servo driver and same servo driver
CN104657141B (en) * 2015-02-12 2017-09-26 金光 A kind of gui software wrapper and its implementation based on computer vision

Also Published As

Publication number Publication date
CN109765838A (en) 2019-05-17

Similar Documents

Publication Publication Date Title
KR101314949B1 (en) Integration environment generator
CN111399853B (en) Templated deployment method for machine learning model and custom operator
CN104932480A (en) Automobile diagnostic system design method and apparatus
CN101617294A (en) The improvement of component-based development
CN109144511B (en) Method and system for automatically generating numerical simulation graphical user interface
CN112463135A (en) Code generation method, code generator, electronic device, and storage medium
US20070150249A1 (en) Verification Operation Supporting System and Method of the Same
CN109765838B (en) Method and device for generating configuration file of programmable logic controller
Barlas et al. KE tool: an open source software for automated input data in discrete event simulation projects
CN117677930A (en) Device deployment method, system and storage medium of AI model
Wenger et al. Transformation of IEC 61131-3 to IEC 61499 based on a model driven development approach
Jamro et al. Agile and hierarchical round-trip engineering of IEC 61131-3 control software
Julius et al. A meta-model based environment for GRAFCET specifications
CN111240681A (en) Method and device for converting different programming languages
JP6794668B2 (en) Programming device
CN114185557A (en) Software product deployment method, device, medium and electronic equipment
CN110321138B (en) Program updating and migration method and device
Julius et al. A model-driven approach for transforming GRAFCET specification into PLC code including hierarchical structures
CN109213475B (en) Artificial intelligence writing method for satellite multi-loop comparison instruction unit remote control source program
Kern et al. A mapping-based framework for the integration of machine data and information systems
CN111475159A (en) Method, device and storage medium for automatically generating program
CN117270956B (en) Configuration method of hardware equipment, client, hardware equipment network management system and medium
EP4261678A1 (en) Generation of a technical instruction
CN117111935A (en) Industrial software low-code platform and metadata architecture thereof
KR20110077288A (en) System for providing programable logic controller software development environment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant