KR910009262B1 - Method managing library of plc - Google Patents

Method managing library of plc Download PDF

Info

Publication number
KR910009262B1
KR910009262B1 KR1019890012206A KR890012206A KR910009262B1 KR 910009262 B1 KR910009262 B1 KR 910009262B1 KR 1019890012206 A KR1019890012206 A KR 1019890012206A KR 890012206 A KR890012206 A KR 890012206A KR 910009262 B1 KR910009262 B1 KR 910009262B1
Authority
KR
South Korea
Prior art keywords
library
program
user
pgc
code
Prior art date
Application number
KR1019890012206A
Other languages
Korean (ko)
Other versions
KR910005123A (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 KR1019890012206A priority Critical patent/KR910009262B1/en
Publication of KR910005123A publication Critical patent/KR910005123A/en
Application granted granted Critical
Publication of KR910009262B1 publication Critical patent/KR910009262B1/en

Links

Images

Classifications

    • 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

Landscapes

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

Abstract

The program input unit has a special function for sending the user's program and the corresponding process routine to a user's program region of a programmable controller when a pre-defined function of the program input unit is used. The method comprises steps: (A) checking a library code input; (B) processing the instruction by finding the instruction corresponding to the non library code; and (C) call a library processing unit when the input code is library code, recording the contents of input variables and address of output variables, and recording the processed result on the starting address of the user's program region.

Description

프로그래머블 컨트롤러의 라이브러리 처리방법How to handle library of programmable controller

제1도는 종래의 프로그래머블 컨트롤로 내부의 소프트웨어 영역과 사용자 프로그램영역의 구성도.1 is a configuration diagram of an internal software area and a user program area with conventional programmable controls.

제2도는 본 발명의 프로그래머블 컨트롤로 소프트웨어 영역과 사용자 프로그램영역의 구성도.2 is a configuration diagram of a software area and a user program area with programmable control of the present invention.

제3도는 종래의 명령어수행 흐름도.3 is a flowchart of a conventional instruction execution.

제4도는 본 발명의 명령어 수행 흐름도.4 is a flowchart of instruction execution of the present invention.

제5도는 본 발명의 일실시예에 따른 각종 예시도.5 is various exemplary views according to an embodiment of the present invention.

제6도는 본 발명의 시스템 구성도.6 is a system configuration diagram of the present invention.

* 도면의 주요부분에 대한 부호의 설명* Explanation of symbols for the main parts of the drawings

10, 20 : CPU 20 : 롬(소프트웨어 영역)10, 20: CPU 20: ROM (software area)

30 : 램(사용자 프로그램 영역) 40 : 디스플레이 장치30: RAM (User Program Area) 40: Display Device

60 : 보조 기억장치 70 : 프로그램 입력도구60: auxiliary storage device 70: program input tool

100 : 프로그래머블 컨트롤러 본체100: programmable controller body

본 발명은 프로그래머블 컨트롤러에 있어서, 기능변화 방법에 관한 것으로 특히 내부의 하드웨어나 소프트웨어의 변경없이 입력장치의 소프트웨어만 변경 추가하여 기능을 변화시킬 수 있는 라이브러리 처리방법에 관한 것이다.BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method of changing a function in a programmable controller, and more particularly, to a library processing method capable of changing a function by changing and adding only software of an input device without changing internal hardware or software.

종래에는 제1도와 같이 프로그래머블 컨트롤러(이하 PGC라 함) 내부의 소프트웨어에서 PGC의 모든 명령어에 대한 처리 루틴을 1:1대응으로 정의해 두어야 하기 때문에 기본적으로 많이 쓰여지는 제한된 숫자의 명령어만 수행할 수 있었다.Conventionally, since the processing routine for all instructions of the PGC has to be defined in a 1: 1 correspondence in software inside the programmable controller (hereinafter referred to as PGC) as shown in FIG. 1, only a limited number of instructions that are commonly used can be executed. there was.

그러므로 사용자가 빈번히 사용하지 않는 복잡한 연산명령등 새로은 기능을 추가하고자 할 경우에는 PGC 내부의 소프트웨어 영역에서 처리과정을 정의해야 하므로 시스템이 사용 가능한 메모리의 크기는 제한되어 있음에도 불구하고 이러한 특정한 명령어를 사용하지 않는 사용자에게도 똑같은 소프트웨어 영역을 배당해야 하고 새로운 명령어를 추가할 때 마다 소프트웨어를 교체해야 하는 불합리한 면이 있었다.Therefore, if you want to add a new function such as a complicated operation instruction that is not frequently used by the user, you need to define the processing in the software area inside the PGC, so the system does not use this specific instruction even though the amount of available memory is limited. There was also the absurdity of having to allocate the same area of software to users who did not, and to replace the software each time they added a new command.

따라서 본 발명의 목적은 보조기억장치를 갖춘 프로그램 입력도구에 특정한 기능을 정의하여 사용자가 상기 정의된 기능을 사용할 때만 사용자 프로그램과 함께 이 기능의 처리 루틴을 PGC내부의 사용자 프로그램 영역에 전달토록하여 PGC자체의 소프트웨어의 부담을 줄이고 사용자의 요구에 따른 기능에 추가를 용이하게 하는 라이브러리 처리방법을 제공함에 있다.Accordingly, an object of the present invention is to define a specific function in a program input tool having an auxiliary memory device so that the user can only use the defined function and deliver the processing routine of this function to the user program area inside the PGC together with the user program. The present invention provides a library processing method that reduces the burden of software itself and facilitates the addition of a function according to a user's request.

이하 본 발명을 첨부한 도면을 참조하여 설명한다.Hereinafter, the present invention will be described with reference to the accompanying drawings.

제1도는 종래의 PGC 내부의 소프트웨어 영역(A)과 사용자 프로그램영역(B)의 구성도고, 제2도는 본 발명 PGC 내부의 소프트웨어 영역(2A)과 사용자 프로그램 영역(2B)의 구성도이며, 제3도는 종래의 명령어 수행 흐름도이고, 제4도는 본 발명의 명령어 수행 흐름도이며, 제5도는 본 발명의 일실시예에 따른 각종 예시도로써, (5a)는 래더 다이아그램을 사용한 PGC 프로그램예이며, (5b)는 (5a)를 PGC가 수행할 수 있는 코드로 변환한 예를 나타낸 것이고, (5c)는 (5c)프로그램을 사용자 프로그램에 표시한 예이며, (5d)는 라이브러리 명령어의 구성 예시도이고, (5e)는 다른 명령어의 구성 예시도이다.1 is a configuration diagram of a software area A and a user program area B in a conventional PGC, and FIG. 2 is a configuration diagram of a software area 2A and a user program area 2B in a PGC of the present invention. FIG. 3 is a conventional instruction execution flowchart, FIG. 4 is an instruction execution flowchart of the present invention, and FIG. 5 is a diagram illustrating various examples according to an embodiment of the present invention, and (5a) is an example of a PGC program using a ladder diagram. (5b) shows an example of converting (5a) into code that can be executed by the PGC, (5c) shows an example of displaying (5c) a program in a user program, and (5d) shows an example of the configuration of a library instruction. And (5e) is an example of configuration of another command.

제6도는 본 발명이 적용되는 시스템 블럭도로써, PGC 사용자 프로그램의 내용을 해석하여 수행하는 소프트웨어를 저장하고 있는 롬으로 이루어진 소프트웨어 영역(20) 및 램으로 이루어진 사용자 프로그램 영역(30) 및 PGC 본체의 각부 동작을 제어하는 제1CPU(10)를 구비한 PGC본체(100)와, 디스플레이어장치(40), 키보드(70), 보조기억장치(60) 및 제2CPU(50)를 구비하여 PGC 프로그램을 상기 PGC 본체(100)의 제1CPU(10)가 해석하여 수행할 수 있는 형태로 변환하는 소프트웨어를 구현하는 프로그램 입력도구(20)로 구성된다.6 is a system block diagram to which the present invention is applied and includes a software area 20 consisting of ROM and a user program area 30 consisting of RAM and a PGC main body which store software for analyzing and executing contents of a PGC user program. PGC main body 100 having a first CPU 10 for controlling the operation of each part, and a display device 40, a keyboard 70, an auxiliary memory device 60 and a second CPU 50 to provide a PGC program. The first CPU 10 of the PGC main body 100 is configured as a program input tool 20 for implementing the software to convert to a form that can be interpreted and performed.

상술한 구성에 의거 본 발명을 상세히 설명한다.The present invention will be described in detail based on the above configuration.

본 발명은 제6도와 같이 PGC의 본체(100)가 있고 플로피디스크와 같은 보조기억장치(60)가 부착된 프로그램 로더나 퍼스널 컴퓨터와 같은 프로그램 입력도구(200)에서 상기 PGC(100)의 프로그램을 제5도의 (5a)와 같은 형식으로 편집하여 (5b)와 같이 상기 PGC(100)의 CPU(10)가 해석하여 수행할 수 있는 형태의 코드로 변환하는 소프트웨어를 상기 입력도구(200)를 통해서 구현한다. 즉 입력도구(200)에 래더 다이어그램 에미터 및 컴파일러를 구현하면 된다. 변환한 코드는 제5도의 (5c)와 같은 형식으로 입력도구(200)의 메모리에 채워지고 직렬 RS-232C 혹은 RS422와 같은 특정한 통신방법을 통해 상기 PGC(100)로 전달되어 상기 PGC(100) 내부의 사용자 영역(30)에 저장된다. 이때 명령어는 제5도의 (5e)와 같이 명령어 코드와 그 명령어에서 사용되는 변수로 구성되어 있고 PGC 내부(100)의 사용자 영역(30)은 랜덤 억세스 메모리(RANDOM ACCESS MEMORY : RAM)로, PGC 내부(100)의 소프트웨어 영역(20)은 PGC의 사용자 프로그램의 내용을 해석하여 수행하는 소프트웨어가 들어 있는 리드 오운리 메모리(Read Only Memory : ROM)로 구성되어 있다.In the present invention, as shown in FIG. 6, the program of the PGC 100 is stored in a program loader or a program loader 200 having a main body 100 of the PGC and an auxiliary memory device 60 such as a floppy disk. The input tool 200 converts the software into a code of a form that can be interpreted and executed by the CPU 10 of the PGC 100 as shown in FIG. Implement That is, a ladder diagram emitter and a compiler may be implemented in the input tool 200. The converted code is filled in the memory of the input tool 200 in the form as shown in FIG. 5C and transferred to the PGC 100 through a specific communication method such as serial RS-232C or RS422. It is stored in the user area 30 therein. At this time, the command is composed of the command code and variables used in the command as shown in (5e) of FIG. 5 and the user area 30 of the PGC internal 100 is a random access memory (RANDOM ACCESS MEMORY: RAM). The software area 20 of 100 is composed of a read only memory (ROM) containing software for analyzing and executing contents of a PGC user program.

입력도구에서 제5도의 (5a)와 같은 형식으로 편집된 프로그램을 해석할 때 제5도의 (a1)은 제5도의 (5e)와 같은 형식으로 코드를 변환하며 제5도의 (a2)는 제5도의 (5d)와 같은 형식으로 코드를 변환한다. 제5도의 (a1)은 PGC 내부(100)의 소프트웨어 영역(20)에서 명령어 처리부가 정의되어 있지만 제5도의 (a2)는 정의되어 있기 않기 때문에 종래의 방법에서는 이 명령어를 수행할 수가 없다. 왜냐하면 제5도와 같은 방법으로 사용자 프로그램이 구성되어 이 프로그램을 PGC가 수행하고자 할 때 명령어 수만큼 명령어 처리부를 롬에 정의해두고 수행해야 하기 때문에 N개의 명령어가 제공되면 N개의 처리부가 롬에 상주해야 만하기 때문이다. 즉 제1도에서 PGC(100)의 CPU(10)가 명령어(1)를 수행하기 위하여 명령어(1)의 코드를 해석하여 소프트웨어 영역(20)에 있는 명령어(1)의 처리부를 콜(CALL)하여 수행한 후 명령어(2)를 같은 방법으로 처리하기 때문에 제5도의 코사인(COS)의 기능을 추가하기 위해서 PGC 내부(100)의 롬에서 코사인(COS)를 수행할 수 있는 처리부를 추가하여야 된다. 이러한 방법은 제3도와 같이 사용자 영역(30)의 프로그램을 코드별로 분류하여 1:1로 대응하는 처리부를 PGC(10)가 해석처리하기 때문이다. 그러나 제2도와 같은 방법으로 PGC 내부(100)의 소프트웨어 영역(20)을 구성해 두면 즉 제2도의 (2a)과 같은 라이브러리 코드를 수행하는 처리부를 1개만 추가한 후 실제의 라이브러리에 대한 처리부는 제2도의 (2b)와 같이 사용자 프로그램의 최후위나 혹은 또다른 램에 두고 제2도의 (2a)의 라이브러리 처리부가 영역의 처리부를 기능 콜하면 된다.When the input tool interprets a program edited in the format as shown in (5a) of FIG. 5, (a1) in FIG. 5 converts the code into the format as (5e) in FIG. 5, and (a2) in FIG. Convert the code to the format as shown in (5d) of FIG. In FIG. 5A, the instruction processing unit is defined in the software area 20 of the PGC 100, but in FIG. 5A, the command processing unit is not defined. Because the user program is composed in the same way as Fig. 5, when the PGC wants to execute this program, the number of instructions must be defined in the ROM as many as the number of instructions. Therefore, if N instructions are provided, N processors must reside in the ROM. Because That is, in FIG. 1, the CPU 10 of the PGC 100 interprets the code of the instruction 1 to execute the instruction 1 and calls the processing unit of the instruction 1 in the software area 20. In order to add the function of cosine (COS) of FIG. 5 since the instruction (2) is processed in the same manner, a processing unit capable of performing cosine (COS) in the ROM of the PGC 100 must be added. . This is because the PGC 10 analyzes and processes the corresponding program 1: 1 by classifying programs of the user area 30 by codes as shown in FIG. However, if the software area 20 of the PGC interior 100 is configured in the same manner as in FIG. 2, that is, only one processing unit that executes the library code as shown in FIG. 2A is added. As shown in FIG. 2B, the library processing unit in FIG. 2A in FIG. 2A may call the processing unit of the area in the last position of the user program or in another RAM.

이때 제2도의 사용자 영역의 라이브러리 명령어 (2b)는 제5도의 (5b)와 같은 형식으로 구성되어 있으며 이 코드는 입력도구(100)의 소프트웨어가 제5도의 (a2)를 판단해서 PGC 내부(100)의 소프트웨어가 해석할 수 있는 라이브러리 코드와 라이브러리 처리부로 들어갈 때 사용할 입력변수와 처리부를 수행하고 난 후 그 결과를 저장할 출력변수 그리고 사용자 영역(혹은 또다른 램)에 있는 처리부의 시작 주소로 구성해 준다.At this time, the library command (2b) of the user area of FIG. 2 is configured in the same format as (5b) of FIG. 5, and this code is determined by software of the input tool 100 to determine (a2) of FIG. ) Consists of the library code that can be interpreted by the software, the input variable to use when entering the library processing unit, the output variable to store the result, and the starting address of the processing unit in the user area (or another RAM). give.

여기서 라이브러리 처리브는 입력도구의 보조기억장치(60)에 파일로 기록되어진 것을 PGC 프로그램에서 사용되어진 것만 선별하여 사용자 프로그램영역(30)으로 옮겨지는 것이며 이 라이브러리는 PGC 본체(제6도의 CPU(10)가 직접 수행할 수 있는 기계어 코드로 미리 구성해 두어야 한다. 즉 제5도의 (5b)에서 나타난 (a3)은 V2=COS(V1)의 기능을 나타내는데 입력도구에서 가지고 있는 라이브러리 파일은 입력변수 V1을 받아 코사인(COS) 함수를 취하여 V2에 저장하는 기능을 가지는 함수인 것이다. 이렇게 구성된 사용자 프로그램을 제6도의 CPU(2)가 실행하는 과정을 살펴보면, 먼저 (4a) 단계에서 라이브러리 코드 입력여부를 체크한다. 즉, 제2도의 사용자 프로그램에서 라이브러리 명령어(2b)를 만나면 (4c)단계로 진행하여 PGC 내부(100)의 소프트웨어 영역(20)의 라이브러리 처리부 (2a)를 콜하게 된다. (4c)단계 수행완료되면 (4d)단계에서 제2도의 라이브러리 처리부(2a)는 라이브러리 명령어(1)에서 지정한 입력변수(제5도의 V1)를 출력변수(제5도의 V2)를 가지고 라이브러리 처리부 어드레스(제5도의 100번지)로 프로그램의 수행을 이동시킨다. (4d)단계 수행완료 후 (4e)단계에서 사용자 프로그램 영역(30)의 라이브러리 처리부(제2도(2d)는 소프트웨어 영역(20)의 라이브러리 처리부(제2도의 (2a))에서 전달받는 입력변수(제5도의 V1)을 가지고 처리부를 수행한 (4f)단계에서 그 결과를 출력변수(제5도의 V2)에 저장한 후 프로그램의 수행을 마치게 된다. 즉, V2=COS(V1)의 기능을 수행하는데, 사용자 프로그램 영역은 소프트웨어 영역에서 전달받는 입력변수 V1과 V2를 가지고 V1값의 코사인 값을 취하여 V2에 대입한 후 그 다음 사용자 프로그램을 수행하게 된다.In this case, the library processing bar selects only those used in the PGC program from those recorded in the auxiliary storage device 60 of the input tool and moves them to the user program area 30. The library is the PGC main body (CPU 10 of FIG. 6). (A3) shown in (5b) of Figure 5 represents the function of V2 = COS (V1), and the library file in the input tool is the input variable V1. This function has a function of taking a cosine (COS) function and storing it in V2. Looking at the process of executing the user program configured in FIG. 6 by the CPU 2, first, whether the library code is input in step (4a). In other words, when the library instruction 2b is encountered in the user program of FIG. 2, the process proceeds to step 4c and the library of the software area 20 of the PGC interior 100 is checked. When the execution of step (4c) is completed, the library processing unit (2a) of FIG. 2 in step (4d) returns the input variable (V1 in FIG. 5) designated by the library instruction (1). The program execution is shifted to the library processing unit address (100 in Fig. 5) with V2 of 5. Fig. 4d) After completion of the step (4d), the library processing unit (Fig. 2d) shows the result of the output variable (Fig. 5f) in the step (4f) of executing the processing unit with the input variable (V1 in FIG. 5) received from the library processing unit (2a in FIG. 2) of the software area 20. After saving the data in V2), the program is finished, ie, V2 = COS (V1) .The user program area takes the cosine of V1 with the input variables V1 and V2 from the software area. Next user program after assignment to V2 Is performed.

상술한 바와 같이 보조기억장치를 갖춘 프로그램 입력도구에 특정한 기능을 정의해 놓고 사용자가 정의된 기능을 사용할 때만 사용자 프로그램과 함께 이 기능의 처리루틴을 PGC 내부의 사용자 프로그램 영역에 전달토록 하므로써 PGC 자체의 소프트웨어 부담을 줄이고 사용자의 요구에 따른 기능의 추가를 용이하게 할 수 있는 이점이 있다.As described above, by defining a specific function in the program input tool with the auxiliary memory device and delivering the processing routine of this function together with the user program to the user program area inside the PGC only when the user uses the defined function, This has the advantage of reducing the software burden and facilitating the addition of functionality to the user's needs.

Claims (1)

프로그램 입력도구(200)를 구비한 프로그래머블 컨트롤러의 라이브러리 처리방법에 있어서, 라이브러리 코드 입력 여부를 체크하는 제1과정과, 라이브러리 코드가 아닐시 명령어 코드를 분류하여 해당 명령어 처리하는 제2과정과, 라이브러리 코드일시 라이브러리 처리부를 호출하여 입력변수의 내용 및 출력변수 주소를 수록하고 사용자 영역 시작 주소로 이동하여 라이브러리 처리 수행후 결과를 변수에 저장하는 제3과정으로 이루어짐을 특징으로 하는 방법.A library processing method of a programmable controller having a program input tool 200, the method comprising: a first process of checking whether a library code is input, a second process of classifying an instruction code when the library code is not processed, and a library; And a third step of storing the contents of the input variable and the output variable address by calling the code temporary library processing unit, moving to the user address starting address, and storing the result in the variable after performing the library processing.
KR1019890012206A 1989-08-26 1989-08-26 Method managing library of plc KR910009262B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1019890012206A KR910009262B1 (en) 1989-08-26 1989-08-26 Method managing library of plc

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1019890012206A KR910009262B1 (en) 1989-08-26 1989-08-26 Method managing library of plc

Publications (2)

Publication Number Publication Date
KR910005123A KR910005123A (en) 1991-03-30
KR910009262B1 true KR910009262B1 (en) 1991-11-07

Family

ID=19289285

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1019890012206A KR910009262B1 (en) 1989-08-26 1989-08-26 Method managing library of plc

Country Status (1)

Country Link
KR (1) KR910009262B1 (en)

Also Published As

Publication number Publication date
KR910005123A (en) 1991-03-30

Similar Documents

Publication Publication Date Title
JP2692609B2 (en) Multitask program debugging method and apparatus
KR910009262B1 (en) Method managing library of plc
US5150474A (en) Method for transferring arguments between object programs by switching address modes according to mode identifying flag
US6134708A (en) Program compilation execution system
US5765148A (en) Database processing apparatus and database processing method for variable length objects, and computer-readable memory medium for storing database processing program
US6085264A (en) Accounting-information outputting device
US4727818A (en) Embroidery machine apparatus
EP0905616A2 (en) Language processing system and method for generating an object program from a source program by use of two-step jump
EP0576678A1 (en) Method of expanding function of automatic programming apparatus
JPH05297911A (en) Sequence control circuit for sequence controller
JP3024131B2 (en) Compiler system
KR100210796B1 (en) Method for embodying history function in an ess
JPH04324504A (en) Numerical controller
JPH06314221A (en) Compiling system
JPH05100720A (en) Managing device for program
JPH0498322A (en) Generation method for compiler
JPS61168009A (en) Numerical control device
JPH06110702A (en) Procedure call translator
JPS63276629A (en) Sorting system for record in file
JPH01159704A (en) Numerical controller
JPH08286933A (en) Multitask os device
JPH01316873A (en) System for managing reserved word table of translation system
JPH023830A (en) Selection system for precision/performance on mathematics built-in function execution time
JPH08255076A (en) Automatic program generation system by database driving
JPS62216037A (en) Message managing system using source library

Legal Events

Date Code Title Description
A201 Request for examination
G160 Decision to publish patent application
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
FPAY Annual fee payment

Payment date: 20081024

Year of fee payment: 18

EXPY Expiration of term