1. Technical Field
The present disclosure relates to compiling systems and, particularly, to a programmable logic controller (PLC) compiling system and a compiling method.
2. Description of Related Art
A PLC is a digital computer used for automation of electromechanical processes, such as control of machinery for factory assembly lines, amusement rides, or lighting apparatuses. Generally speaking, system programs of the PLC are initialized before leaving factory, with final compilation of application programs for the PLC performed onsite according to need, such as integration of application programs in an existing system, and matching the application programs with other instruction sets. However, if the application programs need to be applied to varying operating systems or hardware instruction sets, code of the application programs must be preloaded with compatibility for the entire possible range of environments, a complicated and high-maintenance undertaking.
Referring to
The ladder diagram loading unit 11 loads and stores predetermined ladder diagrams, namely, programming diagrams of electrical logic schematics, for easy compiling of programs of PLCs.
The instruction set loading unit 12 includes an X86 instruction set module 122 and an advanced Reduced Instruction Set Computer (RISC) machines (ARM) instruction set module 124 The X86 instruction set module 122 stores an X86 instruction set. The ARM instruction set module 124 stores an ARM instruction set. Alternatively, the instruction set loading unit 12 can further include other instruction sets according to need.
The instruction compiling unit 13 loads the predetermined ladder diagrams, the X86 instruction set, and the ARM instruction set, and compiles the predetermined ladder diagrams to X86 instructions based on the X86 instruction set and the ladder diagrams to ARM instructions based on the ARM instruction set.
The operating system loading unit 14 includes a Windows XP (WinXP) system module 142 and a Windows CE (WinCE) system module 144. The WinXP system module 142 stores a WinXP DLL file template based on a WinXP system. The WinCE system module 144 stores a WinCE DLL file template based on a WinCE system. The two kinds of DLL file templates are used to compile DLL files based on the corresponding operating systems. Alternatively, the operating system loading unit 14 can further include other DLL file templates corresponding to other operating systems according to need.
The DLL file compiling unit 15 loads the compiled X86 instructions, the compiled ARM instructions, and the DLL file templates based on the WinXP system and the WinCE system. The DLL file compiling unit 15 also configured for compiling the X86 instructions to WinXP system DLL files based on the WinXP DLL file template to match the X86 instruction set, configured for compiling the X86 instructions to WinCE system DLL files based on the WinCE DLL file template to match the X86 instruction set, configured for compiling the ARM instructions to WinXP system DLL files based on the WinXP DLL file template to match the ARM instruction set, and compiling the ARM instructions to WinCE system DLL files based on the WinCE DLL file template to match the ARM instruction set.
Referring to
In step S1, the ladder diagram loading unit 11 loads the predetermined ladder diagrams and stores the ladder diagrams.
In step S2, the instruction compiling unit 13 loads the ladder diagrams stored in the ladder diagram loading unit 11, and loads the X86 instruction set and the ARM instruction set stored in the instruction set loading unit 12.
In step S3, the instruction compiling unit 13 compiles the ladder diagrams to X86 instructions based on the X86 instruction set.
In step S4, the instruction compiling unit 13 compiles the ladder diagrams to ARM instructions based on the ARM instruction set.
In step S5, the DLL file compiling unit 15 loads the compiled X86 instructions, the compiled ARM instructions, and the DLL file templates based on the WinXP system and the WinCE system stored in the operating system loading unit 14.
In step S6, the DLL file compiling unit 15 compiles the X86 instructions to WinXP system DLL files based on the WinXP DLL file template to match the X86 instruction set, and compiles the ARM instructions to WinXP system DLL files based on the WinXP DLL file template to match the ARM instruction set.
In step S7, the DLL file compiling unit 15 compiles the X86 instructions to WinCE system DLL files based on the WinCE DLL file template to match the X86 instruction set, and compiles the ARM instructions to WinCE system DLL files based on the WinCE DLL file template to match the ARM instruction set.
Referring to
The PLC compiling system 10 and PLC compiling method can compile many kinds of DLL files, compatible for application with a plurality of operating systems and matching many kinds of instruction sets in one compiling process.
It is to be understood, however, that even though numerous characteristics and advantages of the present disclosure have been set forth in the foregoing description, together with details of the structure and function of the disclosure, the disclosure is illustrative only, and changes may be made in detail, especially in matters of shape, size, and arrangement of parts within the principles of the disclosure to the full extent indicated by the broad general meaning of the terms in which the appended claims are expressed.
Number | Date | Country | Kind |
---|---|---|---|
200910300144.8 | Jan 2009 | CN | national |