Programmable logic controller program generation method, device, equipment and medium
By establishing a standard program library and generating a bill of materials for equipment, and automatically generating PLC target programs using a preset platform, the problem of low efficiency in traditional PLC programming methods is solved, and the standardization and efficient generation of PLC programming are achieved.
Patent Information
- Application Number
- CN202511821050.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-04
- Publication Date
- 2026-01-20
AI Technical Summary
Traditional PLC programming methods are inefficient and lack standardization, resulting in low efficiency for programmers when designing target programs.
By defining the control functions of the target factory, a standard program library is established, and an equipment bill of materials is generated based on programming standards. The PLC target program is then automatically generated using a preset platform.
It improves the standardization and generation efficiency of PLC target programs, shortens the programming cycle, and enhances the automation of programming.
Smart Images

Figure CN121364680A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of program code generation, and in particular to a programmable logic controller program generation method and device, electronic equipment, storage medium and program product. BACKGROUND
[0002] With the rapid development of industrial automation, programmable logic controllers (PLCs) play an increasingly important role in various production processes. However, in traditional PLC programming methods, programmers need to use programming software to design target programs according to their own logical thinking and methods while meeting control requirements, which has problems such as low efficiency and insufficient standardization. SUMMARY
[0003] The present application provides a programmable logic controller program generation method and device, electronic equipment, storage medium and program product, which can improve the standardization and generation efficiency of target programs.
[0004] According to an aspect of the present application, a programmable logic controller program generation method is provided, which comprises:
[0005] determining a first control function of a target factory, and establishing a standard program library based on standard program blocks corresponding to the first control function; wherein the first control function comprises a plurality of control functions that can be implemented by the target factory;
[0006] generating a bill of materials table based on the programming standards of the programmable logic controller according to project control function requirements;
[0007] generating a target program for the programmable logic controller based on the standard program library and the bill of materials table through a preset platform.
[0008] According to another aspect of the present application, a programmable logic controller program generation device is provided, which comprises:
[0009] a standard library establishing module for determining a first control function of a target factory, and establishing a standard program library based on standard program blocks corresponding to the first control function; wherein the first control function comprises a plurality of control functions that can be implemented by the target factory;
[0010] a bill of materials table generating module for generating a bill of materials table based on the programming standards of the programmable logic controller according to project control function requirements;
[0011] a target program generating module for generating a target program for the programmable logic controller based on the standard program library and the bill of materials table through a preset platform.
[0012] According to another aspect of the present application, there is provided an electronic device comprising:
[0013] at least one processor; and
[0014] a memory communicatively connected to the at least one processor; wherein
[0015] the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to perform the programmable logic controller program generation method according to any one of the embodiments of the present application.
[0016] According to another aspect of the present application, there is provided a computer readable storage medium storing computer instructions for enabling a processor to implement the programmable logic controller program generation method according to any one of the embodiments of the present application when executed by the processor.
[0017] According to another aspect of the present application, there is provided a computer program product comprising a computer program for implementing the programmable logic controller program generation method according to any one of the embodiments of the present application when executed by a processor.
[0018] The technical solution of the embodiments of the present application determines a first control function of a target factory, establishes a standard program library based on a standard program block corresponding to the first control function, wherein the first control function comprises a plurality of control functions that can be implemented by the target factory; generates a bill of materials based on a programming standard of a programmable logic controller and according to a project control function requirement; and generates a target program for the programmable logic controller through a preset platform based on the standard program library and the bill of materials. The technical solution of the embodiments of the present application automatically generates a target program for a programmable logic controller through a preset platform based on a standard program library established based on a standard program block corresponding to a first control function of a target factory and a bill of materials determined based on a programming standard and a project control function requirement, which can improve the standardization degree and generation efficiency of the target program.
[0019] It should be understood that the content described in this section is not intended to identify key or important features of the embodiments of the present application, nor is it used to limit the scope of the present application. Other features of the present application will become apparent through the following description. BRIEF DESCRIPTION OF DRAWINGS
[0020] In order to make the technical solution in the embodiments of the present application clearer, the drawings needed in the embodiment description will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and all other drawings obtained by those skilled in the art without any creative effort should be within the protection scope of the present application.
[0021] Figure 1 It is a flow chart of a programmable logic controller program generation method according to the first embodiment of the present application;
[0022] Figure 2 It is a target program generation flow chart according to the first embodiment of the present application;
[0023] Figure 3 It is a visual display diagram of target program generation progress and generation time according to the first embodiment of the present application;
[0024] Figure 4 It is a flow chart of a programmable logic controller program generation method according to the second embodiment of the present application;
[0025] Figure 5 It is a target program generation flow chart according to the second embodiment of the present application;
[0026] Figure 6 It is a structure diagram of a programmable logic controller program generation device according to the third embodiment of the present application;
[0027] Figure 7 It is a structure diagram of an electronic device implementing the programmable logic controller program generation method according to the present application. DETAILED DESCRIPTION
[0028] In order to make the technical solution in the embodiments of the present application clearer, the drawings needed in the embodiment description will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and all other drawings obtained by those skilled in the art without any creative effort should be within the protection scope of the present application.
[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and in the above drawings are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not have to be limited to only those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0030] Embodiment one
[0031] Figure 1 A flowchart of a programmable logic controller program generation method is provided for the first embodiment of the present application. The present embodiment can be applicable to the automatic generation of a programmable logic controller program. The method can be executed by a programmable logic controller program generation device, which can be realized in the form of hardware and / or software, and can be configured in an electronic device. As shown in the figure, the method comprises: Figure 1
[0032] S110, determine the first control function of the target factory, and establish a standard program library based on the standard program block corresponding to the first control function; wherein the first control function includes a plurality of control functions that can be implemented by the target factory.
[0033] The first control function refers to a set of core and basic control functions in the automation control system of the target factory, including a plurality of control functions that can be implemented by the target factory, and covering a plurality of key control links in the production process of the factory. The standard program block is a reusable program code segment corresponding to a specific control function module, which has a universal interface and is standardized, so as to facilitate quick calling and combination in different projects.
[0034] In the embodiment of the present application, the production process, equipment characteristics and control requirements can be determined through function research, and the first control function of the target factory can be determined. Then, for each control function in the first control function, the standard program block corresponding to the control function is determined. Finally, a standard program library can be established according to the plurality of standard program blocks corresponding to the first control function, and an index and a program block help file can be established at the same time, so as to facilitate subsequent calling and management of the standard program blocks. By establishing a standard program library based on the standard program blocks corresponding to the first control function, the standardization degree of subsequent programmable logic controller (PLC) programming can be improved, and in addition, the standard program blocks can be reused through the standard program library, so as to shorten the programming cycle.
[0035] Optionally, the determining the first control function of the target factory, and establishing the standard program library based on the standard program block corresponding to the first control function, comprises: determining the first control function of the target factory according to the production control standard of the target factory, and determining the programmable logic controller program corresponding to each control function in the first control function; and generating the standard program block according to the programmable logic controller program, and establishing the standard program library based on the standard program block.
[0036] The programmable logic controller (PLC) is a kind of digital operation electronic system specially designed for industrial environment, which is used for automatic control of production process and mechanical equipment, and can realize functions such as logic control, sequence control, timing, counting, arithmetic operation, etc. through software programming.
[0037] In the embodiment of the present application, the first control function of the target factory is determined, and the standard program library is established based on the standard program block corresponding to the first control function. Specifically, first, the production control standard of the target factory can be determined, and the control functions that can be realized by the target factory are sorted according to the production control standard, to determine the first control function of the target factory. Secondly, the historical programmable logic controller (PLC) program corresponding to the first control function can be adjusted based on historical projects, to determine the programmable logic controller program corresponding to each control function in the first control function. Finally, the standard program block corresponding to each control function in the first control function can be generated according to the programmable logic controller program corresponding to each control function in the first control function, and the standard program library can be established based on the generated standard program block.
[0038] In the embodiment of the present application, the first control function of the target factory is determined, and the standard program library is established based on the standard program block corresponding to the first control function. Specifically, first, the production control standard of the target factory can be determined, and the control functions that can be realized by the target factory are sorted according to the production control standard, to determine the first control function of the target factory. Secondly, the historical programmable logic controller (PLC) program corresponding to the first control function can be adjusted based on historical projects, to determine the programmable logic controller program corresponding to each control function in the first control function. Finally, the standard program block corresponding to each control function in the first control function can be generated according to the programmable logic controller program corresponding to each control function in the first control function, and the standard program library can be established based on the generated standard program block.
[0039] The programming standard of the programmable logic controller (PLC) includes programming language, program structure, naming rules, annotation specification, etc. The bill of materials is used to convert the project control function requirement into a data format that meets the PLC programming standard.
[0040] In the embodiment of the present application, the project control function requirement can be determined first, and the information required for realizing each control function in the project control function requirement, such as equipment, modules, accessories, parameters, etc. is determined, to generate the bill of materials. It should be noted that when generating the bill of materials, the programming standard of the programmable logic controller (PLC) should be followed to ensure the readability, maintainability and scalability of the generated program.
[0041] Optionally, the programming standard based on the programmable logic controller generates the equipment bill of materials table according to the project control function requirement, comprising: identifying the project control function requirement, determining the second control function contained in the project control function requirement and the parameter information corresponding to the second control function; and generating the equipment bill of materials table according to the second control function and the parameter information based on the programming standard of the programmable logic controller.
[0042] In the embodiment of the present application, the programming standard based on the programmable logic controller generates the equipment bill of materials table according to the project control function requirement, specifically: identifying the project control function requirement, determining the second control function contained in the project control function requirement and the parameter information corresponding to the second control function, such as safety circuit, station, number, etc. Then, the equipment bill of materials table is generated according to the second control function and the parameter information based on the programming standard of the programmable logic controller (PLC). Exemplarily, Table 1 shows an equipment bill of materials table.
[0043] Table 1 Equipment bill of materials table
[0044]
[0045] S130, generating a target program for the programmable logic controller according to the standard program library and the equipment bill of materials table through a preset platform.
[0046] The preset platform can be a software platform specially used for PLC program development, providing program editing, debugging, simulation and other functions, supporting the calling and combination of standard program blocks, and the import and management of the equipment bill of materials table.
[0047] In the embodiment of the present application, the equipment bill of materials table can be imported into the preset platform, the equipment bill of materials table is parsed through the preset platform, and the standard program blocks in the standard program library are called according to the project control function requirement characterized by the equipment bill of materials table, to automatically generate a target program for the programmable logic controller, improving the generation efficiency of the target program. Exemplarily, Figure 2 A generation process schematic diagram of a target program is shown.
[0048] Optionally, the preset platform generates a target program for the programmable logic controller according to the standard program library and the equipment bill of materials table, further comprising: tracking the generation progress of the target program during the generation process of the target program, and visually displaying the generation progress through a user interface.
[0049] In the embodiment of the present application, in the process of generating the target program for the programmable logic controller according to the standard program library and the equipment bill of materials table through the preset platform, the generation progress of the target program can be tracked and visually displayed through the user interface, so that the developer can know the generation status of the target program in real time. Optionally, after the target program is generated, the generation time of the target program can also be determined and displayed together with the generation progress. For example, Figure 3 A visual display schematic diagram of the target program generation progress and generation time is shown.
[0050] The technical scheme of the embodiment of the present application determines the first control function of the target factory, establishes a standard program library based on the standard program block corresponding to the first control function, wherein the first control function includes a plurality of control functions that can be implemented by the target factory; generates an equipment bill of materials table according to the project control function requirement based on the programming standard of the programmable logic controller; and generates the target program for the programmable logic controller according to the standard program library and the equipment bill of materials table through the preset platform. The technical scheme of the embodiment of the present application automatically generates the target program for the programmable logic controller through the preset platform, the standard program library established based on the standard program block corresponding to the first control function of the target factory, and the equipment bill of materials table determined based on the programming standard and the project control function requirement, which can improve the standardization degree and generation efficiency of the target program.
[0051] Embodiment two
[0052] Figure 4 A flowchart of a programmable logic controller program generation method provided by the second embodiment of the present application is shown. The second embodiment of the present application is optimized based on the above-described embodiments, and the schemes not described in detail in the second embodiment of the present application are described in the above-described embodiments. As shown in the flowchart, Figure 4 the method comprises:
[0053] S210, determining the first control function of the target factory, and establishing a standard program library based on the standard program block corresponding to the first control function.
[0054] S220, generating an equipment bill of materials table according to the project control function requirement based on the programming standard of the programmable logic controller.
[0055] S230, calling the open interface of the preset platform to create a program template for the programmable logic controller.
[0056] In the embodiment of the present application, when the target program for the programmable logic controller is generated according to the standard program library and the equipment bill of materials table through the preset platform, the open interface of the preset platform can be called first to create a program template for the programmable logic controller.
[0057] S240, export all the standard program blocks in the standard program library into files in a preset format, and establish an association between the standard program blocks and the program template according to the files in the preset format.
[0058] The preset format can be set by a technician according to an actual situation, such as an xml format, and the embodiment of the application does not limit this.
[0059] In the embodiment of the application, after the program template for the programmable logic controller is created, all the standard program blocks in the standard program library can be exported into files in a preset format, and an association between the standard program blocks and the program template can be established according to the files in the preset format, so as to facilitate subsequent calling of the standard program blocks to fill the program template.
[0060] Optionally, the establishing of the association between the standard program blocks and the program template according to the files in the preset format comprises: determining a storage path of the standard program block in the standard program library according to the files in the preset format, and specifying an insertion path of the standard program block in the program template; and associating the storage path with the insertion path to establish the association between the standard program block and the program template.
[0061] In the embodiment of the application, the association between the standard program blocks and the program template is established according to the files in the preset format, specifically: first, a storage path of the standard program block in the standard program library is determined according to the files in the preset format, so as to facilitate accurate positioning when the standard program block is called; second, an insertion path of the standard program block in the program template is specified, and accurate positioning is facilitated when the program template is filled; and finally, the storage path and the insertion path are associated, and the association therebetween is taken as the association between the standard program block and the program template.
[0062] S250, generating a target program for the programmable logic controller according to the program template, the association, and the bill of materials.
[0063] In the embodiment of the application, the control function and the parameter information required by the project can be determined according to the bill of materials, and the corresponding standard program block is called to fill the program template based on the association between the program template and the standard program block, so as to generate the target program for the programmable logic controller.
[0064] Optionally, the automatically generating the target program for the programmable logic controller according to the program template, the association relationship and the equipment bill of materials comprises: based on the association relationship, calling the standard program block corresponding to the second control function in the equipment bill of materials to fill the program template; and adjusting the related parameters in the filled program template according to the parameter information in the equipment bill of materials to generate the target program.
[0065] In the embodiment of the application, when the target program for the programmable logic controller is automatically generated according to the program template, the association relationship and the equipment bill of materials, each row of the equipment bill of materials can be traversed to determine the second control function and the parameter information corresponding to each row, the standard program block corresponding to the second control function is called to fill the program template based on the association relationship between the program template and the standard program block, and the related parameters in the filled program template are adjusted according to the parameter information to generate the target program. Exemplarily, Figure 5 A schematic diagram of a target program generation process is shown as Figure 5 If the storage path of the standard program block corresponding to the second control function is not found, that is, the standard program block of the second control function does not exist in the standard program library, the standard program block development can be performed for the control function, and the standard program block is stored in the standard program library for target program generation and calling.
[0066] The technical scheme of the embodiment of the application determines the first control function of the target factory, establishes the standard program library based on the standard program block corresponding to the first control function, generates the equipment bill of materials according to the project control function demand based on the programming standard of the programmable logic controller, calls the open interface of the preset platform to create the program template for the programmable logic controller, exports all the standard program blocks in the standard program library into a file in a preset format, establishes the association relationship between the standard program block and the program template according to the file in the preset format, and generates the target program for the programmable logic controller according to the program template, the association relationship and the equipment bill of materials. The technical scheme of the embodiment of the application automatically generates the target program for the programmable logic controller according to the standard program library established based on the standard program block corresponding to the first control function of the target factory and the equipment bill of materials determined based on the programming standard and the project control function demand through the preset platform, which can improve the standardization degree and generation efficiency of the target program.
[0067] Embodiment three
[0068] Figure 6 A structural schematic diagram of a programmable logic controller program generation device provided in the third embodiment of the application is shown as Figure 6 The device comprises:
[0069] The standard library establishing module 310 is configured to determine a first control function of a target factory, and establish a standard program library based on a standard program block corresponding to the first control function; wherein the first control function comprises a plurality of control functions that can be implemented by the target factory.
[0070] The bill of materials table generating module 320 is configured to generate a bill of materials table of equipment based on a programming standard of the programmable logic controller, according to the project control function requirement.
[0071] The target program generating module 330 is configured to generate a target program for the programmable logic controller by a preset platform, according to the standard program library and the bill of materials table of equipment.
[0072] Optionally, the standard library establishing module 310 comprises:
[0073] The program determining unit is configured to determine the first control function of the target factory according to a production control standard of the target factory, and determine a programmable logic controller program corresponding to each control function in the first control function;
[0074] The standard library establishing unit is configured to generate a standard program block according to the programmable logic controller program, and establish a standard program library based on the standard program block.
[0075] Optionally, the bill of materials table generating module 320 comprises:
[0076] The requirement identifying unit is configured to identify the project control function requirement, and determine a second control function contained in the project control function requirement and parameter information corresponding to the second control function;
[0077] The bill of materials table generating unit is configured to generate a bill of materials table of equipment based on a programming standard of the programmable logic controller, according to the second control function and the parameter information.
[0078] Optionally, the target program generating module 330 comprises:
[0079] The program template creating unit is configured to call an open interface of the preset platform, and create a program template for the programmable logic controller;
[0080] The association relationship determining unit is configured to export all the standard program blocks in the standard program library into a file in a preset format, and establish an association relationship between the standard program blocks and the program template according to the file in the preset format;
[0081] The target program generating unit is configured to generate a target program for the programmable logic controller according to the program template, the association relationship, and the bill of materials table of equipment.
[0082] Optionally, the association relationship determining unit is specifically configured to:
[0083] determine a storage path of the standard program block in the standard program library according to the file in the preset format, and specify an insertion path of the standard program block in the program template;
[0084] associate the storage path with the insertion path, and establish an association relationship between the standard program block and the program template.
[0085] Optionally, the target program generating unit is specifically configured to:
[0086] fill the program template with the standard program block corresponding to the second control function in the equipment bill of materials table based on the association relationship;
[0087] adjust relevant parameters in the filled program template according to the parameter information in the equipment bill of materials table, and generate the target program.
[0088] Optionally, the target program generating module 330 further comprises:
[0089] a generation progress tracking unit configured to track a generation progress of the target program in the generation process of the target program, and visually display the generation progress through a user interface.
[0090] The programmable logic controller program generation device provided by the embodiment can execute the programmable logic controller program generation method provided by any embodiment of the application, and has the corresponding function modules and beneficial effects of the execution method.
[0091] Embodiment Four
[0092] Figure 7 A structural schematic diagram of an electronic device 10 that can be used to implement embodiments of the application is shown. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, tablets, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular telephones, smart phones, wearable devices (e.g., headsets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not intended to limit the implementations of the application described and / or claimed in this document.
[0093] As Figure 7As shown, the electronic device 10 includes at least one processor 11, and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., communicatively connected to the at least one processor 11, where the memory stores a computer program executable by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or loaded from the storage unit 18 into the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0094] Various components in the electronic device 10 are connected to the I / O interface 15, including an input unit 16, such as a keyboard, a mouse, etc., an output unit 17, such as various types of displays, a speaker, etc., a storage unit 18, such as a magnetic disk, an optical disk, etc., and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunication networks.
[0095] The processor 11 can be various general and / or special purpose processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 performs various methods and processes described above, such as the programmable logic controller program generation method.
[0096] In some embodiments, the programmable logic controller program generation method can be implemented as a computer program tangibly embodied in a computer readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the programmable logic controller program generation method described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to perform the programmable logic controller program generation method by any other appropriate means, such as by means of firmware.
[0097] The various embodiments of the systems and techniques described above can be implemented in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a load programmable logic device (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.
[0098] Computer programs used to implement the processes of the application can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer program
[0099] In the context of the present application, a computer-readable storage medium can be a tangible medium that can contain or store computer programs for use by or in connection with an instruction execution system, apparatus, or device. Computer-readable storage media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of the machine-readable storage medium will include one or more lines of a program of instructions in a transitory signal, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0100] To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
[0101] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0102] The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. A server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system, to solve the defects of large management difficulty and weak business scalability in traditional physical host and VPS service.
[0103] In particular, the processes described above with reference to the flowcharts can be implemented as computer software programs in accordance with embodiments of the application. For example, embodiments of the application include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program comprising program code for executing the methods illustrated by the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via the communication unit 19, or installed from the storage unit 18, or installed from the ROM 12. When the computer program is executed by the processor 11, the above-described functions defined in the methods of embodiments of the application are performed.
[0104] It should be understood that the various forms of flow shown above can be used to reorder, add, or remove steps. For example, the steps recited in the present application can be performed in parallel, in series, or in a different order, as long as the desired results of the technical solutions of the present application can be achieved, which are not limited herein.
[0105] The above detailed description does not constitute a limitation on the protection scope of the present application. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent replacements, and improvements made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for generating a programmable logic controller (PLC) program, characterized in that, The method includes: The first control function of the target factory is determined, and a standard program library is established based on the standard program block corresponding to the first control function; wherein, the first control function includes multiple control functions that the target factory can implement; Based on the programming standard of programmable logic controllers, generate the equipment bill of materials according to the project's control function requirements; Using a preset platform, a target program for the programmable logic controller is generated based on the standard program library and the equipment bill of materials.
2. The method according to claim 1, characterized in that, The step of determining the first control function of the target factory and establishing a standard program library based on the standard program block corresponding to the first control function includes: The first control function of the target factory is determined according to the production control standard of the target factory, and the programmable logic controller program corresponding to each control function in the first control function is determined. Standard program blocks are generated based on the programmable logic controller program, and a standard program library is established based on the standard program blocks.
3. The method according to claim 1, characterized in that, The programming standard based on programmable logic controllers generates a bill of materials (BOM) for equipment according to the project's control function requirements, including: Identify the project control function requirements, and determine the second control function included in the project control function requirements and the parameter information corresponding to the second control function; Based on the programming standard of programmable logic controllers, a bill of materials table for equipment is generated according to the second control function and the parameter information.
4. The method according to claim 1, characterized in that, The step of generating a target program for the programmable logic controller through a preset platform, based on the standard program library and the equipment bill of materials, includes: Call the open interface of the preset platform to create a program template for the programmable logic controller; Export all standard program blocks in the standard program library into a file of a preset format, and establish the association between the standard program blocks and the program template based on the file of the preset format. Based on the program template, the association relationships, and the equipment bill of materials, a target program for the programmable logic controller is generated.
5. The method according to claim 4, characterized in that, The step of establishing the association between the standard program block and the program template based on the file of the preset format includes: The storage path of the standard program block in the standard program library is determined according to the file of the preset format, and the insertion path of the standard program block in the program template is specified. Associate the storage path with the insertion path to establish the association between the standard program block and the program template.
6. The method according to claim 4, characterized in that, The step of automatically generating a target program for the programmable logic controller based on the program template, the association relationship, and the equipment bill of materials includes: Based on the aforementioned relationship, the standard program block corresponding to the second control function in the equipment bill of materials is invoked to populate the program template; Based on the parameter information in the equipment bill of materials, the relevant parameters in the filled-in program template are adjusted to generate the target program.
7. The method according to claim 1, characterized in that, The system automatically generates a target program for the programmable logic controller (PLC) based on the standard program library and the equipment bill of materials using a preset platform. The program also includes: During the generation of the target program, the generation progress of the target program is tracked, and the generation progress is visualized through a user interface.
8. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the programmable logic controller program generation method according to any one of claims 1-7.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the programmable logic controller program generation method according to any one of claims 1-7.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the programmable logic controller program generation method as described in any one of claims 1-7.
