KR101398718B1 - Apparatus and method for processing data - Google Patents

Apparatus and method for processing data Download PDF

Info

Publication number
KR101398718B1
KR101398718B1 KR1020120070641A KR20120070641A KR101398718B1 KR 101398718 B1 KR101398718 B1 KR 101398718B1 KR 1020120070641 A KR1020120070641 A KR 1020120070641A KR 20120070641 A KR20120070641 A KR 20120070641A KR 101398718 B1 KR101398718 B1 KR 101398718B1
Authority
KR
South Korea
Prior art keywords
command
processing function
instruction
plc
address
Prior art date
Application number
KR1020120070641A
Other languages
Korean (ko)
Other versions
KR20140003084A (en
Inventor
박창우
Original Assignee
엘에스산전 주식회사
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 엘에스산전 주식회사 filed Critical 엘에스산전 주식회사
Priority to KR1020120070641A priority Critical patent/KR101398718B1/en
Publication of KR20140003084A publication Critical patent/KR20140003084A/en
Application granted granted Critical
Publication of KR101398718B1 publication Critical patent/KR101398718B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/05Programmable logic controllers, e.g. simulating logic interconnections of signals according to ladder diagrams or function charts
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Programmable Controllers (AREA)

Abstract

본 발명은 PLC 상에서 프로그램을 실행시키기 위한 명령어를 처리하는 장치 및 방법에 관한 것이다.
본 발명은 PLC에서 구동 가능한 형식의 명령어 및 명령어 처리 함수 주소를 수신하는 수신부, 상기 명령어 각각에 대응하여 명령어 처리 함수의 주소 및 명령어 처리 함수의 크기를 저장하는 저장부; 및 상기 저장부에 저장된 명령어 처리 함수 주소를 기초하여 명령어 처리 함수를 검색하고, 검색된 명령어 처리 함수를 실행하는 제어부를 포함하고, 상기 수신부는 상기 명령어가 수정된 경우 상기 수정된 명령어 및 상기 수정된 명령어에 대응하는 명령어 처리 함수의 주소를 더 수신한다.
The present invention relates to an apparatus and method for processing instructions for executing a program on a PLC.
The present invention relates to a PLC comprising: a receiving unit for receiving an instruction word and a command processing function address in a form executable in a PLC; a storing unit for storing the address of the instruction processing function and the size of the instruction processing function corresponding to each of the instructions; And a control unit for searching for a command processing function based on the command processing function address stored in the storage unit and for executing the retrieved command processing function, wherein the receiving unit stores the corrected command and the corrected command Lt; RTI ID = 0.0 > address < / RTI >

Description

명령어 처리 장치 및 방법{APPARATUS AND METHOD FOR PROCESSING DATA}[0001] APPARATUS AND METHOD FOR PROCESSING DATA [0002]

본 발명은 PLC 상에서 프로그램을 실행시키기 위한 명령어를 처리하는 장치 및 방법에 관한 것이다.The present invention relates to an apparatus and method for processing instructions for executing a program on a PLC.

산업 현장의 자동화 설비는 릴레이 등을 사용한 기계적인 장비로 구성된다. 기계적인 장비로 구성된 자동화 설비를 변경하기 위해서는 설비의 내부 회로 배선을 변경하여야 하는 어려움이 있다. 이와 같은 어려움을 극복하기 위하여 PLC(Programmable Logic Controller)를 이용한다.The automation equipment of the industrial site consists of mechanical equipment using relays and so on. It is difficult to change the internal circuit wiring of the equipment in order to change the automatic equipment constituted by the mechanical equipment. In order to overcome such difficulties, PLC (Programmable Logic Controller) is used.

사용자가 복수의 명령어를 포함하는 프로그램을 작성하면, PLC는 사용자 작성 프로그램을 구동시키기 위하여 각각의 명령어를 처리하는 명령어 처리 함수를 실행시킨다. 다만, 사용자가 PADT(Programming And Debugging Tool)를 이용하여 작성한 프로그램은 고급 언어 형식인 반면, PLC 상에서 작동되는 프로그램은 기계어 형식이다. 따라서, 사용자 작성 프로그램은 PLC 상에서 구동되기 위하여 기계어로 번역되어야 한다.When the user creates a program including a plurality of commands, the PLC executes a command processing function for processing each command to drive the user-written program. However, the program created by the user using the Programming And Debugging Tool (PADT) is in the high-level language format, while the program operated on the PLC is in the machine language format. Therefore, a user-written program must be translated into machine language to run on the PLC.

사용자는 프로그램을 작성한 후, PLC 상에서 구동시키기 위하여 PADT를 이용하여 프로그램을 컴파일(Complie)할 수 있다. 이때, 사용자 작성 프로그램에 포함된 명령어가 PADT 상에서 컴파일되는 방법에 따라서, 명령어 처리 속도 또는 명령어 수정 용이성에 차이가 있다.After creating the program, the user can compile the program using the PADT to start it on the PLC. At this time, there is a difference in the speed of command processing or easiness of command modification according to the way in which the commands included in the user-written program are compiled on the PADT.

본 발명은 PLC 명령어를 보다 빠르게 변환할 수 있는 명령어 변환 장치 및 방법을 제공한다.The present invention provides a command conversion apparatus and method that can convert PLC commands faster.

또한, 본 발명은 변환의 대상이 되는 명령어를 용이하게 다른 명령어로 수정할 수 있는 명령어 변환 장치 및 방법을 제공한다.In addition, the present invention provides a command conversion apparatus and method that can easily modify a command to be converted by another command.

또한, 본 발명은 PLC에 입력되는 프로그램의 용량을 감소시켜 보다 효율적인 명령어 처리 장치 및 방법을 제공한다.In addition, the present invention provides a more efficient apparatus and method for processing a command by reducing the capacity of a program input to a PLC.

본 발명의 일 실시 예에 따른 명령어 처리 장치는 본 발명은 PLC에서 구동 가능한 형식의 명령어 및 명령어 처리 함수 주소를 수신하는 수신부, 상기 명령어 각각에 대응하여 명령어 처리 함수의 주소 및 명령어 처리 함수의 크기를 저장하는 저장부; 및 상기 저장부에 저장된 명령어 처리 함수 주소를 기초하여 명령어 처리 함수를 검색하고, 검색된 명령어 처리 함수를 실행하는 제어부를 포함하고, 상기 수신부는 상기 명령어가 수정된 경우 상기 수정된 명령어 및 상기 수정된 명령어에 대응하는 명령어 처리 함수의 주소를 더 수신한다..The apparatus for processing an instruction according to an embodiment of the present invention includes a receiving unit for receiving an instruction word and a command processing function address in a format that can be driven by a PLC, a memory for storing the address of the instruction word processing function and the size of the instruction word processing function, A storage unit for storing the data; And a control unit for searching for a command processing function based on the command processing function address stored in the storage unit and for executing the retrieved command processing function, wherein the receiving unit stores the corrected command and the corrected command Lt; RTI ID = 0.0 > address < / RTI >

삭제delete

본 발명에 따르면, PLC 명령어를 보다 빠르게 변환할 수 있다.According to the present invention, PLC commands can be converted more quickly.

또한, 본 발명에 따르면, 변환의 대상이 되는 명령어를 용이하게 다른 명령어로 수정할 수 있다.Further, according to the present invention, a command to be converted can easily be modified by another command.

또한, 본 발명에 따르면, PLC에 입력되는 프로그램의 용량을 감소시켜 보다 효율적으로 명령어를 처리할 수 있다.In addition, according to the present invention, the capacity of a program input to the PLC can be reduced, and the command can be processed more efficiently.

도 1은 사용자 작성 프로그램의 명령어 코드와 PLC에서 실행 가능한 개발자 작성 명령어 처리 함수 코드를 설명하기 위한 도면이다.
도 2는 본 발명의 실시 예에 따라, 사용자가 작성한 명령어 코드를 PLC에서 구동 가능한 코드로 변환하는 과정을 설명하기 위한 도면이다.
도 3은 본 발명의 실시 예에 따른 명령어 변환 장치와 명령어 처리 장치의 블록 구성도이다.
도 4는 본 발명의 일 실시 예에 따른 명령어 변환 방법을 설명하기 위한 흐름도이다.
도 5는 본 발명의 다른 실시 예에 따른 명령어 변환 방법을 설명하기 위한 흐름도이다.
도 6은 본 발명의 일 실시 예에 따른 명령어 처리 방법을 설명하기 위한 도면이다.
1 is a diagram for explaining a command code of a user-created program and a developer-created command processing function code executable in the PLC.
2 is a diagram for explaining a process of converting a command code generated by a user into a code that can be executed in a PLC according to an embodiment of the present invention.
3 is a block diagram of a command conversion apparatus and a command processing apparatus according to an embodiment of the present invention.
4 is a flowchart illustrating a method of converting an instruction according to an exemplary embodiment of the present invention.
5 is a flowchart for explaining a command conversion method according to another embodiment of the present invention.
6 is a diagram for explaining a command processing method according to an embodiment of the present invention.

이하 도면을 참조하여 본 발명의 실시 예를 상세히 설명한다.
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.

도 1은 사용자 작성 프로그램의 명령어 코드와 PLC에서 실행 가능한 개발자 작성 명령어 처리 함수 코드를 설명하기 위한 도면이다.1 is a diagram for explaining a command code of a user-created program and a developer-created command processing function code executable in the PLC.

도 1을 참조하면, 사용자는 PADT 프로그램을 이용하여 프로그램을 작성할 수 있다. 사용자가 작성한 프로그램은 복수의 명령어(100)를 포함할 수 있다. 예컨대, 사용자 작성 프로그램은 MOVE 명령어(101)를 포함할 수 있다. 이때, MOVE 명령어(101)의 인에이블부(103)가 활성화되면, 입력부(105)에 입력된 명령어의 이동 결과가 출력부(107)에서 출력될 수 있도록 MOVE 명령어(101)를 작성할 수 있다. 사용자가 작성한 명령어(100)는 고급 언어로 작성되기 때문에, PLC 상에서 동작하기 위하여 기계어로 번역되어야 한다.Referring to FIG. 1, a user can create a program using a PADT program. The program created by the user may include a plurality of commands 100. [ For example, the user-created program may include a MOVE command 101. At this time, when the enable unit 103 of the MOVE command 101 is activated, the MOVE command 101 can be created so that the result of the movement of the command inputted to the input unit 105 can be output from the output unit 107. [ Since the user-written command 100 is written in a high-level language, it must be translated into machine language in order to operate on the PLC.

한편, 고급 언어로 작성된 명령어에 대응하는 기계어 형식의 명령어 처리 함수는 테이블 형식으로 저장된다. 개발자가 어셈블리어(Assembly Language)를 이용하여 명령어를 처리하는 명령어 처리 함수(111) 예컨대, void move(void)를 작성하면, 사용자 작성 명령어와 마찬가지로 개발자 작성 명령어 처리 함수(111) 역시, PLC 상에서 동작하기 위하여 기계어로 번역되어야 한다. 이를 위하여, 개발자가 작성한 명령어 처리 함수(111)는 컴파일러(113)에서 컴파일되어 바이너리(Binary) 형식의 Bin 파일로 저장될 수 있다. 개발자가 작성한 명령어 처리 함수(111)를 소스 코드라 하고, 이에 대응되어 기계어로 컴파일된 Bin 파일을 오브젝트 파일(115)이라 한다. 오브젝트 파일(115)은 복수의 명령어 처리 함수가 포함된 것으로, 명령어 처리 함수의 시작 주소와 명령어 처리 함수의 크기가 테이블로 저장된다. 복수의 명령어에 대응하여 이를 처리하는 함수가 포함된 오브젝트 파일(115) 테이블은 PADT의 내부 메모리에 저장될 수 있고, 외부 메모리에 저장될 수도 있다. 컴파일러(113)는 MPU(Micro Processor Unit) 전용 컴파일러가 사용될 수 있고, C언어 또는 C++언어 컴파일러가 활용될 수 있다.
On the other hand, a command processing function in a machine language format corresponding to an instruction written in a high-level language is stored in a table format. When the developer creates an instruction processing function 111, for example, void move (void) for processing an instruction using an assembly language (Assembly Language), the developer-created instruction processing function 111, like the user-created instruction, Must be translated into machine language. To this end, the command processing function 111 created by the developer can be compiled by the compiler 113 and stored as a bin file in a binary format. The command processing function 111 created by the developer is referred to as source code, and the bin file corresponding to the command processing function 111 is called an object file 115. The object file 115 includes a plurality of command processing functions. The start address of the command processing function and the size of the command processing function are stored in a table. The object file 115 table including functions for processing a plurality of commands may be stored in the internal memory of the PADT and may be stored in the external memory. The compiler 113 may be an MPU (Micro Processor Unit) specific compiler, and a C language or C ++ language compiler may be used.

도 2는 본 발명의 실시 예에 따라, 사용자가 작성한 명령어 코드를 PLC에서 구동 가능한 코드로 변환하는 과정을 설명하기 위한 도면이다.2 is a diagram for explaining a process of converting a command code generated by a user into a code that can be executed in a PLC according to an embodiment of the present invention.

도 2를 참조하면, 사용자는 PADT를 이용하여 복수의 명령어가 포함된 프로그램을 작성할 수 있다(201). 예컨대, 사용자는 MOVE 명령어(211)를 작성할 수 있다. PADT는 사용자 작성 명령어(201)를 컴파일러 영역(203)에서 컴파일할 수 있다. 이때, 컴파일 대상이 되는 명령어를 확인한 후(213), PADT 내부 또는 외부 메모리에 저장된 명령어 처리 함수의 오브젝트 파일 자체를 복사한 후, 명령어에 대응시켜 컴파일할 수도 있다. 다만 이와 같은 경우, 명령어를 호출하면, 명령어에 대응되는 명령어 처리 함수의 주소를 확인하고, 명령어 처리 함수의 주소를 검색하여 명령어 처리 함수를 복사한 후, 복사된 명령어 처리 함수를 컴파일 영역에 삽입하는 과정을 거쳐 컴파일이 완료되기 때문에, 변환에 걸리는 시간이 길다. 그리고, 명령어를 다른 명령어로 수정하고자 하는 경우, 앞서 설명한 모든 과정을 반복하여야 하기 때문에 변환에 걸리는 시간이 길어지기 때문에, 수정이 비용이하다. 또한, 명령어 처리 함수의 명령어 전체를 삽입하기 때문에, 컴파일 영역 및 PLC에서 수신하는 프로그램의 용량이 커진다.Referring to FIG. 2, a user can create a program including a plurality of commands using PADT (201). For example, the user can create the MOVE command 211. [ The PADT can compile the user creation command 201 in the compiler area 203. At this time, after confirming the command to be compiled (213), the object file itself of the command processing function stored in the PADT or the external memory may be copied and compiled in correspondence with the command. In this case, when the instruction is called, the address of the instruction processing function corresponding to the instruction is checked, the address of the instruction processing function is searched, the instruction processing function is copied, and the copied instruction processing function is inserted into the compilation area Since the compilation is completed through the process, the conversion takes a long time. In addition, if the command is to be modified by another command, the above-described procedure must be repeated. In addition, since the entire instruction of the instruction processing function is inserted, the capacity of the compile area and the program received by the PLC becomes larger.

따라서 효율적인 명령어 변환을 위하여, PADT 컴파일러(203)는 컴파일 영역에서 명령어를 호출한 후, 예컨대, MOVE 명령어가 확인(213)되면, MOVE 명령어에 대응되는 명령어 처리 함수의 주소를 확인할 수 있다(215). 명령어 처리 함수의 주소란, 명령어 처리 함수가 저장된 메모리 내에서의 저장 주소를 의미한다.Accordingly, the PADT compiler 203 calls the instruction in the compilation area, and when the MOVE instruction is confirmed 213, the address of the instruction processing function corresponding to the MOVE instruction can be confirmed 215 for efficient instruction translation. . The address of a command processing function means a storage address in the memory where the command processing function is stored.

이어서, PADT 컴파일러(203)는 복수의 명령어(213) 및 이에 대응하는 복수의 명령어 처리 함수 주소(215)를 컴파일하여, PLC 상에서 동작할 수 있는 형식인 PLC 구동 파일(205)을 출력할 수 있다.The PADT compiler 203 then compiles a plurality of instructions 213 and a plurality of instruction processing function addresses 215 corresponding thereto to output a PLC driving file 205 that is a type that can operate on the PLC .

복수의 명령어 처리 함수는 PLC 내부의 메모리(227) 예컨대, PLC 내부 ROM(Read Only Memory)에 테이블 형식으로 저장될 수 있다(227). PLC가 명령어 및 명령어 처리 함수 주소를 수신한 후, 프로그램을 동작시키면서 명령어를 확인하고, 이에 대응하여 PLC 내부의 메모리에 저장된 명령어 처리 함수의 주소를 검색하면, 명령어 처리 함수 전체를 직접 수신하지 않고도 용이하게 명령어를 처리할 수 있다.
The plurality of command processing functions may be stored in a memory 227 in the PLC, for example, in a PLC internal ROM (Read Only Memory) in a table format (227). After the PLC receives the instruction and the instruction processing function address, it confirms the instruction while operating the program, and if it finds the address of the instruction processing function stored in the memory inside the PLC, the instruction processing function can be easily You can process the command.

도 3은 본 발명의 실시 예에 따른 명령어 변환 장치와 명령어 처리 장치의 블록 구성도이다.3 is a block diagram of a command conversion apparatus and a command processing apparatus according to an embodiment of the present invention.

도 3을 참조하면, 명령어 변환 장치(300)는 수신부(301), 판단부(303), 코드 변경부(305), 송신부(307)를 포함한다.3, the command conversion apparatus 300 includes a receiving unit 301, a determining unit 303, a code changing unit 305, and a transmitting unit 307. [

수신부(301)는 명령어(311), 명령어 처리 함수 주소(313)를 수신할 수 있다. 사용자가 프로그램을 작성한 후, PADT 컴파일러(203)가 사용자 작성 프로그램을 컴파일하면서 프로그램에 포함된 명령어를 확인할 수 있다. 이때, 수신부(301)는 확인된 명령어(311) 및 명령어에 대응되는 명령어 처리 함수의 주소(313)를 수신할 수 있다.The receiving unit 301 can receive an instruction 311 and an instruction processing function address 313. [ After the user creates the program, the PADT compiler 203 can confirm the command included in the program while compiling the user-written program. At this time, the receiving unit 301 may receive the confirmed command 311 and the address 313 of the command processing function corresponding to the command.

판단부(303)는 사용자가 수신부(301)가 수신한 명령어가 아닌 다른 명령어를 프로그램에 포함시키고자 하는 경우, 수신부(301)가 수신한 명령어(311)의 수정 여부를 판단할 수 있다. 본 발명의 일 실시 예에 따르면, 명령어(311)의 수정 여부를 판단하기 위하여, PADT는 사용자에게 프로그램 작성시 프로그램에 포함되는 명령어(311)에 변수를 할당하는 기능을 제공할 수 있다. 예컨대, 사용자가 변수에 1을 할당한 경우에 PADT는 명령어(311)를 수정하여야 하고, 사용자가 변수에 0을 할당한 경우에 PADT는 명령어(311)를 수정하지 않고 수신한 명령어(311)를 컴파일할 수 있다. 따라서 수신부(301)가 명령어(311)를 수신하면, 판단부(303)는 명령어에 할당된 변수를 확인하여, 변수에 따라 명령어 수정 여부를 판단할 수 있다. 판단부(303)가 명령어를 수정하는 것으로 판단하는 경우, 수신부(301)는 수정된 명령어 및 수정된 명령어를 처리하는 명령어 처리 함수의 주소를 수신할 수 있으며, PADT 컴파일러(203)는 수정된 명령어 및 수정된 명령어 처리 함수 주소를 컴파일할 수 있다.The determination unit 303 may determine whether the command 311 received by the reception unit 301 is to be modified if the user wants to include a command other than the command received by the reception unit 301 in the program. According to an embodiment of the present invention, in order to determine whether or not the instruction 311 is modified, the PADT may provide the user with a function of assigning a variable to the instruction 311 included in the program when the program is created. For example, if the user assigns a variable of 1, the PADT must modify the instruction 311, and if the user assigns a 0 to the variable, the PADT does not modify the received instruction 311 You can compile it. Accordingly, when the receiving unit 301 receives the instruction 311, the determining unit 303 can check the variable assigned to the instruction word and determine whether or not to modify the instruction according to the variable. If the determination unit 303 determines that the command is to be modified, the receiving unit 301 may receive the address of the command processing function that processes the modified command and the modified command, and the PADT compiler 203 may receive the modified command And a modified instruction processing function address.

코드 변경부(305)는 수신부(301)가 수신한 명령어(311) 및 명령어 처리 함수 주소(313)의 형식을 PLC에서 구동 가능한 형식으로 변경할 수 있다.The code changing unit 305 can change the format of the command word 311 and the command processing function address 313 received by the receiving unit 301 to a format that can be driven by the PLC.

송신부(307)는 코드 변경부(305)에서 PLC 구동 가능한 형식으로 변경된 명령어 및 명령어 처리 함수 주소를 명령어 처리 장치(320)로 송신할 수 있다.
The transmission unit 307 can transmit the command and the command processing function address changed to the PLC-drivable format to the command processing unit 320 in the code changing unit 305. [

이어서, 명령어 처리 장치(320)는 수신부(321), 저장부(323), 제어부(325)를 포함할 수 있다.The command processing unit 320 may include a receiving unit 321, a storage unit 323, and a control unit 325.

수신부(321)는 명령어 변환 장치(300)의 송신부(307)로부터 송신된, PLC에서 구동 가능한 형식의 명령어 및 명령어 처리 함수의 주소를 수신할 수 있다. 수신부(321)가 명령어 및 명령어 처리 함수 전체를 수신하는 경우에 비하여, 명령어 및 명령어 처리 함수 주소를 수신하는 경우에 수신하는 프로그램의 용량이 적기 때문에, PLC 내에서 수신한 프로그램이 차지하는 용량이 적어지고 효율이 높아질 수 있다.The receiving unit 321 can receive an address of a command and a command processing function in a format that can be executed in the PLC, transmitted from the transmitting unit 307 of the command conversion apparatus 300. Compared with the case where the receiving unit 321 receives the entire command and the command processing function, when the command and the command processing function address are received, the capacity of the receiving program is small and the capacity occupied by the program received in the PLC is small The efficiency can be increased.

저장부(323)는 명령어 처리 함수를 저장할 수 있다. 명령어 처리 함수는 처리 대상이 되는 명령어에 대응되어, 테이블 형식으로 저장된다. 즉, 복수의 명령어 각각에 대응하여, 명령어 처리 함수의 주소 및 명령어 처리 함수의 크기가 저장된다. 저장부(323)는 PLC를 구성하는 내부 메모리가 될 수 있다.The storage unit 323 may store a command processing function. A command processing function is stored in a table format in correspondence with an instruction word to be processed. That is, the address of the instruction processing function and the size of the instruction processing function are stored corresponding to each of the plurality of instructions. The storage unit 323 may be an internal memory constituting the PLC.

제어부(325)는 명령어 처리 함수 주소를 이용하여, 저장부(323)에서 명령어 처리 함수를 검색하고, 명령어 처리 함수를 실행할 수 있다. 제어부(325)는 명령어 처리 함수를 실행함으로써, 명령어를 처리할 수 있다.
The control unit 325 can search for a command processing function in the storage unit 323 and execute a command processing function using the command processing function address. The control unit 325 can process the command by executing the command processing function.

도 4는 본 발명의 일 실시 예에 따른 명령어 변환 방법을 설명하기 위한 흐름도이다.4 is a flowchart illustrating a method of converting an instruction according to an exemplary embodiment of the present invention.

도 4를 참조하면, PADT 컴파일러(203)는 사용자 작성 프로그램을 컴파일하기 위하여, 사용자 작성 프로그램에 포함된 명령어를 확인한다(401).Referring to FIG. 4, the PADT compiler 203 confirms a command included in the user creation program to compile the user creation program (401).

이어서, PADT 컴파일러(203)는 확인된 명령어에 대응하는 명령어 처리 함수의 주소를 PLC 내부 메모리에서 확인한다(403).Then, the PADT compiler 203 confirms the address of the instruction processing function corresponding to the confirmed instruction in the PLC internal memory (403).

PADT 컴파일러(203)는 확인된 명령어 및 명령어 처리 함수 주소를 함께 컴파일하여 변환을 완료한다(405).The PADT compiler 203 compiles the confirmed instruction and the instruction processing function address together to complete the conversion (405).

이어서, PADT 컴파일러(203)는 컴파일된 명령어 및 명령어 처리 함수 주소를 PLC로 다운로드한다(407).
Then, the PADT compiler 203 downloads the compiled instruction and instruction processing function address to the PLC (407).

도 5는 본 발명의 다른 실시 예에 따른 명령어 변환 방법을 설명하기 위한 흐름도이다.5 is a flowchart for explaining a command conversion method according to another embodiment of the present invention.

도 5를 참조하면, PADT 컴파일러(203)는 사용자 작성 프로그램에 포함된 명령어를 확인한다(501).Referring to FIG. 5, the PADT compiler 203 confirms a command included in the user creation program (501).

이어서, PADT 컴파일러(203)는 사용자가 변환하고자 하는 명령어를 도면 부호 501 단계에서 확인한 명령어가 아닌 다른 명령어로 수정하고자 하는지 판단한다(503). PADT 컴파일러(203)가 명령어를 수정하지 않고, 도면 부호 501 단계에서 확인한 명령어를 컴파일하는 것으로 판단하는 경우, 도 4에서 설명한 실시 예와 동일한 방법으로 명령어에 대응하는 명령어 처리 함수 주소를 PLC 내부 메모리에서 확인(505)하여, 함께 컴파일하여 변환을 완료한다(511).Next, the PADT compiler 203 determines whether the user desires to change the command to be converted to a command other than the command identified in step 501 (503). If the PADT compiler 203 does not modify the instruction and determines that the instruction identified in step 501 is to be compiled, the address of the instruction processing function corresponding to the instruction in the same manner as in the embodiment described in FIG. 4 is stored in the PLC internal memory (505), compiles them together, and completes the conversion (511).

반면에 PADT 컴파일러(203)가 명령어를 수정한 경우, 수정된 명령어를 확인한다(507). 이어서, 본 발명의 일 실시 예에 의하면, PADT 컴파일러(203)는 수정된 명령어에 대응하는 명령어 처리 함수 주소를 확인하여, 수정된 명령어 및 수정된 명령어 처리 함수를 함께 컴파일하는 방식으로 변환을 완료할 수 있다. 본 발명의 다른 실시 예에 의하면, PADT 컴파일러(203)는 수정된 명령어를 확인한 후(507), 수정된 명령어에 대응하는 명령어 처리 함수 전체를 명령어 처리 함수 저장부에서 복사하여, 컴파일 영역에 삽입할 수 있다(509). 이와 같이, 본 발명인 명령어 변환 장치 및 방법은 일 실시 예에 한정되는 것을 아니다.On the other hand, if the PADT compiler 203 has modified the instruction, the modified instruction is confirmed (507). Then, according to one embodiment of the present invention, the PADT compiler 203 confirms the address of the instruction processing function corresponding to the modified instruction, and completes the conversion in such a manner that the modified instruction and the modified instruction processing function are compiled together . According to another embodiment of the present invention, the PADT compiler 203 checks the corrected instruction word (507), and then copies the entire instruction processing function corresponding to the modified instruction word in the instruction processing function storage unit, (509). As such, the instruction translation apparatus and method of the present invention are not limited to the embodiment.

이어서, PADT 컴파일러(203)는 컴파일이 완료(511)된 명령어 및 명령어 처리 함수 주소를 PLC로 다운로드한다(513).
Then, the PADT compiler 203 downloads the address of the instruction to be compiled (step 511) and the instruction processing function address to the PLC (513).

도 6은 본 발명의 일 실시 예에 따른 명령어 처리 방법을 설명하기 위한 도면이다.6 is a diagram for explaining a command processing method according to an embodiment of the present invention.

도 6을 참조하면, PLC의 수신부(321)는 PLC에서 구동 가능한 형식의 사용자 작성 프로그램(601)을 수신한다. PLC의 제어부(325)는 PLC의 OS 영역에서 사용자 작성 프로그램(601)을 처리하는 중, MOVE 명령어를 확인할 수 있다(603). 제어부(325)는 MOVE 명령어와 함께 수신한 MOVE 명령어 처리 함수의 주소를 확인한다(605). 예컨대, 확인된 MOVE 명령어 처리 함수의 주소는 h'A0000000이다. 이어서, 제어부(325)는 PLC의 저장부(323) 예컨대, PLC 내부 메모리(611)의 명령어 처리 함수 테이블(613)에서, MOVE 명령어 처리 함수의 주소인 h'A0000000를 검색한다. 이어서, 제어부(325)는 PLC 내부 메모리(611) 상에서 MOVE 명령어 처리 함수를 실행함으로써, MOVE 명령어를 처리할 수 있다. 제어부(325)는 MOVE 명령어를 처리한 후, 다시 OS 영역으로 복귀하여 다음 명령어를 처리할 수 있다.
Referring to FIG. 6, the receiving unit 321 of the PLC receives a user creating program 601 of a format that can be driven by the PLC. The control unit 325 of the PLC can confirm the MOVE command while processing the user creation program 601 in the OS area of the PLC (603). The control unit 325 confirms the address of the MOVE command processing function received together with the MOVE command (605). For example, the address of the confirmed MOVE instruction processing function is h'A0000000. The control unit 325 then searches for the address h'A0000000 of the MOVE command processing function in the command processing function table 613 of the PLC storage unit 323, for example, the PLC internal memory 611. [ Then, the control unit 325 can execute the MOVE instruction word processing function by executing the MOVE instruction word processing function on the PLC internal memory 611. [ After processing the MOVE command, the control unit 325 returns to the OS area and processes the next command.

이상의 설명은 본 발명의 기술 사상을 예시적으로 설명한 것에 불과한 것으로서, 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자라면 본 발명의 본질적인 특성에서 벗어나지 않는 범위에서 다양한 수정 및 변형이 가능할 것이다.The foregoing description is merely illustrative of the technical idea of the present invention, and various changes and modifications may be made by those skilled in the art without departing from the essential characteristics of the present invention.

따라서, 본 발명에 개시된 실시 예들은 본 발명의 기술 사상을 한정하기 위한 것이 아니라 설명하기 위한 것이고, 이러한 실시 예에 의하여 본 발명의 기술 사상의 범위가 한정되는 것은 아니다.Therefore, the embodiments disclosed in the present invention are intended to illustrate rather than limit the scope of the present invention, and the scope of the technical idea of the present invention is not limited by these embodiments.

300: 명령어 변환 장치 301, 321: 수신부
303: 판단부 305: 코드 변경부
307: 송신부 320: 명령어 처리 장치
323: 저장부 325: 제어부
300: command conversion device 301, 321:
303: Judgment section 305: Code change section
307: Transmitting section 320:
323: Storage unit 325:

Claims (2)

PLC에서 구동 가능한 형식의 명령어 및 명령어 처리 함수 주소를 수신하는 수신부;
상기 명령어 각각에 대응하여 명령어 처리 함수의 주소 및 명령어 처리 함수의 크기를 저장하는 저장부; 및
상기 저장부에 저장된 명령어 처리 함수 주소를 기초하여 명령어 처리 함수를 검색하고, 검색된 명령어 처리 함수를 실행하는 제어부;를 포함하고,
상기 수신부는
상기 명령어가 수정된 경우 상기 수정된 명령어 및 상기 수정된 명령어에 대응하는 명령어 처리 함수의 주소를 더 수신하는
명령어 처리 장치.
A receiving unit for receiving an instruction of a command executable in a PLC and a command processing function address;
A storage unit for storing an address of a command processing function and a size of a command processing function corresponding to each of the commands; And
And a control unit for searching the instruction processing function based on the instruction processing function address stored in the storage unit and executing the searched instruction processing function,
The receiving unit
When the instruction is modified, further receiving an address of the modified instruction and an instruction processing function corresponding to the modified instruction
Command processing device.
삭제delete
KR1020120070641A 2012-06-29 2012-06-29 Apparatus and method for processing data KR101398718B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020120070641A KR101398718B1 (en) 2012-06-29 2012-06-29 Apparatus and method for processing data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020120070641A KR101398718B1 (en) 2012-06-29 2012-06-29 Apparatus and method for processing data

Publications (2)

Publication Number Publication Date
KR20140003084A KR20140003084A (en) 2014-01-09
KR101398718B1 true KR101398718B1 (en) 2014-05-27

Family

ID=50139770

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020120070641A KR101398718B1 (en) 2012-06-29 2012-06-29 Apparatus and method for processing data

Country Status (1)

Country Link
KR (1) KR101398718B1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102063966B1 (en) * 2015-10-21 2020-01-09 엘에스산전 주식회사 Optimization method for compiling programmable logic controller command
KR102091134B1 (en) * 2018-03-30 2020-03-19 엘에스산전 주식회사 Method for Processing Branch Command in PLC
KR102250779B1 (en) * 2019-05-14 2021-05-11 단국대학교 산학협력단 Method and apparatus for verifying executable code integrity, embedded device including the same

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004178151A (en) 2002-11-26 2004-06-24 Digital Electronics Corp Display control device, program, and recording medium to which this program is recorded
JP2006107172A (en) 2004-10-06 2006-04-20 Fuji Electric Fa Components & Systems Co Ltd Programming device of programmable controller
JP2007334469A (en) 2006-06-13 2007-12-27 Hitachi Industrial Equipment Systems Co Ltd Programmable controller and equipment control method using the same
JP2011028562A (en) 2009-07-27 2011-02-10 Keyence Corp Program creation support device, program creation support method and computer program

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004178151A (en) 2002-11-26 2004-06-24 Digital Electronics Corp Display control device, program, and recording medium to which this program is recorded
JP2006107172A (en) 2004-10-06 2006-04-20 Fuji Electric Fa Components & Systems Co Ltd Programming device of programmable controller
JP2007334469A (en) 2006-06-13 2007-12-27 Hitachi Industrial Equipment Systems Co Ltd Programmable controller and equipment control method using the same
JP2011028562A (en) 2009-07-27 2011-02-10 Keyence Corp Program creation support device, program creation support method and computer program

Also Published As

Publication number Publication date
KR20140003084A (en) 2014-01-09

Similar Documents

Publication Publication Date Title
CN103814333A (en) Method and device for the programming and configuration of programmable logic controller
JP2002099312A (en) Programmable controller and control program development supporting device
JP4778286B2 (en) Compiler device
JP2007141173A (en) Compiling system, debug system and program development system
KR101398718B1 (en) Apparatus and method for processing data
JP2009146229A (en) Programmable controller system
EP3159792B1 (en) Method of optimally compiling plc command
US20150331407A1 (en) Apparatus for program management of programmable logic controller
JP5849592B2 (en) Programmable controller system, programming device thereof, programmable controller, program, and debugging method
JP2009157533A (en) Programmable controller system
JP2019016037A (en) Program creation apparatus
JP2009086898A (en) Method for compiling machine code program for programmable logic controller
KR102091134B1 (en) Method for Processing Branch Command in PLC
Mustafa et al. Portable section-level tuning of compiler parallelized applications
CN113608491B (en) Method for compiling delayed logic schematic diagram into byte code
KR20110081172A (en) Apparatus and method for controlling machine tool
JP4516046B2 (en) Programmable controller
JP5141095B2 (en) Plant controller system
JP5589670B2 (en) How to debug
JP2009064207A (en) Compiler
JP6812861B2 (en) Program creator and program
CN104461569A (en) C/C++ program generation assisting method based on MATLAB
JP2013190837A (en) Engineering tool
CN109814869B (en) Analysis method and system applied to robot and computer readable storage medium
JP2007188366A (en) Compiler

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
FPAY Annual fee payment

Payment date: 20170403

Year of fee payment: 4

FPAY Annual fee payment

Payment date: 20180502

Year of fee payment: 5

FPAY Annual fee payment

Payment date: 20190502

Year of fee payment: 6