KR20180117927A - Programmable logic control system - Google Patents

Programmable logic control system Download PDF

Info

Publication number
KR20180117927A
KR20180117927A KR1020170051092A KR20170051092A KR20180117927A KR 20180117927 A KR20180117927 A KR 20180117927A KR 1020170051092 A KR1020170051092 A KR 1020170051092A KR 20170051092 A KR20170051092 A KR 20170051092A KR 20180117927 A KR20180117927 A KR 20180117927A
Authority
KR
South Korea
Prior art keywords
programmable logic
task program
main task
logic controller
logic control
Prior art date
Application number
KR1020170051092A
Other languages
Korean (ko)
Other versions
KR101957400B1 (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 KR1020170051092A priority Critical patent/KR101957400B1/en
Publication of KR20180117927A publication Critical patent/KR20180117927A/en
Application granted granted Critical
Publication of KR101957400B1 publication Critical patent/KR101957400B1/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
    • G05B19/05Programmable logic controllers, e.g. simulating logic interconnections of signals according to ladder diagrams or function charts
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/10Plc systems
    • G05B2219/12Plc mp multi processor system
    • G05B2219/1214Real-time communication between plc, Ethernet for configuration, monitor
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/10Plc systems
    • G05B2219/14Plc safety
    • G05B2219/14131Workby plc, all plc function in parallel, synchronous data exchange
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/10Plc systems
    • G05B2219/15Plc structure of the system
    • G05B2219/15014Configure priorities of different tasks

Landscapes

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

Abstract

Disclosed is a programmable logic control system. According to an embodiment of the present invention, the programmable logic control system comprises: a programmable logic control device for sequentially performing a main task program and a sub-task program by allowing the main task program to have an order of priority during a period of executing a program based on a real-time operating system; and at least one external driving device driven by control of the programmable logic control device. The programmable logic control device changes an execution order of the main task program in accordance with a message queue command when the message queue command is input through another programmable logic control device or an external input device, and can increase the accuracy of programming processing between a plurality of programmable logic control devices and can improve the reliability thereof by synchronizing a data read/write time point with a data read/write request time point of the programmable logic control devices using the real-time operating system.

Description

프로그래머블 논리 제어 시스템{PROGRAMMABLE LOGIC CONTROL SYSTEM}[0001] PROGRAMMABLE LOGIC CONTROL SYSTEM [

본 발명은 실시간 운영 체제를 이용하는 프로그래머블 논리 제어장치들의 데이터 읽기/쓰기 시점이 데이터 읽기/쓰기 요청 시점과 동기화될 수 있도록 함으로써, 다수의 프로그래머블 논리 제어장치들 간에 프로그래밍 처리 정확성을 높이고 그 신뢰성을 향상시킬 수 있도록 한 프로그래머블 논리 제어 시스템에 관한 것이다. The present invention can improve the reliability of programming processing among a plurality of programmable logic controllers by allowing the data read / write time of the programmable logic controllers using the real-time operating system to be synchronized with the time of the data read / write request To a programmable logic control system.

프로그래머블 논리 제어장치(Programmable Logic Controller)는 디지털 또는 아날로그 입출력 모듈을 통하여 로직, 시퀀싱, 타이밍, 카운팅, 연산과 같은 기능을 수행하기 위해 주로 이용된다. 이러한 프로그래머블 논리 제어장치는 프로그램 가능한 메모리를 사용하여 여러 종류의 기계나 프로세서를 제어하는 장치로서, 공장 자동화 등을 위하여 여러 산업 분야에서 널리 사용되고 있다. Programmable Logic Controllers are primarily used to perform functions such as logic, sequencing, timing, counting, and arithmetic through digital or analog I / O modules. Such a programmable logic controller is a device for controlling various kinds of machines or processors by using a programmable memory, and is widely used in various industrial fields for factory automation and the like.

프로그래머블 논리 제어장치는 제어모듈, 통신모듈, 입출력모듈, 및 통신선로 등을 포함하여 구성될 수 있으며, 제어 모듈의 마이크로프로세서나 마이크로 컨트롤 유닛을 이용해 미리 설정된 프로그램을 순차적으로 실행하고, 그 출력 결과를 이용해 연결된 외부장치를 제어한다. The programmable logic controller may include a control module, a communication module, an input / output module, and a communication line. The programmable logic controller may sequentially execute a preset program using a microprocessor or a micro control unit of the control module, To control connected external devices.

프로그래머블 논리 제어장치의 프로그램 운영 체제로는 실시간 운영 체제(Real Time Operating System)가 주로 이용되고 있다. 실시간 운영 체제는 마이크로프로세서나 마이크로 컨트롤 유닛의 프로그래밍 시간 관리 부분에 초점을 맞추어 설계된 운영 체제이다. 이러한 실시간 운영 체제는 프로그래머가 프로세스 우선 순위에 더 많은 제어를 할 수 있도록 하여, 응용 프로그램의 태스크(Task) 처리에 걸리는 시간을 일관되게 유지할 수 있는 정도에 있다. As a program operating system of a programmable logic controller, a real time operating system (Real Time Operating System) is mainly used. A real-time operating system is an operating system designed with a focus on the programming time management part of a microprocessor or microcontroller unit. This real-time operating system allows the programmer to have more control over the process priority so that it can consistently maintain the time it takes to process the task of the application.

하지만, 종래의 시간 운영 체제를 이용하는 프로그래머블 논리 제어장치들은 다른 프로그래머블 논리 제어장치나 외부의 관리 시스템에서 특정 데이터를 요청하면, 해당 데이터가 요청된 시점과 다른 이후의 시점에 해당 데이터를 읽어낸 후, 전송하기 때문에, 요구하는 데이터와 수신되는 데이터가 불일치 하는 문제점이 있었다. However, the programmable logic controllers using the conventional time operating system read specific data when they request specific data from another programmable logic controller or an external management system, There is a problem that the requested data is inconsistent with the received data.

구체적으로, 시간 운영 체제를 이용하는 종래의 프로그래머블 논리 제어장치들은 메인 태스크 프로그램을 우선순위로 먼저 수행한 후에, 서브 태스크 프로그램을 수행하다가 다시, 메인 태스크 프로그램 수행 기간이 되면 서브 태스크 프로그램은 중단하고, 메인 태스크 프로그램을 우선순위로 수행하였다. 이는, 각각의 프로그래머블 논리 제어장치에 하나의 함수로 메인 태스크 프로그램이 작성 및 저장되어 실행되었기 때문에, 메인 태스크 프로그램만 우선순위로 먼저 수행할 수밖에 없는 구조였다. Specifically, the conventional programmable logic controllers using the time operating system execute the main task program in the order of priority, then execute the sub-task program, then stop the sub-task program again in the main task program execution period, Task programs were executed in priority order. This is because the main task program is created and stored as one function in each programmable logic controller so that only the main task program has to be executed first in priority.

이에, 다른 프로그래머블 논리 제어장치나 외부의 관리 시스템에서 특정 데이터를 읽거나 쓰도록 요청되는 경우, 서브 태스크 프로그램 수행 기간에 요청된 데이터를 읽어서 전송하거나 메모리에 써야 하지만, 데이터를 읽어서 전송하거나 메모리에 기입하기 전에 메인 태스크 프로그램이 실행되었다. 따라서, 요청된 데이터를 읽어서 전송하거나 메모리에 쓰는 동작은 다음 메인 태스크 프로그램 수행 후의 기간으로 계속 지연될 수밖에 없었다. When requested to read or write specific data from another programmable logic controller or an external management system, the requested data is read and transmitted in the sub task program execution period or written to the memory. However, the data is read and transmitted or written into the memory The main task program was executed before. Therefore, the operation of reading the requested data, transferring it to the memory, or writing it to the memory has to be continuously delayed to the period after the execution of the next main task program.

이렇게, 종래에는 외부에서의 데이터를 읽거나 쓰도록 요청하는 시점과 해당 메모리에서 데이터를 읽어들이거나 쓰는 시점, 및 읽어들인 데이터를 다시 외부로 전송하는 시점이 모두 달라질 수 있기 때문에, 동기화가 안 되고 그에 따른 정확성이 떨어지는 등의 문제가 발생하였다. In this way, since the time of requesting reading or writing data from the outside, the time of reading or writing data in the memory, and the time of transmitting the read data back to the outside can be different, conventionally, Resulting in problems such as poor accuracy.

본 발명은 상기와 같은 문제점을 해결하기 위한 것으로, 실시간 운영 체제를 이용하는 프로그래머블 논리 제어장치들의 데이터 읽기/쓰기 시점이 데이터 읽기/쓰기 요청 시점과 동기화될 수 있도록 함으로써, 다수의 프로그래머블 논리 제어장치들 간에 프로그래밍 처리 정확성을 높이고 그 신뢰성을 향상시킬 수 있는 프로그래머블 논리 제어 시스템을 제공하는데 그 목적이 있다. SUMMARY OF THE INVENTION The present invention has been made to solve the above-mentioned problems, and it is an object of the present invention to provide a programmable logic controller which can synchronize a data read / write time of a programmable logic controller And to provide a programmable logic control system capable of improving the accuracy of programming processing and improving its reliability.

상기와 같은 목적을 달성하기 위한 본 발명의 실시 예에 따른 프로그래머블 논리 제어 시스템은 실시간 운영 체제를 기반으로 프로그램을 수행하는 기간 동안, 메인 태스크 프로그램을 우선순위로 메인 태스크 프로그램과 서브 태스크 프로그램을 순차 수행하는 프로그래머블 논리 제어장치, 및 프로그래머블 논리 제어장치의 제어에 따라 구동되는 적어도 하나의 외부 구동장치를 포함하며, 여기서 프로그래머블 논리 제어장치는 다른 프로그래머블 논리 제어장치나 외부 입력장치를 통해 메시지 대기열 명령이 입력되면, 메시지 대기열 명령에 따라 메인 태스크 프로그램의 수행 순서를 변경함에 특징이 있다. According to an aspect of the present invention, there is provided a programmable logic control system including a main task program and a sub-task program sequentially in a main task program, And at least one external drive device driven in accordance with the control of the programmable logic controller, wherein the programmable logic controller is operable when a message queue command is input via another programmable logic controller or external input device , And the execution order of the main task program is changed according to the message queue command.

특히, 프로그래머블 논리 제어장치는 메시지 대기열 명령에 따라 메인 태스크 프로그램의 수행 기간에 메시지 대기열 명령에 따른 메시지 동작, 예를 들어 메시지 내용에 따른 읽기/쓰기 동작을 수행한다. 그리고 메인 태스크 프로그램의 수행 기간에 결과 데이터까지 생성하고, 결과 데이터를 메인 태스크 프로그램 수행 기간 이후의 다음 서브 태스크 프로그램으로 전달함에 특징이 있다. In particular, the programmable logic controller performs a message operation according to a message queue command, for example, a read / write operation according to a message content, during a period of execution of a main task program according to a message queue command. The result data is also generated in the execution period of the main task program, and the result data is transferred to the next subtask program after the main task program execution period.

상기와 같은 다양한 기술 특징을 갖는 본 발명의 실시 예에 따른 프로그래머블 논리 제어 시스템은 실시간 운영 체제를 이용하는 프로그래머블 논리 제어장치들의 데이터 읽기/쓰기 시점이 데이터 읽기/쓰기 요청 시점과 동기화될 수 있도록 한다. The programmable logic control system according to an embodiment of the present invention having various technical features as described above enables the data read / write points of the programmable logic controllers using the real-time operating system to be synchronized with the data read / write request point.

이에, 다수 프로그래머블 논리 제어장치들 간의 프로그래밍 처리 정확성을 높일 수 있으며, 외부 장치들과도 데이터 입출력 시점을 동기화시켜 그 신뢰성을 향상시킬 수 있는 효과가 있다. Accordingly, it is possible to improve the accuracy of programming processing between the plurality of programmable logic controllers and to improve the reliability by synchronizing data input / output points with external devices.

도 1은 본 발명의 실시 예에 따른 프로그래머블 논리 제어 시스템을 나타낸 구성도이다.
도 2는 도 1에 도시된 어느 한 프로그래머블 논리 제어 장치의 실시간 운영체제 수행 과정을 설명하기 위한 도면이다.
도 3은 외부로부터의 데이터 읽기/쓰기 요청시 수행 과정을 구체적으로 설명하기 위한 도면이다.
도 4는 도 1에 도시된 어느 한 프로그래머블 논리 제어 장치의 동기화 동작을 설명하기 위한 순서도이다.
1 is a block diagram showing a programmable logic control system according to an embodiment of the present invention.
FIG. 2 is a diagram for explaining a process of executing a real-time operating system of a programmable logic controller shown in FIG.
FIG. 3 is a diagram for explaining a process of performing a data read / write request from the outside.
4 is a flowchart for explaining a synchronization operation of one programmable logic controller shown in FIG.

전술한 목적, 특징 및 장점은 첨부된 도면을 참조하여 상세하게 후술되며, 이에 따라 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자가 본 발명의 기술적 사상을 용이하게 실시할 수 있을 것이다. 본 발명을 설명함에 있어서 본 발명과 관련된 공지 기술에 대한 구체적인 설명이 본 발명의 요지를 불필요하게 흐릴 수 있다고 판단되는 경우에는 상세한 설명을 생략한다. 이하, 첨부된 도면을 참조하여 본 발명에 따른 바람직한 실시 예를 상세히 설명하기로 한다. The above and other objects, features, and advantages of the present invention will become more apparent by describing in detail exemplary embodiments thereof with reference to the attached drawings, which are not intended to limit the scope of the present invention. In the following description, well-known functions or constructions are not described in detail since they would obscure the invention in unnecessary detail. Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings.

도 1은 본 발명의 실시 예에 따른 프로그래머블 논리 제어 시스템을 나타낸 구성도이다. 1 is a block diagram showing a programmable logic control system according to an embodiment of the present invention.

도 1에 도시된 바와 같이, 프로그래머블 논리 제어 시스템은 실시간 운영 체제(Real Time Operating System)를 기반으로 프로그램을 수행하는 기간 동안, 메인 태스크 프로그램을 우선순위로 메인 태스크 프로그램과 서브 태스크 프로그램을 순차 수행하는 적어도 하나의 프로그래머블 논리 제어장치(100,200)를 포함한다. As shown in FIG. 1, the programmable logic control system sequentially executes a main task program and a subtask program with a main task program as a priority, during a period of executing a program based on a real time operating system (Real Time Operating System) And at least one programmable logic controller (100, 200).

또한, 적어도 하나의 프로그래머블 논리 제어장치(100,200)의 제어에 따라 구동되는 적어도 하나의 외부 구동장치(110, 120, 130, 210, 220, 230), 및 각각의 프로그래머블 논리 제어장치(100,200)에 메시지 대기열 명령이나 제어 명령을 입력하기 위한 입력 수단(140,240)을 더 포함할 수 있다. It is also possible to provide at least one external drive 110, 120, 130, 210, 220, 230 driven by the control of at least one programmable logic controller 100, 200 and a respective one of the programmable logic controllers 100, And input means (140, 240) for inputting a queue command or a control command.

적어도 하나의 외부 구동장치로는 제1 내지 제n 개의 모터(110,120), 제1 내지 제 n 센서(210,220), 적어도 하나의 외부 LED(LEDn; Light Emitting Diode, 130,), 적어도 하나의 스위치(230) 등이 포함될 수 있다. The at least one external driving device includes first to nth motors 110 and 120, first to nth sensors 210 and 220, at least one LED (Light Emitting Diode) 130, at least one switch 230, and the like.

입력 수단(140,240)으로는 각 프로그래머블 논리 제어장치(100,200)의 입력 접점(140)과 별도의 입력 모듈(240) 등이 될 수 있다. 여기서, n은 0을 제외한 자연수이다. The input means 140 and 240 may be input contacts 140 of the programmable logic controllers 100 and 200 and a separate input module 240. Here, n is a natural number excluding 0.

각각의 프로그래머블 논리 제어장치(100,200)는 적어도 하나의 마이크로프로세서나 MCU(Micro Controller Unit) 등의 마이컴 프로세서를 포함한다. 이에, 각각의 프로그래머블 논리 제어장치(100,200)는 마이컴 프로세서의 실시간 운영 체제에 기반한 프로그램 실행(예를 들어, 프로그램 연산 처리) 결과에 따라 적어도 하나의 외부 구동장치들의 구동을 제어하게 된다. Each of the programmable logic controllers 100 and 200 includes at least one microprocessor or a microcontroller such as a microcontroller unit (MCU). Each of the programmable logic controllers 100 and 200 controls the driving of at least one external driving device according to a result of program execution (for example, program operation processing) based on the real-time operating system of the microcomputer.

각각의 프로그래머블 논리 제어장치(100,200)는 실시간 운영 체제에 기반한 프로그램을 수행하는 기간 동안, 메인 태스크 프로그램을 우선순위로 메인 태스크 프로그램과 서브 태스크 프로그램을 순차 수행하게 된다. 도 2를 참조하여, 프로그래머블 논리 제어장치(100,200)의 프로그램 수행 과정을 좀 더 구체적으로 설명하면 다음과 같다. Each of the programmable logic controllers 100 and 200 sequentially executes the main task program and the subtask program with priority given to the main task program during the execution of the program based on the real-time operating system. Referring to FIG. 2, a program execution process of the programmable logic controllers 100 and 200 will be described in more detail as follows.

도 2는 도 1에 도시된 어느 한 프로그래머블 논리 제어 장치의 실시간 운영체제 수행 과정을 설명하기 위한 도면이다. FIG. 2 is a diagram for explaining a process of executing a real-time operating system of a programmable logic controller shown in FIG.

도 2에 도시된 바와 같이, 프로그래머블 논리 제어장치(100,200)는 실시간 운영 체제를 기반으로 프로그램을 수행하는 기간, 즉 OS(Operating System) 수행 기간동안, 미리 설정된 메인 태스크 프로그램 수행 기간(즉, 메인 태스크(Main Task) 수행 기간)을 연속적으로 반복되도록 한다. As shown in FIG. 2, the programmable logic controllers 100 and 200 execute a predetermined main task program execution period (i.e., a main task execution period) during a period during which a program is executed based on a real-time operating system, (Main Task) execution period) is continuously repeated.

그리고 각각의 메인 태스크 프로그램 수행 기간에는 메인 태스크 프로그램(즉, 메인 태스크)을 먼저 실행 및 처리(ST1)한 후, 남아있는 기간에 서브 태스크 프로그램(즉, 서브 태스크(Sub Task))을 실행(ST2)한다. In the main task program execution period, the main task program (i.e., the main task) is first executed and processed (ST1), and then the sub task program (i.e., the sub task) is executed in the remaining period )do.

이렇게, 프로그래머블 논리 제어장치(100,200)는 메인 태스크 먼저 실행한 후, 남아 있는 기간에 서브 태스크 프로그램을 실행하다가, 다시 미리 설정된 메인 태스크 프로그램 수행 기간이 반복되면, 다시 메인 태스크 프로그램을 먼저 실행 및 처리하게 된다. 따라서, 메인 태스크 프로그램 수행 기간마다 미리 설정 및 저장된 메인 태스크는 계속 반복되지만, 서브 태스크는 모두 실행되지 못하고 남은 기간에 다라 일부분씩만 수행될 수 있다. In this way, the programmable logic controllers 100 and 200 execute the main task first, then execute the sub task program in the remaining period, and if the predetermined main task program execution period is repeated again, the main task program is first executed and processed again do. Therefore, although the main task set and stored in advance for each main task program execution period is continuously repeated, the sub tasks can not be executed all but only a part of them can be performed in the remaining time period.

한편, 프로그래머블 논리 제어장치(100,200)는 메인 태스크 프로그램 수행 기간을 반복해서 진행하다가, 다른 프로그래머블 논리 제어장치나 외부 입력장치(140,240)를 통해 메시지 대기열 명령이 입력되면, 메시지 대기열 명령에 따라 메인 태스크 프로그램의 수행 순서를 변경할 수 있다. 이렇게 메시지 대기열 명령에 따라 메인 태스크 프로그램의 수행 순서를 변경하는 기술에 대해서는 하기의 도 3을 통해 좀 더 구체적으로 설명하기로 한다. On the other hand, the programmable logic controllers 100 and 200 repeatedly execute the main task program execution period, and when a message queue command is input through another programmable logic controller or external input device 140 or 240, Can be changed. The technique for changing the execution order of the main task program according to the message queue command will be described in more detail with reference to FIG.

도 3은 외부로부터의 데이터 읽기/쓰기 요청시 수행 과정을 구체적으로 설명하기 위한 도면이다. FIG. 3 is a diagram for explaining a process of performing a data read / write request from the outside.

도 3에 도시된 바와 같이, 프로그래머블 논리 제어장치(100,200)는 메인 태스크 프로그램 수행 기간을 반복해서 진행(SS1)하다가, 다른 프로그래머블 논리 제어장치나 외부 입력장치(140,240)를 통해 메시지 대기열 명령(MsgQ, Message Queue)이 입력(Rx)되면(SS2), 메시지 대기열 명령(MsgQ)을 서브 태스크 프로그램 수행 기간에 메인 태스크 프로그램으로 전달한다(Send Msg to Px). 3, the programmable logic controllers 100 and 200 repeatedly execute the main task program execution period (SS1), and then transmit message queue commands (MsgQ, MsgQ) through other programmable logic controllers or external input devices 140 and 240, When the message queue is input (Rx) (SS2), the message queue command (MsgQ) is transferred to the main task program in the sub task program execution period (Send Msg to Px).

구체적으로, 도 3의 메시지 대기열 명령(MsgQ) 전달 동작(Send Msg to Px)은 외부 입력장치(140,240)가 프로그래머블 논리 제어장치(100,200)의 특정 데이터를 읽거나, 쓰고 싶을 경우에 대기열 명령(MsgQ) 메시지를 서브 태스크 프로그램으로 전달하거나 명령어를 매칭시키는 동작이다. 3, when the external input device 140 or 240 wants to read or write the specific data of the programmable logic controllers 100 and 200, the send command Msg to Px of the message queue command (MsgQ) ) Message to the sub-task program or to match the command.

이후, 서브 태스크 프로그램 수행 기간에 대기열 명령(MsgQ) 메시지는 서브 태스크 프로그램에서 메인 태스크 프로그램으로 전달된다. Thereafter, in the sub-task program execution period, the queue command (MsgQ) message is transferred from the sub-task program to the main task program.

이에, 프로그래머블 논리 제어장치(100,200)는 돌아오는 메인 태스크 프로그램의 수행 기간에 우선순위로 메시지 대기열 명령(MsgQ)에 따른 읽기/쓰기 동작을 수행한다(Px). 이 동작은 메인 태스크 프로그램 내부에 있는 동작이므로, 메인 태스크 프로그램의 수행 주기 내에 처리가 완료된다. 즉, 특정 데이터를 읽거나, 쓰고 싶을 경우에 대기열 명령(MsgQ) 메시지를 이용해서, 읽기/쓰기 동작이 메인 태스크 프로그램의 수행 주기 내에 처리되도록 하는바, 데이터 읽기/쓰기 시점이 데이터 읽기/쓰기 요청 시점과 동기화되도록 할 수 있다. Accordingly, the programmable logic controllers 100 and 200 perform a read / write operation (Px) according to a message queue command (MsgQ) in a priority order in the execution period of the return main task program. Since this operation is an operation within the main task program, the processing is completed within the execution period of the main task program. That is, when reading or writing specific data, the read / write operation is processed within the execution cycle of the main task program by using the queue command (MsgQ) message, and when the data read / And synchronized with the time point.

프로그래머블 논리 제어장치(100,200)는 메시지 대기열 명령(MsgQ)에 따라 메인 태스크 프로그램의 수행 기간에 읽기/쓰기 동작을 수행한 이후에는 동작 수행 결과 데이터를 생성한다(SS4, (Send MsgQ to Tx)). 이렇게 생성된 결과 데이터는 메인 태스크 프로그램 수행 기간 이후의 다음 서브 태스크 프로그램에 외부로 출력될 수 있도록 서브 태스크 프로그램 명령(Send MsgQ to Rx)으로 전달한다. The programmable logic controllers 100 and 200 generate operation execution result data (SS4, (Send MsgQ to Tx)) after performing the read / write operation in the execution period of the main task program according to the message queue command (MsgQ). The generated result data is transferred to the sub task program command (Send MsgQ to Rx) so as to be output to the next subtask program after the main task program execution period.

이후, 서브 태스크 프로그램 수행 기간과 메인 태스크 프로그램 수행 기간은 계속 반복되기 때문에(SS6,SS7), 프로그래머블 논리 제어장치(100,200)는 결과 데이터가 생성된 다음 순번으로 돌아오는 어느 한 서브 태스크 프로그램 수행 기간에, 결과 데이터를 다른 프로그래머블 논리 제어장치나 외부 입력장치로 전송할 수 있다(SS8). Subsequently, since the subtask program execution period and the main task program execution period are continuously repeated (SS6 and SS7), the programmable logic controllers 100 and 200 execute the sub task program execution period and the main task program execution period in the sub task program execution period , The result data can be transferred to another programmable logic controller or an external input device (SS8).

도 4는 도 1에 도시된 제1 및 제2 프로그래머블 논리 제어 장치의 동기화 동작을 설명하기 위한 순서도이다. 4 is a flowchart for explaining a synchronization operation of the first and second programmable logic controllers shown in FIG.

도 4를 참조하여, 도 1에 도시된 제1 및 제2 프로그래머블 논리 제어 장치 중 제1 프로그래머블 논리 제어 장치(100)의 동기화 동작을 순차적으로 살펴보면 다음과 같다. Referring to FIG. 4, the synchronization operation of the first programmable logic controller 100 of the first and second programmable logic controllers shown in FIG. 1 will be described below in order.

먼저, 제1 프로그래머블 논리 제어 장치(100)의 전원이 온(ON, S1)되면, 제1 프로그래머블 논리 제어 장치(100)의 동작이 시작된다. 이때는 가장 먼저 제1 프로그래머블 논리 제어 장치(100)의 초기화 동작을 수행한다(S2). 이는 프로그램의 디바이스 값 등 제1 프로그래머블 논리 제어 장치(100)의 동작에 필요한 자원을 초기화하는 동작을 포함한다. First, when the power of the first programmable logic controller 100 is turned on (S1, S1), the operation of the first programmable logic controller 100 is started. In this case, the initialization operation of the first programmable logic controller 100 is performed first (S2). This includes initializing the resources required for the operation of the first programmable logic controller 100, such as the device value of the program.

이어, 제1 프로그래머블 논리 제어 장치(100)는 미리 설정된 프로그램 주기에 따라 메인 태스크 프로그램 수행 기간과 서브 태스크 프로그램 수행 기간을 설정한 다음, 해당 주기의 메인 태스크 프로그램과 서브 태스크 프로그램을 생성한다(S3). Next, the first programmable logic controller 100 sets a main task program execution period and a subtask program execution period according to a preset program cycle, and then generates a main task program and a subtask program of the corresponding cycle (S3) .

메인 태스크 프로그램과 서브 태스크 프로그램은 바로 이어 동작함으로써 순차적으로 프로그램 연산을 실행한다(S4). 이때부터 제1 프로그래머블 논리 제어 장치(100)는 외부의 메시지를 수신할 수 있다. The main task program and the sub-task program are sequentially operated to sequentially execute the program operation (S4). From this time, the first programmable logic controller 100 can receive an external message.

프로그램 수행기간에 제1 프로그래머블 논리 제어 장치(100)는 실시간으로 외부의 메시지가 수신되는지 확인하며, 특히 메시지 대기열 명령(MsgQ)이 포함된 메시지가 수신되는지 확인하게 된다(S5). During the program execution period, the first programmable logic controller 100 checks whether an external message is received in real time, in particular, whether a message including a message queue command (MsgQ) is received (S5).

외부의 메시지가 수신되면, 수신 메시지가 메인 태스크 프로그램 수행 기간에 요청된 메시지인지 서브 태스크 프로그램 기간에 요청된 메시지 인지 확인한다(S6). If an external message is received, it is confirmed whether the received message is a message requested during the main task program execution period or a message requested during the sub task program period (S6).

메인 태스크 프로그램 기간에 메시지 대기열 명령(MsgQ)이 포함된 메시지가 수신되면, 제1 프로그래머블 논리 제어장치(100)는 메인 태스크 프로그램의 수행 기간에 우선순위로 메시지 대기열 명령(MsgQ)에 따른 읽기/쓰기 동작을 수행한다(S8). 이 동작은 메인 태스크 프로그램 내부에 있는 동작이므로 메인 태스크 프로그램의 수행 주기 내에 처리가 완료된다(S9). When a message including a message queue command (MsgQ) is received in the main task program period, the first programmable logic controller (100) reads / writes in accordance with a message queue command (MsgQ) (S8). Since this operation is an operation inside the main task program, the processing is completed within the execution period of the main task program (S9).

프로그래머블 논리 제어장치(100,200)는 메시지 대기열 명령(MsgQ)에 따라 메인 태스크 프로그램의 수행 기간에 읽기/쓰기 동작을 수행한 이후에는 동작 수행 결과 데이터를 생성한다. 이렇게 생성된 결과 데이터는 메인 태스크 프로그램 수행 기간 이후의 다음 서브 태스크 프로그램에 외부로 출력될 수 있도록 서브 태스크 프로그램 명령으로 전달한다(S10). The programmable logic controllers 100 and 200 generate operation execution result data after performing the read / write operation in the execution period of the main task program according to the message queue command MsgQ. The generated result data is transferred to the sub task program instruction so that the resultant data can be output to the next sub task program after the main task program execution period (S10).

이후, 프로그래머블 논리 제어장치(100,200)는 결과 데이터가 생성된 다음 순번으로 돌아오는 어느 한 서브 태스크 프로그램 수행 기간에, 결과 데이터를 다른 프로그래머블 논리 제어장치나 외부 입력장치로 전송할 수 있다. Thereafter, the programmable logic controllers 100 and 200 can transmit the result data to another programmable logic controller or an external input device in any one of the sub-task program execution periods in which the result data is generated and returned to the next sequential number.

반면, 서브 태스크 프로그램 기간에 메시지 대기열 명령(MsgQ)이 포함된 메시지가 수신되면, 대기열 명령(MsgQ) 메시지는 서브 태스크 프로그램에서 메인 태스크 프로그램으로 전달된다(S11,12). 이에, 제1 프로그래머블 논리 제어장치(100)는 돌아오는 메인 태스크 프로그램의 수행 기간에 우선순위로 메시지 대기열 명령(MsgQ)에 따른 읽기/쓰기 동작을 수행한다(SS13). 이 동작은 메인 태스크 프로그램 내부에 있는 동작이므로 메인 태스크 프로그램의 수행 주기 내에 처리가 완료된다(SS14). On the other hand, if a message including the message queue command (MsgQ) is received during the sub-task program period, the queue command (MsgQ) message is transferred from the sub-task program to the main task program (S11, 12). Accordingly, the first programmable logic controller 100 performs a read / write operation according to a message queue command (MsgQ) with priority in the execution period of the return main task program (SS13). Since this operation is an operation inside the main task program, the processing is completed within the execution period of the main task program (SS14).

프로그래머블 논리 제어장치(100,200)는 메시지 대기열 명령(MsgQ)에 따라 메인 태스크 프로그램의 수행 기간에 읽기/쓰기 동작을 수행한 이후에는 동작 수행 결과 데이터를 생성한다(SS15). 이렇게 생성된 결과 데이터는 메인 태스크 프로그램 수행 기간 이후의 다음 서브 태스크 프로그램에 외부로 출력될 수 있도록 서브 태스크 프로그램 명령으로 전달한다(SS16). The programmable logic controllers 100 and 200 generate operation execution result data after performing the read / write operation in the execution period of the main task program according to the message queue command MsgQ (SS15). The generated result data is transferred to the sub task program instruction so that it can be output to the next sub task program after the main task program execution period (SS16).

이후, 서브 태스크 프로그램 수행 기간과 메인 태스크 프로그램 수행 기간은 계속 반복되기 때문에, 프로그래머블 논리 제어장치(100,200)는 결과 데이터가 생성된 다음 순번으로 돌아오는 어느 한 서브 태스크 프로그램 수행 기간에, 결과 데이터를 다른 프로그래머블 논리 제어장치나 외부 입력장치로 전송할 수 있다(SS17). Subsequently, since the sub-task program execution period and the main task program execution period are continuously repeated, the programmable logic controllers 100 and 200 can output the result data in a different sub-task program execution period, To a programmable logic controller or an external input device (SS17).

외부 구동장치(110, 120, 130, 210, 220, 230)는 결과 데이터를 수신하게 되며(SS18), 제1 프로그래머블 논리 제어장치(100)는 반복되는 메인 태스크 프로그램 수행 기간과 서브 태스크 프로그램 수행 기간 동안의 동작을 모두 수행했다면, 제1 프로그래머블 논리 제어장치(100)의 동작은 종료된다. The first programmable logic controller 100 receives the result data from the external drive units 110, 120, 130, 210, 220, and 230 (SS18) The operation of the first programmable logic controller 100 is ended.

이상, 전술한 바와 같은 본 발명의 실시 예에 따른 프로그래머블 논리 제어 시스템은 실시간 운영 체제를 이용하는 프로그래머블 논리 제어장치(100,200)들의 데이터 읽기/쓰기 시점이 데이터 읽기/쓰기 요청 시점과 동기화될 수 있도록 한다. 이에, 다수 프로그래머블 논리 제어장치(100,200)들 간의 프로그래밍 처리 정확성을 높일 수 있으며, 외부 장치들과도 데이터 입출력 시점을 동기화시켜 그 신뢰성을 향상시킬 수 있게 된다. As described above, the programmable logic control system according to the embodiment of the present invention enables the data read / write points of the programmable logic controllers 100 and 200 using the real-time operating system to be synchronized with the data read / write request point. Accordingly, it is possible to improve the accuracy of programming processing between the plurality of programmable logic controllers 100 and 200, and to improve the reliability by synchronizing the data input / output time with external devices.

이상과 같이 본 발명은 비록 한정된 실시 예와 도면에 의해 설명되었으나, 본 발명은 상기의 실시 예에 한정되는 것은 아니며, 이는 본 발명이 속하는 분야에서 통상의 지식을 가진 자라면 이러한 기재로부터 다양한 수정 및 변형이 가능하다. 따라서, 본 발명 사상은 아래에 기재된 특허청구범위에 의해서만 파악되어야 하고, 이의 균등 또는 등가적 변형 모두는 본 발명 사상의 범주에 속한다고 할 것이다. While the present invention has been particularly shown and described with reference to exemplary embodiments thereof, it is to be understood that the invention is not limited to the disclosed exemplary embodiments, but, on the contrary, Modification is possible. Accordingly, the spirit of the present invention should be understood only in accordance with the following claims, and all equivalents or equivalent variations thereof are included in the scope of the present invention.

100: 제1 프로그래머블 논리 제어장치
110,120: 제1 내지 제n 모터
130: 외부 LED(LEDn; Light Emitting Diode
140: 입력 접점
200: 제2 프로그래머블 논리 제어장치
210,220: 제1 내지 제 n 센서
230n: 제n 스위치
240: 입력 모듈
100: a first programmable logic controller
110, 120: first to nth motors
130: an external LED (Light Emitting Diode
140: Input contact
200: second programmable logic controller
210, 220: first to nth sensors
230n: nth switch
240: input module

Claims (6)

실시간 운영 체제를 기반으로 프로그램을 수행하는 기간 동안, 메인 태스크 프로그램을 우선순위로 상기 메인 태스크 프로그램과 서브 태스크 프로그램을 순차 수행하는 프로그래머블 논리 제어장치; 및
상기 프로그래머블 논리 제어장치의 제어에 따라 구동되는 적어도 하나의 외부 구동장치를 포함하며,
상기 프로그래머블 논리 제어장치는 다른 프로그래머블 논리 제어장치나 외부 입력장치를 통해 메시지 대기열 명령이 입력되면, 상기 메시지 대기열 명령에 따라 상기 메인 태스크 프로그램의 수행 순서를 변경하는
프로그래머블 논리 제어 시스템.
A programmable logic controller for sequentially executing the main task program and the sub-task program with a main task program as a priority in a period during which a program is executed based on a real-time operating system; And
And at least one external drive device driven under the control of the programmable logic controller,
The programmable logic controller changes the execution order of the main task program according to the message queue command when a message queue command is inputted through another programmable logic controller or external input device
Programmable logic control system.
제 1 항에 있어서,
상기 프로그래머블 논리 제어장치는
상기 메시지 대기열 명령이 입력되면, 상기 메시지 대기열 명령을 상기 서브 태스크 프로그램 수행 기간에 상기 메인 태스크 프로그램으로 전달하며,
상기 메인 태스크 프로그램의 수행 기간에 우선순위로 상기 메시지 대기열 명령에 따른 읽기/쓰기 동작을 수행하는
프로그래머블 논리 제어 시스템.
The method according to claim 1,
The programmable logic controller
When the message queue command is input, transmitting the message queue command to the main task program in the sub task program execution period,
Performing a read / write operation according to the message queue command with priority in the execution period of the main task program
Programmable logic control system.
제 2 항에 있어서,
상기 프로그래머블 논리 제어장치는
상기 메시지 대기열 명령에 따라 상기 메인 태스크 프로그램의 수행 기간에 상기 읽기/쓰기 동작을 수행한 결과 데이터를 생성하고,
상기 결과 데이터를 상기 메인 태스크 프로그램 수행 기간 이후의 다음 서브 태스크 프로그램으로 전달하는
프로그래머블 논리 제어 시스템.
3. The method of claim 2,
The programmable logic controller
Generating a resultant result of performing the read / write operation in the execution period of the main task program according to the message queue command,
And transfers the result data to the next subtask program after the main task program execution period
Programmable logic control system.
제 3 항에 있어서,
상기 프로그래머블 논리 제어장치는
상기 결과 데이터가 생성된 다음 순번으로 돌아오는 서브 태스크 프로그램 수행 기간에 상기 결과 데이터를 상기 다른 프로그래머블 논리 제어장치나 상기 외부 입력장치로 전송하는
프로그래머블 논리 제어 시스템.
The method of claim 3,
The programmable logic controller
The result data is transmitted to the other programmable logic controller or the external input device during a sub-task program execution period in which the result data is generated and returned to the next sequential number
Programmable logic control system.
제 1 항에 있어서,
상기 프로그래머블 논리 제어장치는
상기 실시간 운영 체제를 기반으로 프로그램을 수행하는 기간 동안, 미리 설정된 상기 메인 태스크 프로그램 수행 기간이 연속해서 반복되도록 하되,
상기 메인 태스크 프로그램 수행 기간에는
상기 메인 태스크 프로그램을 먼저 실행 및 처리한 후, 남아있는 시간에 상기 서브 태스크 프로그램을 실행하는
프로그래머블 논리 제어 시스템.
The method according to claim 1,
The programmable logic controller
Wherein the main task program execution period is continuously repeated during a period of executing a program based on the real-time operating system,
During the main task program execution period
The main task program is first executed and processed, and then the sub-task program is executed at the remaining time
Programmable logic control system.
제 5 항에 있어서,
상기 프로그래머블 논리 제어장치는
상기 남아있는 시간에 상기 서브 태스크 프로그램을 실행하다가 다시 상기 미리 설정된 상기 메인 태스크 프로그램 수행 기간이 반복되면, 다시 상기 메인 태스크 프로그램을 먼저 실행 및 처리하는
프로그래머블 논리 제어 시스템.
6. The method of claim 5,
The programmable logic controller
And when the main task program execution period is repeated again after executing the sub task program at the remaining time, the main task program is first executed and processed again
Programmable logic control system.
KR1020170051092A 2017-04-20 2017-04-20 Programmable logic control system KR101957400B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020170051092A KR101957400B1 (en) 2017-04-20 2017-04-20 Programmable logic control system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020170051092A KR101957400B1 (en) 2017-04-20 2017-04-20 Programmable logic control system

Publications (2)

Publication Number Publication Date
KR20180117927A true KR20180117927A (en) 2018-10-30
KR101957400B1 KR101957400B1 (en) 2019-06-19

Family

ID=64101025

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020170051092A KR101957400B1 (en) 2017-04-20 2017-04-20 Programmable logic control system

Country Status (1)

Country Link
KR (1) KR101957400B1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112491510A (en) * 2021-02-08 2021-03-12 南京神鹏机械设备有限公司 Signal processing method

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007004334A (en) * 2005-06-22 2007-01-11 Fuji Electric Fa Components & Systems Co Ltd Programmable controller
KR100696606B1 (en) * 2004-11-25 2007-03-19 강희승 Application program response time response time improvement method and the system At the OS which uses that low-power algorithm

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100696606B1 (en) * 2004-11-25 2007-03-19 강희승 Application program response time response time improvement method and the system At the OS which uses that low-power algorithm
JP2007004334A (en) * 2005-06-22 2007-01-11 Fuji Electric Fa Components & Systems Co Ltd Programmable controller

Also Published As

Publication number Publication date
KR101957400B1 (en) 2019-06-19

Similar Documents

Publication Publication Date Title
JP6797878B2 (en) How to compile
CN107407918B (en) Extending programmable logic controllers with app
CN100514234C (en) Open type numerical control system based on PC
US8327316B2 (en) Compilation model
US20070168082A1 (en) Task-based robot control system for multi-tasking
US10082777B2 (en) CPU unit for PLC, PLC-use system program, recording medium in which PLC-use system program is stored, PLC system, PLC support device, PLC support program, and recording medium in which PLC support program is stored
JP6797879B2 (en) Instruction set
CN109983411B (en) Flow control of program modules
CN110192159B (en) Control device
US10877803B2 (en) Control apparatus, control method and non-transitory storage medium
US20160091882A1 (en) System and method of multi-core based software execution for programmable logic controllers
KR101957400B1 (en) Programmable logic control system
US9152454B2 (en) Method for enabling sequential, non-blocking processing of statements in concurrent tasks in a control device
CN111095138B (en) Control device, control method for control device, information processing program, and recording medium
KR102228502B1 (en) Controlling timing in computer processing
CN113568333B (en) Data processing method, control system and equipment
KR20220138137A (en) Method and apparatus for processing programmable logic controller commands
US10768597B2 (en) Method and controller for flexible process control
KR100258893B1 (en) Numerical controller performance method with unified controller
CN112825034A (en) Execution and dynamic coordination of independent heterogeneous program units
Wang et al. Real Time Multi-tasking Applying to AC800M Controller
JP2007241434A (en) Sequence processing execution device

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