CN117908462A - Ladder diagram program application device and method - Google Patents

Ladder diagram program application device and method Download PDF

Info

Publication number
CN117908462A
CN117908462A CN202410087426.9A CN202410087426A CN117908462A CN 117908462 A CN117908462 A CN 117908462A CN 202410087426 A CN202410087426 A CN 202410087426A CN 117908462 A CN117908462 A CN 117908462A
Authority
CN
China
Prior art keywords
file
ladder diagram
variable
input
ladder
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.)
Pending
Application number
CN202410087426.9A
Other languages
Chinese (zh)
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.)
Beijing Research Institute of Auotomation for Machinery Industry Co Ltd
Original Assignee
Beijing Research Institute of Auotomation for Machinery Industry Co Ltd
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 Beijing Research Institute of Auotomation for Machinery Industry Co Ltd filed Critical Beijing Research Institute of Auotomation for Machinery Industry Co Ltd
Priority to CN202410087426.9A priority Critical patent/CN117908462A/en
Publication of CN117908462A publication Critical patent/CN117908462A/en
Pending legal-status Critical Current

Links

Landscapes

  • Programmable Controllers (AREA)

Abstract

The application provides a ladder program application device and a ladder program application method. The application provides a ladder diagram program application device which is applied to a Feiteng platform and at least comprises an upper computer; the upper computer is used for constructing a target engineering file on the Feiteng platform based on the trapezoidal drawing library, wherein the target engineering file at least comprises one trapezoidal drawing, and the upper computer at least comprises the trapezoidal drawing library; and the upper computer at least further comprises a compiling module which is used for compiling the target engineering file according to the Feiteng platform instruction set. According to the ladder diagram program application device and the ladder diagram program application method, on one hand, ladder diagram files of different platforms are integrated on the Feiteng platform by abstracting the ladder diagram into the universal form of the unified and standardized variable table file and the processing logic file, so that free transmission and processing of the ladder diagram among multiple platforms are realized, the reusability is good, and the time cost for transplanting the ladder diagram is low; on the other hand, PLC programming on the Feiteng platform through the ladder diagram is realized.

Description

Ladder diagram program application device and method
Technical Field
The application relates to the technical field of ladder programming, in particular to a ladder program application device and a ladder program application method.
Background
As one of five configuration languages, a ladder diagram is widely used in PLCs. The current PLC technology is relatively pure, and the precedent for developing the PLC on other platforms exists.
The Feiteng platform is a representative domestic chip based on ARM instruction set authorization, and the CPU of the Feiteng platform gradually forms an instruction set of the Feiteng platform on the basis of ARM8 authorization. However, the existing PLC supporting ladder programming is not yet adapted to the Feiteng platform, and belongs to the domestic chip blind area; moreover, the remains industry mostly adopts ladder diagram programming, and when the ladder diagram is transplanted, because products of different companies have different processing modes on the ladder diagram, the transplantation is mostly based on manual processing, and the time is very long. Therefore, the ladder diagram has poor reusability on the Feiteng platform, large transplanting time cost, few platforms capable of programming the ladder diagram and poor portability of the ladder diagram.
Disclosure of Invention
In view of the above, the present application provides a ladder program application device and method for implementing PLC programming on a fly-by platform through a ladder and reducing the time cost of ladder migration.
Specifically, the application is realized by the following technical scheme:
the application provides a ladder diagram program application device, which is applied to a Feiteng platform and at least comprises an upper computer; wherein,
The upper computer is used for constructing a target engineering file on the Feiteng platform based on a ladder diagram library, wherein the target engineering file at least comprises one ladder diagram, and the upper computer at least comprises the ladder diagram library;
The ladder diagram library comprises a plurality of ladder diagrams, each ladder diagram stored in the ladder diagram library at least comprises an external variable file and a processing logic file which are stored in an associated mode, wherein the external variable file is used for storing variable information in the corresponding ladder diagram, the variable information at least comprises an input area variable and an output area variable, the input area variable and the output area variable adopt the same storage address and are stored in the same memory space, and a read-write request carries out read-write control on the input area variable or the output area variable in the same storage address according to an access address and a permission identifier;
the processing logic file is used for storing the processing logic in the corresponding ladder diagram;
And the upper computer at least further comprises a compiling module which is used for compiling the target engineering file according to the Feiteng platform instruction set, wherein the compiling of the target engineering file at least comprises matching of the ladder diagram external variable file and the processing logic file in the target engineering file, searching a register corresponding to the compiling instruction according to the matched file, and compiling the matched file by utilizing the register.
Optionally, the input area variable has a first identifier, the output area variable has a second identifier, and the read-write request at least comprises an access address and a permission identifier;
the read-write request carries out read-write control on the input area variable or the output area variable in the same storage address according to the access address and the authority identification, and specifically comprises the following steps:
Determining a target memory area according to the access address;
matching the rights identification with the first identifier and the second identifier;
if the authority identification is matched with the first identifier, performing read-write control on the input area variable;
and if the authority identification is matched with the second identifier, performing read-write control on the output area variable.
Optionally, the read-write request carries out read-write control on the input area variable or the output area variable in the same storage address according to the access address and the permission identifier, and specifically includes:
if the read-write request is a read request, reading the input area variable or the output area variable in the content space corresponding to the access address;
If the read-write request is a write request, the read-write request at least further includes written variable information, and the input area variable or the output area variable in the content space corresponding to the access address is replaced by the variable information written in the read-write request.
Optionally, each ladder diagram is a functional module, one functional module includes one or more components, and the processing logic is one or more data processing functions in the ladder diagram;
the processing logic file is used for storing processing logic in a corresponding ladder diagram, and specifically comprises the following steps:
Tracking input and output data of each component in the ladder diagram to form a data processing process;
Determining data processing functions for realizing corresponding functions according to data processing processes, wherein each data processing process corresponds to one or more data processing functions;
And determining the arrangement sequence of the data processing functions according to the logic sequence of the data processing process to form a processing logic file.
Optionally, the upper computer further comprises an adaptation module and a plurality of application interfaces, wherein the ladder diagram file format and the stored file corresponding to each application interface are different;
The adaptation module is used for identifying the file format of the external input ladder diagram, matching the corresponding target application interface based on the file format of the external input ladder diagram, extracting variable information and a logic processing process from the stored file based on the target application interface, forming an external variable file and a processing logic file corresponding to the external input ladder diagram, and identifying and storing the external input ladder diagram.
Optionally, the identifying and storing the ladder diagram of the external input specifically includes:
The target application interface extracts the input variable information and the output variable information of the outside input ladder diagram, respectively creates a third identifier of the input variable information and a fourth identifier of the output variable information, allocates a storage address for the outside variable file, and stores the input variable information and the third identifier of the outside input ladder diagram, the output variable information and the fourth identifier of the outside input ladder diagram to the allocated storage address to form the outside variable file;
According to the data processing process of the outside input ladder diagram, matching data processing functions realizing corresponding functions, and forming a processing logic file according to the matched data processing functions;
And storing an external variable file and a processing logic file corresponding to the externally input ladder diagram so as to store the externally input ladder diagram.
Optionally, each ladder diagram stored in the ladder diagram library at least includes an external variable file and a processing logic file stored in association, and specifically includes:
The external variable file corresponding to each ladder diagram in the ladder diagram library at least comprises variable information, and the variable information at least comprises names, types, values and attributes of variables;
storing variable information in a variable table form to form an external variable file corresponding to the ladder diagram;
For each ladder diagram in the ladder diagram library, matching data processing functions with corresponding functions according to the data processing process, forming processing logic according to the matched data processing functions, and storing the extracted processing logic in the form of engineering files;
And associating the external variable file with the engineering file.
Optionally, the upper computer further comprises a writing module, a detection module and a downloading module; wherein,
The compiling module is used for constructing a target engineering file by utilizing a ladder diagram library in response to the selection of a user, and is connected with the compiling module;
The detection module is used for simulating the running process and the result of the built target engineering file so as to detect the correctness of the program, and is connected with the lower loading module;
and the downloading module is used for importing the executable binary file obtained by compiling the target engineering file into the actual PLC equipment so as to correct the program in real time.
Optionally, the ladder diagram program application device further comprises a lower computer, wherein the lower computer is used for receiving and processing an executable binary file obtained by compiling the target engineering file by the upper computer on the PLC equipment; the lower computer comprises an execution module, a debugging module and an upper loading module; wherein,
The execution module is used for receiving and analyzing the executable binary file;
The debugging module is used for simulating the running process of the binary file in the PLC equipment and ensuring the accuracy of program running;
And the uploading module is used for uploading the binary files exported from the PLC equipment to the upper computer again so as to rewrite and compile the binary files.
The second aspect of the present application provides a ladder program application method, where the ladder program application method is applied to a flying platform, and the method includes:
Constructing a target engineering file on the Feiteng platform based on a trapezoidal graph library, wherein the target engineering file at least comprises one trapezoidal graph, and the upper computer at least comprises the trapezoidal graph library;
The ladder diagram library comprises a plurality of ladder diagrams, each ladder diagram stored in the ladder diagram library at least comprises an external variable file and a processing logic file which are stored in an associated mode, wherein the external variable file is used for storing variable information in the corresponding ladder diagram, the variable information at least comprises an input area variable and an output area variable, the input area variable and the output area variable adopt the same storage address and are stored in the same memory space, and a read-write request carries out read-write control on the input area variable or the output area variable in the same storage address according to an access address and a permission identifier; the processing logic file is used for storing the processing logic in the corresponding ladder diagram;
And matching the ladder diagram external variable file and the processing logic file in the target engineering file, searching a register corresponding to the compiling instruction according to the matched file, and compiling the matched file by using the register.
The application provides a ladder diagram program application device and a method, wherein the ladder diagram program application device is applied to a Feiteng platform and at least comprises an upper computer; the upper computer is used for constructing a target engineering file on the Feiteng platform based on a trapezoidal gallery, wherein the target engineering file at least comprises a trapezoidal chart, and the upper computer at least comprises the trapezoidal gallery; the ladder diagram library comprises a plurality of ladder diagrams, each ladder diagram stored in the ladder diagram library at least comprises an external variable file and a processing logic file which are stored in an associated mode, wherein the external variable file is used for storing variable information in the corresponding ladder diagram, the variable information at least comprises an input area variable and an output area variable, the input area variable and the output area variable adopt the same storage address and are stored in the same memory space, and a read-write request carries out read-write control on the input area variable or the output area variable in the same storage address according to an access address and a permission identifier; the processing logic file is used for storing the processing logic in the corresponding ladder diagram; and the upper computer at least further comprises a compiling module which is used for compiling the target engineering file according to the Feiteng platform instruction set, wherein the compiling of the target engineering file at least comprises matching of the ladder diagram external variable file and the processing logic file in the target engineering file, searching a register corresponding to the compiling instruction according to the matched file, and compiling the matched file by utilizing the register. On one hand, the ladder diagram is abstracted into a universal form of a unified and normative variable table file and a processing logic file, and ladder diagram files of different platforms are integrated on a Feiteng platform, so that free transmission and processing of the ladder diagram among multiple platforms are realized, the reusability is good, and the time cost of transplanting the ladder diagram is low; on the other hand, corresponding files are compiled according to the general file format which can be identified by each platform, the instruction set of the Feiteng platform and the corresponding registers, so that PLC programming on the Feiteng platform through a ladder diagram is realized.
Drawings
FIG. 1 is a schematic diagram of a ladder program application apparatus according to an embodiment of the present application;
FIG. 2 is a diagram illustrating a process image according to an exemplary embodiment of the present application;
FIG. 3 is a block diagram of a ladder program application apparatus in accordance with an exemplary embodiment of the present application;
FIG. 4 is an interface diagram of a host computer according to an exemplary embodiment of the present application;
Fig. 5 is a flowchart of a first embodiment of a ladder program application method provided by the present application.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with the application. Rather, they are merely examples of apparatus and methods consistent with aspects of the application as detailed in the accompanying claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any or all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used herein to describe various information, these information should not be limited by these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the application. The word "if" as used herein may be interpreted as "at … …" or "at … …" or "in response to a determination" depending on the context.
The application provides a ladder diagram program application device and a ladder diagram program application method, which are used for realizing PLC programming through a ladder diagram on a Feiteng platform and reducing the time cost of the ladder diagram transplanting.
The application provides a ladder diagram program application device and a method, wherein the ladder diagram program application device is applied to a Feiteng platform and at least comprises an upper computer; the upper computer is used for constructing a target engineering file on the Feiteng platform based on a trapezoidal gallery, wherein the target engineering file at least comprises a trapezoidal chart, and the upper computer at least comprises the trapezoidal gallery; the ladder diagram library comprises a plurality of ladder diagrams, each ladder diagram stored in the ladder diagram library at least comprises an external variable file and a processing logic file which are stored in an associated mode, wherein the external variable file is used for storing variable information in the corresponding ladder diagram, the variable information at least comprises an input area variable and an output area variable, the input area variable and the output area variable adopt the same storage address and are stored in the same memory space, and a read-write request carries out read-write control on the input area variable or the output area variable in the same storage address according to an access address and a permission identifier; the processing logic file is used for storing the processing logic in the corresponding ladder diagram; and the upper computer at least further comprises a compiling module which is used for compiling the target engineering file according to the Feiteng platform instruction set, wherein the compiling of the target engineering file at least comprises matching of the ladder diagram external variable file and the processing logic file in the target engineering file, searching a register corresponding to the compiling instruction according to the matched file, and compiling the matched file by utilizing the register. On one hand, the ladder diagram is abstracted into a universal form of a unified and normative variable table file and a processing logic file, and ladder diagram files of different platforms are integrated on a Feiteng platform, so that free transmission and processing of the ladder diagram among multiple platforms are realized, the reusability is good, and the time cost of transplanting the ladder diagram is low; on the other hand, corresponding files are compiled according to the general file format which can be identified by each platform, the instruction set of the Feiteng platform and the corresponding registers, so that PLC programming on the Feiteng platform through a ladder diagram is realized.
Specific examples are given below to describe the technical solution of the present application in detail.
Fig. 1 is a schematic structural diagram of a ladder program application apparatus according to an embodiment of the present application. Referring to fig. 1, the device provided in this embodiment is applied to a flying platform, where the device includes at least an upper computer; wherein,
The upper computer is used for constructing a target engineering file on the Feiteng platform based on a ladder diagram library, wherein the target engineering file at least comprises one ladder diagram, and the upper computer at least comprises the ladder diagram library;
The ladder diagram library comprises a plurality of ladder diagrams, each ladder diagram stored in the ladder diagram library at least comprises an external variable file and a processing logic file which are stored in an associated mode, wherein the external variable file is used for storing variable information in the corresponding ladder diagram, the variable information at least comprises an input area variable and an output area variable, the input area variable and the output area variable adopt the same storage address and are stored in the same memory space, and a read-write request carries out read-write control on the input area variable or the output area variable in the same storage address according to an access address and a permission identifier;
the processing logic file is used for storing the processing logic in the corresponding ladder diagram;
Preferably, the upper computer comprises a memory, IEC memory allocation in the upper computer is modified according to the memory capacity of the Feiteng platform, and the modified memory at least comprises a data area memory and a program area memory which are respectively used for storing data files and program codes.
And the upper computer at least further comprises a compiling module which is used for compiling the target engineering file according to the Feiteng platform instruction set, wherein the compiling of the target engineering file at least comprises matching of the ladder diagram external variable file and the processing logic file in the target engineering file, searching a register corresponding to the compiling instruction according to the matched file, and compiling the matched file by utilizing the register.
Specifically, the compiling module is configured to compile the written program into a machine language, further compile the machine language into an executable binary file, and transmit the executable binary file to a lower computer.
In order to enable the instruction set of the Feiteng platform to compile the universal external variable files and the processing logic files generated by the steps, the invention preferably provides compiling optimization. Specifically, (1) performing compiler back-end optimization aiming at a Feiteng ARM V8 instruction set, a CPU and a register; (2) modifying IEC memory allocation based on memory capacity; (3) The traditional file-based implementation of the power down retention function is improved based on the NVSRAM power down retention driver.
Specifically, the Feiteng ARMV instruction set contains a series of instructions, and the form of the Feiteng ARMV instruction set includes the following features: (1) a reduced instruction set: the ARM architecture has a simplified instruction set, provides efficient instruction execution, and is beneficial to improving performance and reducing power consumption; (2) 64-bit architecture: the Feiteng ARM V8 adopts a 64-bit instruction set, and supports a larger memory address space and higher data processing capacity; (3) SIMD (Single Instruction, multiple data, single instruction multiple data stream) instruction: providing the capability to perform multiple data operations on the same instruction, facilitating parallel processing of data, improving performance of multimedia and graphics applications; (4) virtualization support: the ARM V8 architecture has strong virtualization support, so that the ARM V8 architecture is excellent in server and cloud computing environments; (5) security enhancement: ARM V8 introduces some security enhancement features that help protect the system from various attacks and threats.
It should be noted that, according to the register and the file type of the matched file, the corresponding command may be used to compile, and if the register needs other options or parameters, the register may be adjusted according to actual needs.
Specifically, compiling of the ladder diagram is divided into upper computer compiling and lower computer executing. Compiling the ladder diagram into an IL instruction table language based on the universal external variable file, the processing logic file and the IEC61131-3 standard when compiling the upper computer, wherein the universal intermediate code is universal for each platform and is composed of operation codes with the length of 1 byte, the operation codes of different instructions are different, and the operation codes of different instructions are one or more; the universal intermediate code is independent in hardware, is irrelevant to communication software and an operating system, can be executed on different target systems, and ensures portability.
Further, when the lower computer executes the program code, the lower computer at least comprises a memory access module and a U-code interpreter, the memory access module is in communication connection with the Feiteng platform and is used for transmitting and reading data and accessing the executable code, the memory access module converts the data and/or the code into a standard format and is communicated with the U-code interpreter, the memory access module is independent in the lower computer, and when the platform is transplanted, only the content of the module is required to be modified, and other kernel functions such as the U-code interpreter and the like are not required to be modified. In order to be used with the Feiteng platform, the memory access module is modified into a small-end byte order, executable universal intermediate codes are read and then sent to the U-code interpreter, the U-code interpreter is used for interpreting and executing the universal intermediate codes, the type of each operation code in the universal intermediate codes is determined, an execution function is determined based on the type, and the U-code executes the execution function in a stack mode. Specifically: firstly, loading instructions push all instructions to a stack, secondly, the first element and the second element (the number of the elements is different according to the instruction type) in the stack are combined before the instructions are executed, and finally, the result of the operation is returned to the stack.
And the lower computer executes the ladder diagram application program to realize the function corresponding to the target engineering file. In order to implement the ladder diagram application program to communicate with external variables, at least one process image is provided in the lower computer, and fig. 2 is a schematic diagram of the process image according to an exemplary embodiment of the present application. Referring to FIG. 2, a process image is used to process external variables. The process image at least comprises the following steps: a segment header, a first storage space, a second storage space, a third storage space, and a fourth storage space. The first memory space is used for physical input (% I) storage, the second memory space is used for physical output (% Q) storage, the third memory space is used for identifier (% M) storage, and the fourth memory space gaps is unused memory space.
Further, the lower computer is provided with two shared memory areas, including an I area and a Q area, wherein the I area is used for storing physical input data, the Q area is used for storing physical output data, a first interface and a second interface are respectively used for enabling a process image to be associated with memory variables of the I area and the Q area, the first interface is a EnvReadProcImg interface, the second interface is a EnvWriteProcImg interface, and the first interface is called before each program cycle and is responsible for reading the I area (namely physical input) of the shared memory area and writing the I area into an input area of the process image; the second interface is invoked after each program cycle and is responsible for writing the output area of the process image to the shared memory Q-area (i.e., physical output). As an alternative embodiment, the I area and the Q area are sized according to the storage requirements of the Feiteng platform.
As an optional embodiment, in order to download the ladder diagram input from the outside, the invention also provides a serial port adapting module, preferably, an RS485 serial port driving adapting module, where the serial port adapting module is used to execute a function of switching serial ports according to the downloading, and the serial port functions at least include a ladder diagram program downloading function and a serial port driving function of a MODBUS RTU communication protocol, and the two functions can multiplex one serial port, thereby fully playing the capability of hardware and improving the utilization rate of hardware; as an optional embodiment, the invention can also realize the data communication of the ladder diagram program, the local IO and the remote IO in a shared memory mode; the hardware adaptation further comprises communication protocol adaptation, including modbus TCP slave protocol and RTU slave protocol adaptation.
Optionally, the upper computer further comprises an adaptation module and a plurality of application interfaces, wherein the ladder diagram file format and the stored file corresponding to each application interface are different;
The adaptation module is used for identifying the file format of the external input ladder diagram, matching the corresponding target application interface based on the file format of the external input ladder diagram, extracting variable information and a logic processing process from the stored file based on the target application interface, forming an external variable file and a processing logic file corresponding to the external input ladder diagram, and identifying and storing the external input ladder diagram.
Specifically, the application interfaces are in one-to-one matching with the file format of the ladder diagram. In other words, each application interface matches one ladder diagram to identify and store the ladder diagram.
Optionally, each ladder diagram is a functional module, one functional module includes one or more components, and the processing logic is one or more data processing functions in the ladder diagram;
the processing logic file is used for storing processing logic in a corresponding ladder diagram, and specifically comprises the following steps:
Tracking input and output data of each component in the ladder diagram to form a data processing process;
Determining data processing functions for realizing corresponding functions according to data processing processes, wherein each data processing process corresponds to one or more data processing functions;
And determining the arrangement sequence of the data processing functions according to the logic sequence of the data processing process to form a processing logic file.
Specifically, each data processing process corresponds to one data processing function or a plurality of data processing functions, the arrangement sequence of the corresponding data processing functions can be determined according to the logic sequence of the data processing processes, and the data processing functions are combined according to the arrangement sequence to form a processing logic file.
Optionally, the identifying and storing the ladder diagram of the external input specifically includes:
The target application interface extracts the input variable information and the output variable information of the outside input ladder diagram, respectively creates a third identifier of the input variable information and a fourth identifier of the output variable information, allocates a storage address for the outside variable file, and stores the input variable information and the third identifier of the outside input ladder diagram, the output variable information and the fourth identifier of the outside input ladder diagram to the allocated storage address to form the outside variable file;
According to the data processing process of the outside input ladder diagram, matching data processing functions realizing corresponding functions, and forming a processing logic file according to the matched data processing functions;
And storing an external variable file and a processing logic file corresponding to the externally input ladder diagram so as to store the externally input ladder diagram.
Specifically, the input variable information and the output variable information of the ladder diagram input from the outside are stored as external variable files corresponding to the ladder diagram, and the data processing engineering of the ladder diagram input from the outside is stored as processing logic files corresponding to the ladder diagram.
Optionally, each ladder diagram stored in the ladder diagram library at least includes an external variable file and a processing logic file stored in association, and specifically includes:
The external variable file corresponding to each ladder diagram in the ladder diagram library at least comprises variable information, and the variable information at least comprises names, types, values and attributes of variables;
storing variable information in a variable table form to form an external variable file corresponding to the ladder diagram;
For each ladder diagram in the ladder diagram library, matching data processing functions with corresponding functions according to the data processing process, forming processing logic according to the matched data processing functions, and storing the extracted processing logic in the form of engineering files;
And associating the external variable file with the engineering file.
Specifically, the external variable files corresponding to each ladder diagram are associated with the engineering files, so that the subsequent matching of the corresponding target application interfaces is facilitated.
Optionally, the input area variable has a first identifier, the output area variable has a second identifier, and the read-write request at least comprises an access address and a permission identifier;
the read-write request carries out read-write control on the input area variable or the output area variable in the same storage address according to the access address and the authority identification, and specifically comprises the following steps:
Determining a target memory area according to the access address;
matching the rights identification with the first identifier and the second identifier;
if the authority identification is matched with the first identifier, performing read-write control on the input area variable;
and if the authority identification is matched with the second identifier, performing read-write control on the output area variable.
Optionally, the read-write request carries out read-write control on the input area variable or the output area variable in the same storage address according to the access address and the permission identifier, and specifically includes:
if the read-write request is a read request, reading the input area variable or the output area variable in the content space corresponding to the access address;
If the read-write request is a write request, the read-write request at least further includes written variable information, and the input area variable or the output area variable in the content space corresponding to the access address is replaced by the variable information written in the read-write request.
Optionally, the upper computer further comprises a writing module, a detection module and a downloading module; wherein,
The compiling module is used for constructing a target engineering file by utilizing a ladder diagram library in response to the selection of a user, and is connected with the compiling module;
The detection module is used for simulating the running process and the result of the built target engineering file so as to detect the correctness of the program, and is connected with the lower loading module;
and the downloading module is used for importing the executable binary file obtained by compiling the target engineering file into the actual PLC equipment so as to correct the program in real time.
Specifically, fig. 3 is a schematic diagram of a ladder program application apparatus according to an exemplary embodiment of the present application. Referring to fig. 3, in the writing module, a ladder diagram can be used to intuitively draw a program according to an expected drawing. Each drawn project corresponds to an actual control program, and different purposes can be achieved through different projects. The upper computer supports a 32-bit operating system and a 64-bit operating system simultaneously, and different operating system configurations are established for the 32-bit operating system and the 64-bit operating system, wherein the 64-bit operating system is selected for explanation.
Further, in the detection module, the execution result of the program by the PLC equipment or the upper computer can be detected, and the written program is adjusted and optimized according to the retrieval result. The operation process and the result of the PLC can be simulated by using the PLC equipment or the simulation equipment, and the correctness of the program is preliminarily detected.
Further, in the downloading module, the compiled binary file can be imported into the actual PLC equipment, and the running condition of the PLC equipment is observed through the upper computer so as to correct the program in real time. Fig. 4 is an interface diagram of a host computer according to an exemplary embodiment of the present application.
Optionally, the ladder diagram program application device further includes a lower computer, where the lower computer may be preferably a PLC device, and receives and processes, on the PLC device, an executable binary file obtained by compiling the target engineering file by the upper computer; the lower computer comprises an execution module, a debugging module and an upper loading module; wherein,
The execution module is used for receiving and analyzing the executable binary file;
The debugging module is used for simulating the running process of the binary file in the PLC equipment and ensuring the accuracy of program running;
And the uploading module is used for uploading the binary files exported from the PLC equipment to the upper computer again so as to rewrite and compile the binary files.
Specifically, please continue to refer to fig. 3, the debug module includes an IO module and a PN communication module; in the IO module, the IO operation refers to obtaining an input of the device and outputting to the device after operation. The logic part of the program includes the analog input and output variables in the form and the addresses of the analog input and output variables in the operating system. And the actual digital input and output are processed through the IO module. The PLC equipment comprises a plurality of IO modules, and each IO module corresponds to a plurality of digital input and output points. Through these IO modules the PLC device can obtain external input to output to the external machine. An address variable conversion table exists in the PLC equipment, and the analog quantity address and the actual digital quantity address in the program can be mapped to ensure the accuracy of the program operation.
In the PN communication module, PN communication refers to communication between a master station and a slave station by utilizing a ProfiNet protocol. The secondary station is responsible for collecting input and output information for IO operation, and the main station is mainly responsible for running programs except for a small part of IO. The same line of the master station and the slave station is executed by the lower computer. PN communication initially exists as a stand-alone module, which is later embedded directly in the lower computer as part of ensuring real-time and reliability.
It should be noted that, the upload module is mostly used in a field debugging stage in actual situations.
The ladder diagram program application device provided by the embodiment is applied to a Feiteng platform and at least comprises an upper computer; the upper computer is used for constructing a target engineering file on the Feiteng platform based on a trapezoidal gallery, wherein the target engineering file at least comprises a trapezoidal chart, and the upper computer at least comprises the trapezoidal gallery; the ladder diagram library comprises a plurality of ladder diagrams, each ladder diagram stored in the ladder diagram library at least comprises an external variable file and a processing logic file which are stored in an associated mode, wherein the external variable file is used for storing variable information in the corresponding ladder diagram, the variable information at least comprises an input area variable and an output area variable, the input area variable and the output area variable adopt the same storage address and are stored in the same memory space, and a read-write request carries out read-write control on the input area variable or the output area variable in the same storage address according to an access address and a permission identifier; the processing logic file is used for storing the processing logic in the corresponding ladder diagram; and the upper computer at least further comprises a compiling module which is used for compiling the target engineering file according to the Feiteng platform instruction set, wherein the compiling of the target engineering file at least comprises matching of the ladder diagram external variable file and the processing logic file in the target engineering file, searching a register corresponding to the compiling instruction according to the matched file, and compiling the matched file by utilizing the register. On one hand, the ladder diagram is abstracted into a universal form of a unified and normative variable table file and a processing logic file, and ladder diagram files of different platforms are integrated on a Feiteng platform, so that free transmission and processing of the ladder diagram among multiple platforms are realized, the reusability is good, and the time cost of transplanting the ladder diagram is low; on the other hand, corresponding files are compiled according to the general file format which can be identified by each platform, the instruction set of the Feiteng platform and the corresponding registers, so that PLC programming on the Feiteng platform through a ladder diagram is realized.
Fig. 5 is a flowchart of a first embodiment of a ladder program application method provided by the present application. Referring to fig. 5, the method provided in this embodiment, the ladder program application method is applied to a flying platform, and the method includes:
s501, constructing a target engineering file on the Feiteng platform based on a ladder diagram library, wherein the target engineering file at least comprises one ladder diagram, and the upper computer at least comprises the ladder diagram library.
The ladder diagram library comprises a plurality of ladder diagrams, each ladder diagram stored in the ladder diagram library at least comprises an external variable file and a processing logic file which are stored in an associated mode, wherein the external variable file is used for storing variable information in the corresponding ladder diagram, the variable information at least comprises an input area variable and an output area variable, the input area variable and the output area variable adopt the same storage address and are stored in the same memory space, and a read-write request carries out read-write control on the input area variable or the output area variable in the same storage address according to an access address and a permission identifier; the processing logic file is used to store the processing logic in the corresponding ladder diagram.
In particular, a reusable ladder diagram for certain specific functions may be created by combining and packaging one or more components.
In a possible implementation manner, the ladder diagram can also be obtained by means of external import, and the ladder diagram is abstracted into a universal form of an external variable file and a processing logic file with unified specification when imported. The external variable file is used for storing variable information in the ladder diagram, and the processing logic file is used for storing processing logic in the ladder diagram.
S502, matching the ladder diagram external variable file and the processing logic file in the target engineering file, searching a register corresponding to the compiling instruction according to the matched file, and compiling the matched file by using the register.
In specific implementation, the target engineering file can be compiled through a register carried on the Feiteng platform, and according to the register and the file type of the target engineering file, the corresponding command is used for compiling, and an executable binary file is obtained after the compiling is successful.
The ladder diagram program application method provided by the embodiment is applied to a Feiteng platform, and the ladder diagram program application device at least comprises an upper computer; the upper computer is used for constructing a target engineering file on the Feiteng platform based on a trapezoidal gallery, wherein the target engineering file at least comprises a trapezoidal chart, and the upper computer at least comprises the trapezoidal gallery; the ladder diagram library comprises a plurality of ladder diagrams, each ladder diagram stored in the ladder diagram library at least comprises an external variable file and a processing logic file which are stored in an associated mode, wherein the external variable file is used for storing variable information in the corresponding ladder diagram, the variable information at least comprises an input area variable and an output area variable, the input area variable and the output area variable adopt the same storage address and are stored in the same memory space, and a read-write request carries out read-write control on the input area variable or the output area variable in the same storage address according to an access address and a permission identifier; the processing logic file is used for storing the processing logic in the corresponding ladder diagram; and the upper computer at least further comprises a compiling module which is used for compiling the target engineering file according to the Feiteng platform instruction set, wherein the compiling of the target engineering file at least comprises matching of the ladder diagram external variable file and the processing logic file in the target engineering file, searching a register corresponding to the compiling instruction according to the matched file, and compiling the matched file by utilizing the register. On one hand, the ladder diagram is abstracted into a universal form of a unified and normative variable table file and a processing logic file, and ladder diagram files of different platforms are integrated on a Feiteng platform, so that free transmission and processing of the ladder diagram among multiple platforms are realized, the reusability is good, and the time cost of transplanting the ladder diagram is low; on the other hand, corresponding files are compiled according to the general file format which can be identified by each platform, the instruction set of the Feiteng platform and the corresponding registers, so that PLC programming on the Feiteng platform through a ladder diagram is realized.
The implementation process of the functions and roles of each unit in the above device is specifically shown in the implementation process of the corresponding steps in the above method, and will not be described herein again.
For the device embodiments, reference is made to the description of the method embodiments for the relevant points, since they essentially correspond to the method embodiments. The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purposes of the present application. Those of ordinary skill in the art will understand and implement the present application without undue burden.
The foregoing description of the preferred embodiments of the application is not intended to be limiting, but rather to enable any modification, equivalent replacement, improvement or the like to be made within the spirit and principles of the application.

Claims (10)

1. The ladder diagram program application device is characterized by being applied to a Feiteng platform and at least comprising an upper computer; wherein,
The upper computer is used for constructing a target engineering file on the Feiteng platform based on a ladder diagram library, wherein the target engineering file at least comprises one ladder diagram, and the upper computer at least comprises the ladder diagram library;
The ladder diagram library comprises a plurality of ladder diagrams, each ladder diagram stored in the ladder diagram library at least comprises an external variable file and a processing logic file which are stored in an associated mode, wherein the external variable file is used for storing variable information in the corresponding ladder diagram, the variable information at least comprises an input area variable and an output area variable, the input area variable and the output area variable adopt the same storage address and are stored in the same memory space, and a read-write request carries out read-write control on the input area variable or the output area variable in the same storage address according to an access address and a permission identifier;
the processing logic file is used for storing the processing logic in the corresponding ladder diagram;
And the upper computer at least further comprises a compiling module which is used for compiling the target engineering file according to the Feiteng platform instruction set, wherein the compiling of the target engineering file at least comprises matching of the ladder diagram external variable file and the processing logic file in the target engineering file, searching a register corresponding to the compiling instruction according to the matched file, and compiling the matched file by utilizing the register.
2. The apparatus of claim 1, wherein the device comprises a plurality of sensors,
The input area variable is provided with a first identifier, the output area variable is provided with a second identifier, and the read-write request at least comprises an access address and a permission identifier;
the read-write request carries out read-write control on the input area variable or the output area variable in the same storage address according to the access address and the authority identification, and specifically comprises the following steps:
Determining a target memory area according to the access address;
matching the rights identification with the first identifier and the second identifier;
if the authority identification is matched with the first identifier, performing read-write control on the input area variable;
and if the authority identification is matched with the second identifier, performing read-write control on the output area variable.
3. The apparatus of claim 1, wherein the read-write request performs read-write control on the input area variable or the output area variable in the same storage address according to an access address and a permission identifier, and specifically includes:
if the read-write request is a read request, reading the input area variable or the output area variable in the content space corresponding to the access address;
If the read-write request is a write request, the read-write request at least further includes written variable information, and the input area variable or the output area variable in the content space corresponding to the access address is replaced by the variable information written in the read-write request.
4. The apparatus of claim 1, wherein each ladder diagram is a functional module, one functional module includes one or more components, and the processing logic is one or more data processing functions in the ladder diagram;
the processing logic file is used for storing processing logic in a corresponding ladder diagram, and specifically comprises the following steps:
Tracking input and output data of each component in the ladder diagram to form a data processing process;
Determining data processing functions for realizing corresponding functions according to data processing processes, wherein each data processing process corresponds to one or more data processing functions;
And determining the arrangement sequence of the data processing functions according to the logic sequence of the data processing process to form a processing logic file.
5. The device of claim 1, wherein the upper computer further comprises an adaptation module and a plurality of application interfaces, and each application interface has a different ladder diagram file format and a different stored file;
The adaptation module is used for identifying the file format of the external input ladder diagram, matching the corresponding target application interface based on the file format of the external input ladder diagram, extracting variable information and a logic processing process from the stored file based on the target application interface, forming an external variable file and a processing logic file corresponding to the external input ladder diagram, and identifying and storing the external input ladder diagram.
6. The device according to claim 5, characterized in that said identifying and storing of a ladder diagram of said external input, in particular comprises:
The target application interface extracts the input variable information and the output variable information of the outside input ladder diagram, respectively creates a third identifier of the input variable information and a fourth identifier of the output variable information, allocates a storage address for the outside variable file, and stores the input variable information and the third identifier of the outside input ladder diagram, the output variable information and the fourth identifier of the outside input ladder diagram to the allocated storage address to form the outside variable file;
According to the data processing process of the outside input ladder diagram, matching data processing functions realizing corresponding functions, and forming a processing logic file according to the matched data processing functions;
And storing an external variable file and a processing logic file corresponding to the externally input ladder diagram so as to store the externally input ladder diagram.
7. The apparatus of claim 1, wherein each ladder diagram stored in the ladder diagram library includes at least an associated stored external variable file and a processing logic file, specifically comprising:
The external variable file corresponding to each ladder diagram in the ladder diagram library at least comprises variable information, and the variable information at least comprises names, types, values and attributes of variables;
storing variable information in a variable table form to form an external variable file corresponding to the ladder diagram;
For each ladder diagram in the ladder diagram library, matching data processing functions with corresponding functions according to the data processing process, forming processing logic according to the matched data processing functions, and storing the extracted processing logic in the form of engineering files;
And associating the external variable file with the engineering file.
8. The device of claim 1, wherein the upper computer further comprises a writing module, a detection module and a downloading module; wherein,
The compiling module is used for constructing a target engineering file by utilizing a ladder diagram library in response to the selection of a user, and is connected with the compiling module;
The detection module is used for simulating the running process and the result of the built target engineering file so as to detect the correctness of the program, and is connected with the lower loading module;
and the downloading module is used for importing the executable binary file obtained by compiling the target engineering file into the actual PLC equipment so as to correct the program in real time.
9. The apparatus of claim 1, wherein the ladder program application apparatus further comprises a lower computer for receiving and processing an executable binary file obtained by compiling the target engineering file by the upper computer on the PLC device; the lower computer comprises an execution module, a debugging module and an upper loading module; wherein,
The execution module is used for receiving and analyzing the executable binary file;
The debugging module is used for simulating the running process of the binary file in the PLC equipment and ensuring the accuracy of program running;
And the uploading module is used for uploading the binary files exported from the PLC equipment to the upper computer again so as to rewrite and compile the binary files.
10. A ladder program application method, wherein the ladder program application method is applied to a flying platform, the method comprising:
Constructing a target engineering file on the Feiteng platform based on a trapezoidal graph library, wherein the target engineering file at least comprises one trapezoidal graph, and the upper computer at least comprises the trapezoidal graph library;
The ladder diagram library comprises a plurality of ladder diagrams, each ladder diagram stored in the ladder diagram library at least comprises an external variable file and a processing logic file which are stored in an associated mode, wherein the external variable file is used for storing variable information in the corresponding ladder diagram, the variable information at least comprises an input area variable and an output area variable, the input area variable and the output area variable adopt the same storage address and are stored in the same memory space, and a read-write request carries out read-write control on the input area variable or the output area variable in the same storage address according to an access address and a permission identifier; the processing logic file is used for storing the processing logic in the corresponding ladder diagram;
And matching the ladder diagram external variable file and the processing logic file in the target engineering file, searching a register corresponding to the compiling instruction according to the matched file, and compiling the matched file by using the register.
CN202410087426.9A 2024-01-22 2024-01-22 Ladder diagram program application device and method Pending CN117908462A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410087426.9A CN117908462A (en) 2024-01-22 2024-01-22 Ladder diagram program application device and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410087426.9A CN117908462A (en) 2024-01-22 2024-01-22 Ladder diagram program application device and method

Publications (1)

Publication Number Publication Date
CN117908462A true CN117908462A (en) 2024-04-19

Family

ID=90696569

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410087426.9A Pending CN117908462A (en) 2024-01-22 2024-01-22 Ladder diagram program application device and method

Country Status (1)

Country Link
CN (1) CN117908462A (en)

Similar Documents

Publication Publication Date Title
US6496922B1 (en) Method and apparatus for multiplatform stateless instruction set architecture (ISA) using ISA tags on-the-fly instruction translation
US11249758B2 (en) Conditional branch frame barrier
US20200293335A1 (en) Container-based language runtime loading an isolated method
CN102591696A (en) Method and system for extracting behavioral data of mobile phone software
CN106775867B (en) Flight simulation system under Windows operating system environment
EP2706459B1 (en) Apparatus and method for validating a compiler for a reconfigurable processor
WO2013002979A2 (en) Debugging in a multiple address space environment
CN100511135C (en) Unit test system and method thereof
WO2012092211A2 (en) Emulating pointers
CN101196848B (en) Method for acquiring operation log
US7516061B1 (en) Method and system for using stored data items in native data formats in emulated e-mode programs
CN111176663B (en) Data processing method, device, equipment and storage medium of application program
EP2972880B1 (en) Kernel functionality checker
CN117908462A (en) Ladder diagram program application device and method
CN112052040A (en) Processing method, processing device, computer equipment and storage medium
CN110990252B (en) Testing method for testing quality and efficiency of embedded flight control software
CN102750167A (en) Method and device for starting application program and computer system
CN113050981A (en) Code on-line automatic publishing method, server and storage medium
CN111461314A (en) Method and device for calculating neural network, board card and computer readable storage medium
CN116578413B (en) Signal-level simulation model clouding method based on cloud+end architecture
CN101615209B (en) Processor verification method based on internal memory monitoring
Wan et al. Research on embedded file management system based on Forth virtual machine
Coplien Supporting Truly Object-Oriented Debugging of C++ Programs.
CN114281749A (en) Apparatus, method and storage medium for implementing serialization and deserialization tree data
CN117075902A (en) Tensor-based compiling method, tensor-based compiling device and computer-readable storage medium for tensor-based compiling device

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