KR20130137478A - Programmable logic controller and method for examinating programmable logic controller - Google Patents
Programmable logic controller and method for examinating programmable logic controller Download PDFInfo
- Publication number
- KR20130137478A KR20130137478A KR1020120061128A KR20120061128A KR20130137478A KR 20130137478 A KR20130137478 A KR 20130137478A KR 1020120061128 A KR1020120061128 A KR 1020120061128A KR 20120061128 A KR20120061128 A KR 20120061128A KR 20130137478 A KR20130137478 A KR 20130137478A
- Authority
- KR
- South Korea
- Prior art keywords
- time
- command
- execution
- plc
- measuring
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01R—MEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
- G01R31/00—Arrangements for testing electric properties; Arrangements for locating electric faults; Arrangements for electrical testing characterised by what is being tested not provided for elsewhere
- G01R31/28—Testing of electronic circuits, e.g. by signal tracer
- G01R31/317—Testing of digital circuits
- G01R31/31725—Timing aspects, e.g. clock distribution, skew, propagation delay
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B19/00—Programme-control systems
- G05B19/02—Programme-control systems electric
- G05B19/04—Programme control other than numerical control, i.e. in sequence controllers or logic controllers
- G05B19/05—Programmable logic controllers, e.g. simulating logic interconnections of signals according to ladder diagrams or function charts
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01R—MEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
- G01R31/00—Arrangements for testing electric properties; Arrangements for locating electric faults; Arrangements for electrical testing characterised by what is being tested not provided for elsewhere
- G01R31/28—Testing of electronic circuits, e.g. by signal tracer
- G01R31/2832—Specific tests of electronic circuits not provided for elsewhere
- G01R31/2836—Fault-finding or characterising
- G01R31/2837—Characterising or performance testing, e.g. of frequency response
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Automation & Control Theory (AREA)
- General Engineering & Computer Science (AREA)
- Programmable Controllers (AREA)
Abstract
Description
본 발명은 PLC 및 PLC 검사 방법에 관한 것으로, 특히 PLC 명령어를 실행하는데 걸리는 시간을 측정하는 PLC 및 PLC 검사 방법에 관한 것이다.The present invention relates to a PLC and a PLC inspection method, and more particularly, to a PLC and a PLC inspection method for measuring the time taken to execute a PLC command.
산업 현장의 자동화 설비는 릴레이 등을 사용한 기계적인 장비로 구성된다. 기계적인 장비로 구성된 자동화 설비를 변경하기 위해서는 설비의 내부 회로 배선을 변경하여야 하는 어려움이 있다. 이와 같은 어려움을 극복하기 위하여 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는 릴레이, 타이머, 카운터 등과 같은 제어 장치의 기능을 수행하기 위하여 집적소자, 트랜지스터 등과 같은 반도체 소자를 사용한 것으로, 기본적인 시퀀스 제어 기능뿐만 아니라 수치 연산 기능이 추가되어 프로그램 제어가 가능하다. PLC는 PLC 내부의 메모리에 미리 저장된 프로그램의 시작과 끝을 순환하면서 소정의 로직을 수행하며, PLC를 이용하여 설비의 내부 회로 배선을 변경하지 않고도 자동화 설비를 제어할 수 있다.The PLC uses a semiconductor device such as an integrated device, a transistor, etc. to perform a function of a control device such as a relay, a timer, a counter, and the like. In addition to the basic sequence control function, a numerical operation function is added to enable program control. The PLC performs predetermined logic while circulating the beginning and the end of the program stored in the memory inside the PLC in advance, and the PLC can control the automation facility without changing the internal circuit wiring of the facility.
PLC는 다양한 기능을 수행하므로, PLC의 성능을 검증하는 검사의 종류도 다양하다. PLC의 성능을 검증하는 검사를 모두 거치면, 장시간의 검사 시간이 소비되고, 이에 따라 검사자가 피로하게 되어 오류가 발생할 확률이 높아지며, 과다한 검사 비용이 발생한다. 따라서, 검사 시간을 단축할 필요가 있다.Since the PLC performs various functions, there are various types of inspections to verify the performance of the PLC. If all of the inspections verifying the performance of the PLC are performed, a long inspection time is consumed, which leads to fatigue of the inspector, thereby increasing the probability of error and excessive inspection cost. Therefore, it is necessary to shorten the inspection time.
본 발명은 사용자가 PLC 명령어의 실행 시간을 정확하게 측정할 수 있도록 PLC의 명령어 처리 성능 검사에 신뢰성을 제공하는 PLC 및 PLC 검사 방법을 제공한다.The present invention provides a PLC and a PLC inspection method that provides reliability for the instruction processing performance inspection of the PLC so that the user can accurately measure the execution time of the PLC instruction.
또한, 본 발명은 PLC 명령어의 실행 시간을 짧은 측정 시간 내에 용이하게 측정할 수 있는 PLC 및 PLC 검사 방법을 제공한다.In addition, the present invention provides a PLC and a PLC inspection method that can easily measure the execution time of a PLC command within a short measurement time.
본 발명의 일 실시 예에 따른 PLC 상에서 명령어 실행 시간을 측정하여 PLC 성능을 검사하는 방법은 명령어 실행에 앞서, 제1 시각을 측정하는 단계, 상기 명령어 실행이 끝나면, 제2 시각을 측정하는 단계 및 상기 제1 시각, 상기 제2 시각, 상기 명령어 실행을 위한 대기 시간을 이용하여 상기 명령어 실행 시간을 계산하는 단계를 포함한다.According to an embodiment of the present invention, a method of checking a PLC performance by measuring an instruction execution time on a PLC may include measuring a first time before executing the instruction, measuring a second time after the execution of the instruction, and Calculating the command execution time using the first time, the second time, and the waiting time for executing the command.
또한, 본 발명의 일 실시 예에 따른 명령어 실행 시간을 측정하여 PLC 성능을 검사하는 PLC는 명령어 실행에 앞서 제1 시각을 측정하고, 상기 명령어 실행이 끝나면 제2 시각을 측정하는 시각 측정부, 상기 제1 시각, 상기 제2 시각, 상기 제1 시각 측정 및 상기 제2 시각 측정에 소요되는 시간, 명령어 실행 제어 정보를 처리하는 시간을 이용하여 상기 명령어 실행 시간을 계산하는 계산부 및 외부 인터럽트 신호를 차단하는 신호 차단부를 포함한다.In addition, the PLC for checking the performance of the PLC by measuring the execution time of the command according to an embodiment of the present invention is a time measuring unit for measuring the first time before executing the command, and measuring the second time after the execution of the command, A calculation unit and an external interrupt signal for calculating the instruction execution time by using a first time, the second time, the time spent on the first time measurement and the second time measurement, and the time of processing the instruction execution control information. And a signal blocking unit for blocking.
본 발명에 따르면, 사용자가 PLC 명령어의 실행 시간을 정확하게 측정할 수 있으므로 PLC 명령어 처리 성능 검사에 있어서 신뢰성을 제공할 수 있다.According to the present invention, since the user can accurately measure the execution time of the PLC instruction, it can provide reliability in the PLC instruction processing performance check.
또한, 본 발명에 따르면 PLC 명령어의 실행 시간을 짧은 측정 시간 내에 용이하게 측정할 수 있다.In addition, according to the present invention, the execution time of the PLC command can be easily measured within a short measurement time.
도 1은 본 발명의 일 실시 예에 따른 PLC의 구성도이다.
도 2는 본 발명의 일 실시 예에 따른 시간 측정 시작 명령어를 설명하기 위한 블록 구성도이다.
도 3은 본 발명의 일 실시 예에 따른 시간 측정 종료 명령어를 설명하기 위한 블록 구성도이다.
도 4는 본 발명의 일 실시 예에 따른 LD(ladder) 프로그램 작성 순서를 설명하기 위한 순서도이다.
도 5는 본 발명의 일 실시 예에 따른 명령어 실행 시간 측정 방법을 설명하기 위한 순서도이다.1 is a block diagram of a PLC according to an embodiment of the present invention.
2 is a block diagram illustrating a time measurement start command according to an embodiment of the present invention.
3 is a block diagram illustrating a time measurement termination command according to an embodiment of the present invention.
4 is a flowchart illustrating a procedure of preparing a LD program according to an embodiment of the present invention.
5 is a flowchart illustrating a method of measuring an instruction execution time according to an exemplary embodiment.
이하 도면을 참조하여 본 발명의 실시 예를 상세히 설명한다.Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
도 1은 본 발명의 일 실시 예에 따른 PLC의 구성도이다.1 is a block diagram of a PLC according to an embodiment of the present invention.
도 1을 참조하면, 본 발명의 일 실시 예에 따른 PLC(100)는 시각 측정부(101,105,107), 신호 차단부(103) 및 계산부(109)를 포함한다.Referring to FIG. 1, the
시각 측정부(101,105,107)는 명령어 실행에 앞서 제1 시각을 측정하고, 명령어 실행이 끝나면 제2 시각을 측정할 수 있다. 시각 측정부(101,105,107)가 시각을 측정할 수 있도록, 본 발명의 일 실시 예에 따르면 명령어 실행 시간 측정 명령어를 사용할 수 있다. 즉, 시각 측정(101,105,107)부는 실행 시간 측정의 대상이 되는 대상 명령어 실행 제어 정보를 포함하는 시간 측정 시작 명령어와 시간 측정 종료 명령어를 실행시킴으로써, 명령어 실행의 시작 시각과 종료 시각을 측정할 수 있다. 시각 측정부는 수신부(101), 저장부(105), 명령어 실행부(107)를 포함한다.The
수신부(101)는 대상 명령어 실행 제어 정보를 포함하는 시간 측정 시작 명령어 데이터 및 시간 측정 종료 명령어 데이터를 수신할 수 있다. The
수신부(101)가 수신하는 시간 측정 시작 명령어 데이터는 대상 명령어 실행을 제어하는데 필요한 정보를 포함할 수 있다. 수신부(101)가 수신한 대상 명령어 실행 제어 정보에 따라 명령어 실행부(107)가 대상 명령어를 실행시킬 수 있다. 수신부(101)는 시간 측정 시작 인에이블 신호를 수신하는 시작 인에이블 입력부, 대상 명령어의 입출력 파라미터 개수 정보를 수신하는 입출력 파라미터 개수 입력부, 입출력 파라미터가 배열 타입인지에 관한 정보를 수신하는 배열 타입 파라미터 입력부, 입출력 파라미터의 배열 크기 정보를 수신하는 배열 크기 입력부, 대상 명령어의 실행 횟수 정보를 수신하는 반복 횟수 입력부 및 측정 대상 입력부를 포함할 수 있다.The time measurement start command data received by the
저장부(105)는 시간 측정 시작 명령어 실행에 따른 제1 시각 및 시간 측정 종료 명령어 실행에 따른 제2 시각을 저장할 수 있다. 제1 시각 정보는 대상 명령어 실행 시작 시각이 될 수 있고, 제2 시각 정보는 대상 명령어 실행 종료 시각이 될 수 있다.The
명령어 실행부(107)는 대상 명령어를 실행할 수 있다.The
신호 차단부(103)는 명령어 실행 시간이 보다 정확하게 측정될 수 있도록 대상 명령어가 실행되는 시간 동안, 외부 인터럽트 신호를 차단한다.The
계산부(109)는 수신부(101), 저장부(105), 명령어 실행부(107)로부터 수신한 제1 시각, 제2 시각, 명령어 실행을 위한 대기 시간을 이용하여 대상 명령어의 실행 시간을 계산할 수 있다. 즉, 제1 시각과 제2 시각의 시간 차이를 계산한 후, 이로부터 명령어 실행을 위한 대기 시간을 제외함으로써, 대상 명령어가 실행되는데만 걸린 시간을 보다 정확하게 계산할 수 있다. 이때, 명령어 실행을 위한 대기 시간은 예컨대, 시간 측정 시작 명령어 실행에 따른 제1 시각 측정 단계, 시간 측정 종료 명령어 실행에 따른 제2 시각 측정 단계 및 대상 명령어 실행 제어 정보를 처리하는데 걸리는 시간을 포함할 수 있다.The
도 2는 본 발명의 일 실시 예에 따른 시간 측정 시작 명령어를 설명하기 위한 블록 구성도이다.2 is a block diagram illustrating a time measurement start command according to an embodiment of the present invention.
도 2를 참조하면, 대상 명령어의 실행 시간 측정을 시작하는 명령어의 기능 블록(function block)(200)은 시작 인에이블(enable) 입력부(201), 입력 파라미터 개수 입력부(203), 출력 파라미터 개수 입력부(205), 배열 타입 파라미터 입력부(207), 배열 크기 입력부(209), 반복 횟수 입력부(211), 측정 대상 입력부(213) 및 시간 측정 시작 출력부(221)를 포함한다.Referring to FIG. 2, a
본 발명의 일 실시 예에 따른 시간 측정 시작 명령어는 대상 명령어가 PLC 상에서 실행되는데 걸리는 시간을 측정하기 위한 새로운 명령어이다. 개발자는 본 발명의 시간 측정 시작 명령어를 PLC 프로그램에 포함할 수 있고, 사용자가 시간 측정 시작 명령어를 포함하는 프로그램을 작성하여 PLC 상에서 구동시킬 수 있다. 시간 측정 시작 명령어를 실행하기 위하여 필요한 입출력 신호 및 입출력 신호의 데이터 타입은 다음과 같다. 참고로, BOOL(boolean) 타입 데이터는 1비트 데이터로서 '0' 또는 '1'의 데이터 범위를 가지고, UINT(unsigned integer) 타입 데이터는 16비트 데이트로서 '0 내지 65535'의 데이터 범위를 가지며, 데이터 타입이 이에 한정되는 것은 아니다. The start time measurement command according to an embodiment of the present invention is a new command for measuring the time taken for the target command to be executed on the PLC. The developer may include the time measurement start command of the present invention in the PLC program, and the user may write a program including the time measurement start command and run it on the PLC. I / O signals and data types of I / O signals required to execute the start time measurement command are as follows. For reference, BOOL (boolean) type data is 1-bit data and has a data range of '0' or '1', and UINT (unsigned integer) type data has 16-bit data and has a data range of '0 to 65535'. The data type is not limited thereto.
시작 인에이블 입력부(201)는 시간 측정 시작 명령어가 실행되도록 또는 실행되지 않도록 상태를 전환하는 신호를 입력받을 수 있다. 시작 인에이블 입력부(201)가 '1' 또는 'TRUE'를 입력받으면 시간 측정 시작 명령어가 실행되고, '0' 또는 'FALSE'를 입력받으면 시간 측정 시작 명령어가 실행되지 않도록, 시작 인에이블 입력부(201)는 BOOL 타입 데이터를 입력받을 수 있다.The start enable
입력 파라미터 개수 입력부(203)는 대상 명령어의 입력 파라미터 개수를 입력받을 수 있다. 입력 파라미터란 예컨대, 시간 측정 명령어 기능 블록(200)의 좌측에 형성된 파라미터를 의미하고, 이때, 입력 파라미터 개수는 7개가 된다. 이와 같이 측정 대상이 되는 명령어의 기능 블록을 가정하였을 때, 대상 명령어 기능 블록의 입력부에 설정되는 파라미터 개수의 총합이 입력 파라미터 개수 입력부(203)에 입력될 수 있다. 입력 파라미터 개수 입력부(203)는 UINT 타입의 데이터를 입력받을 수 있고, 이에 한정되는 것은 아니다.The input parameter
출력 파라미터 개수 입력부(205)는 대상 명령어의 출력 파라미터 개수를 입력받을 수 있다. 출력 파라미터란, 대상이 되는 명령어의 기능 블록을 가정하였을 때, 대상 명령어 기능 블록의 출력부에 설정되는 파라미터 개수의 총합이다. 출력 파라미터 개수 입력부(205)는 UINT 타입 데이터를 입력받을 수 있다.The output parameter
본 발명의 일 실시 예에 따르면, 대상 명령어의 실행 시간을 측정하기 위하여, 시간 측정 명령어라는 새로운 명령어가 실행된다. 따라서, 본 발명의 목적인 대상 명령어의 실행 시간을 계산하기 위해서는, 대상 명령어 실행 시간 외의 시간 측정 명령어가 실행되는 동안 소비되는 시간을 참고하여야 한다. 앞서 설명한 입력 및 출력 파라미터 개수는, 대상 명령어 실행이 아닌 시간 측정 명령어 실행에 소비되는 시간 중 입력 데이터가 전달되는 시간을 계산하기 위한 참고 자료로 사용된다.According to one embodiment of the present invention, in order to measure the execution time of the target instruction, a new instruction called a time measurement instruction is executed. Therefore, in order to calculate the execution time of the target instruction, which is an object of the present invention, it is necessary to refer to the time consumed while executing the time measurement instruction other than the target instruction execution time. The number of input and output parameters described above is used as a reference for calculating the time for input data to be transmitted among the time spent for executing the time measurement instruction, not for executing the target instruction.
배열 타입 파라미터 입력부(207)는 대상 명령어의 입력 또는 출력 파라미터가 배열 타입인지 여부를 알려주는 신호를 입력받는다. 배열 타입은 파라미터에 입력되는 데이터 형태가 변수인 것으로, 하나의 변수에 여러 개의 상수가 입력되는 경우를 의미한다. 배열 타입 파라미터 입력부(207)는 BOOL 타입 데이터를 입력받을 수 있고 이때, 대상 명령어의 입력 또는 출력 파라미터가 배열 타입에 해당하면 'TRUE'를, 입, 출력 데이터가 모두 배열 타입이 아니라면 'FALSE'를 입력받을 수 있다.The array type
배열 크기 입력부(209)는 배열 타입 파라미터 입력부(207)가 'TRUE'를 입력받은 경우에 한하여 데이터 배열의 크기를 입력받고, 배열 타입 파라미터 입력부(207)가 'FALSE'를 입력받은 경우에는 '0'를 입력받는다.The array
반복 횟수 입력부(211)는 대상 명령어가 2회 이상 반복하여 실행되는 경우에 한하여, 대상 명령어 실행이 반복된 횟수를 입력받을 수 있다.The repetition
측정 대상 입력부(213)는 실행 시간 측정의 대상에 대한 데이터를 입력받을 수 있다. 실행 시간 측정 대상은 명령어뿐만 아니라, 일반적인 구간이 될 수 있다. 측정 대상 입력부(213)가 BOOL 타입 데이터를 입력받는 경우를 예로 들면, 'FALSE'가 입력되는 경우에는 본 발명의 일 실시 예에서 설명한 것과 같이 대상 명령어의 실행 시간이 측정되고, 'TRUE'가 입력되는 경우에는 명령어 실행 시간이 아닌, 프로그램의 일반적인 구간이 측정된다.The measurement
시간 측정 시작 출력부(221)는 시간 측정 시작 명령어가 오류 없이 실행되는지 여부를 알려주는 신호를 출력한다. 시간 측정 시작 출력부(221)가 BOOL 타입 데이터를 출력하는 경우를 예로 들면, 시간 측정 시작 명령어 기능 블록(200)이 오류 없이 시간 측정 시작을 실행하면 'TRUE'를 출력하고, 시간 측정 시작에 오류가 발생하면 'FALSE'를 출력한다.The time measurement
도 3은 본 발명의 일 실시 예에 따른 시간 측정 종료 명령어를 설명하기 위한 블록 구성도이다.3 is a block diagram illustrating a time measurement termination command according to an embodiment of the present invention.
도 3을 참조하면, 대상 명령어의 실행 시간 측정을 종료하는 명령어의 기능 블록(300)은 종료 인에이블 입력부(301), 시간 측정 종료 출력부(311), 측정 시간 출력부(313), 최대 시간 출력부(315), 최소 시간 출력부(317)를 포함한다.Referring to FIG. 3, the
본 발명의 실시 예에 따른 시간 측정 종료 명령어는 대상 명령어가 PLC 상에서 실행되는데 걸리는 시간 측정의 종료를 위한 새로운 명령어이다. 시간 측정 종료 명령어를 실행하기 위하여 필요한 입출력 신호 및 입출력 신호의 데이터 타입은 다음과 같으며, 입출력 신호가 특정 데이터 타입에 한정되는 것은 아니다. 개발자는 본 발명의 시간 측정 종료 명령어를 PLC 프로그램에 포함할 수 있고, 사용자가 시간 측정 종료 명령어를 포함하는 프로그램을 작성하여 PLC 상에서 구동시킬 수 있다.The time measurement end command according to the embodiment of the present invention is a new command for terminating the time measurement that is required to execute the target command on the PLC. The data types of the input / output signal and the input / output signal required for executing the time measurement end command are as follows, and the input / output signal is not limited to a specific data type. The developer may include the time measurement end command of the present invention in the PLC program, and the user may write a program including the time measurement end command and run it on the PLC.
종료 인에이블 입력부(301)는 시간 측정 종료 명령어가 실행되도록 또는 실행되지 않도록 상태를 전환하는 신호를 입력받을 수 있다. 종료 인에이블 입력부(301)가 '1' 또는 'TRUE'를 입력받으면 시간 측정 종료 명령어가 실행되고, '0' 또는 'FALSE'를 입력받으면 시간 측정 종료 명령어가 실행되지 않도록, 종료 인에이블 입력부(301)는 BOOL 타입 데이터를 입력받을 수 있다.The end enable
시간 측정 종료 출력부(311)는 시간 측정 종료 명령어가 오류 없이 실행되는지 여부를 알려주는 신호를 출력한다. 시간 측정 종료 출력부(311)가 BOOL 타입 데이터를 출력하는 경우를 예로 들면, 시간 측정 종료 명령어 기능 블록(300)이 오류 없이 시간 측정 종료를 실행하면 'TRUE'를 출력하고, 시간 측정 종료에 오류가 발생하면 'FALSE'를 출력한다.The time measurement
측정 시간 출력부(313)는 대상 명령어 실행 시간을 출력한다. 또한, 반복 횟수 입력부(211)에 2 이상의 횟수가 입력되는 경우, 측정 시간 출력부(313)는 대상 명령어가 실행된 전체 시간을 반복 횟수 입력부(211)에 입력된 횟수로 나눈 결과를 출력할 수 있다.The measurement
최대 시간 출력부(315)는 반복 횟수 입력부(211)에 입력된 UINT 데이터가 2 이상인 경우에 한하여, 대상 명령어가 한 번 실행되는데 걸리는 시간 중 가장 오래 걸린 시간을 출력한다.The maximum
최소 시간 출력부(317)는 반복 횟수 입력부(211)에 입력된 UINT 데이터가 2 이상인 경우에 한하여, 대상 명령어가 한 번 실행되는데 걸리는 시간 중 가장 적게 걸린 시간을 출력한다. 최대 시간 및 최소 시간을 출력함으로써, 대상 명령어 실행이 반복되는 경우에 발생하는 오류를 검출할 수 있다.The minimum
대상 명령어의 실행 시간 측정을 시작하는 명령어 기능 블록(200) 및 시간 측정을 종료하는 명령어 기능 블록(300)은 한 쌍으로 동작한다.The
도 4는 본 발명의 일 실시 예에 따른 LD(ladder) 프로그램 작성 순서를 설명하기 위한 순서도이다.4 is a flowchart illustrating a procedure of preparing a LD program according to an embodiment of the present invention.
도 4를 참조하면, 시간 측정 시작 명령어 기능 블록(200) 및 시간 측정 종료 명령어 기능 블록(300)은 한 쌍으로 동작하며, 그 순서는 LD 프로그램의 작성 순서와 동일하다. LD 프로그램은 릴레이 로직 다이어그램에서 사용하는 그래픽 기호를 사용하여 PLC 프로그램을 표현한 것이다.Referring to FIG. 4, the time measurement start
먼저, 시간 측정 시작 명령어가 실행되면(S401), 대상 명령어를 삽입한 후(S403), 대상 명령어가 실행되면 시간 측정 종료 명령어가 실행된다(S405). 대상 명령어의 실행 시간을 구하기 위하여, 시간 측정 시작 명령어 실행시 및 시간 측정 종료 명령어 실행시 두 시점의 시각을 저장한 후, 양 시점의 시간 차이에서 대상 명령어 실행 이외의 프로세스가 실행되는 시간을 제외함으로써, 대상 명령어 실행 시간을 보다 정확하게 계산할 수 있다(S407). 이때, 프로그램 연산시 걸리는 1 스캔 타임(scan time)이 밀리 초(milisecond) 단위인 반면, 명령어 실행 시간은 마이크로 초(microsecond) 단위이므로, 명령어를 사용하여 명령어 실행 시간을 측정하면 보다 정확하고, 용이하게 측정할 수 있으며 측정 시간을 단축할 수 있다.First, when the time measurement start command is executed (S401), after inserting the target command (S403), when the target command is executed, the time measurement end command is executed (S405). In order to obtain the execution time of the target instruction, by storing the time of two time points when executing the time measurement start command and executing the time measurement end instruction, the time difference between the two time points is subtracted by excluding the time when the process other than the target command execution is executed. , It is possible to more accurately calculate the target instruction execution time (S407). In this case, while one scan time required for program operation is in milliseconds, while the instruction execution time is in microseconds, it is more accurate and easier to measure the instruction execution time using the instruction. The measurement time can be measured and the measurement time can be shortened.
도 5는 본 발명의 일 실시 예에 따른 명령어 실행 시간 측정 방법을 설명하기 위한 순서도이다.5 is a flowchart illustrating a method of measuring an instruction execution time according to an exemplary embodiment.
도 5를 참조하면, PLC 프로그램의 첫 번째 단계인 자기 진단, 데이터 클리어, 입력 이미지 영역 리프레시(refresh) 등의 초기화 처리 과정이 끝나면 프로그램 연산 처리 시작 단계가 완료된다(S501).Referring to FIG. 5, when an initialization process such as self-diagnosis, data clear, input image region refresh, etc., which are the first stages of the PLC program, is completed, the program operation process start step is completed (S501).
이어서, 시작 인에이블 입력부(201)가 '1' 또는 'TRUE'를 입력받으면 시간 측정 시작 명령어가 실행된다(S503). 본 발명의 일 실시 예로서, 시간 측정 시작 명령어가 실행되면 대상 명령어 실행에 앞서 제1 시각 측정이 시작된다. 시간 측정 시작 명령어 데이터는 대상 명령어 실행 제어 정보인 대상 명령어의 입출력 파라미터의 개수, 배열 타입, 배열 크기 등의 입력 데이터를 포함한다.Subsequently, when the start enable
이어서, 명령어가 실행되는 동안에 발생할 수 있는 외부 인터럽트(interrupt) 신호가 차단된다(S505). 대상 명령어 실행 시간을 측정하는 도중에 외부 인터럽트 신호가 발생하는 것을 차단함으로써, 대상 명령어 실행 시간을 정확히 측정할 수 있다.Subsequently, an external interrupt signal that may occur while the command is being executed is blocked (S505). By blocking the occurrence of an external interrupt signal while measuring the target instruction execution time, the target instruction execution time can be accurately measured.
이어서, 시작 시각을 CPU 메모리에 저장할 수 있다(S507). 시간 측정 시작 명령어가 실행되면, 제1 시작 시각인 대상 명령어의 실행 시작 시각이 CPU 메모리에 저장된다.Subsequently, the start time can be stored in the CPU memory (S507). When the time measurement start instruction is executed, the execution start time of the target instruction which is the first start time is stored in the CPU memory.
대상 명령어가 실행되기 전에, 시간 측정 시작 명령어 기능 블록(200)의 입력 파라미터 개수 입력부(203), 출력 파라미터 개수 입력부(205), 배열 타입 파라미터 입력부(207), 배열 크기 입력부(209)가 수신한 대상 명령어의 입출력 파라미터의 개수, 배열 타입, 배열 크기 등의 입력 데이터가 대상 명령어를 실행하는 레지스터로 전달된다(S509). 입력 데이터가 전달되는 시간을 고려하면 대상 명령어가 실행되는 시간 이외에 소비되는 시간을 계산할 수 있다.Before the target command is executed, the input parameter
반복 횟수 입력부(211)에 반복 횟수가 입력되지 않으면(S511), 대상 명령어는 1회 실행된다(S515). If the number of repetitions is not input to the repetition number input unit 211 (S511), the target command is executed once (S515).
반면에, 반복 횟수 입력부(211)에 2 이상의 반복 횟수가 입력되면(S511), 대상 명령어는 입력된 횟수만큼 반복 실행된다(S513). 대상 명령어가 반복 실행된 결과, 대상 명령어 실행 시간의 평균값이 계산될 수 있다. 평균값으로 계산된 실행 시간은 1회 측정된 실행 시간보다 정확하므로, 본 발명의 목적이 달성될 수 있다.On the other hand, if two or more repetitions are input to the repetition number input unit 211 (S511), the target command is repeatedly executed as many times as the input times (S513). As a result of the target command being repeatedly executed, the average value of the target command execution time may be calculated. Since the execution time calculated as the average value is more accurate than the execution time measured once, the object of the present invention can be achieved.
이어서, 반복 횟수 입력부(211)에 입력된 횟수만큼 대상 명령어가 실행되면, 반복이 종료된다(S517).Subsequently, when the target instruction is executed the number of times input to the repetition
대상 명령어가 실행되면, 종료 인에이블 입력부(301)가 '1' 또는 'TRUE'를 입력받아 시간 측정 종료 명령어가 실행된다(S519). 시간 측정 종료 명령어가 실행되면(S519), 제2 시각인 대상 명령어의 실행 종료 시각이 저장된다(S521). 실행 종료 시각은 시간 측정 명령어를 실행하는 레지스터에 저장될 수 있다. 또한, 도면 부호 S507 단계에서 저장한 시작 시각을 CPU 메모리에서 읽어온 후, 제1 및 제2 시각 정보를 이용하여 종료 시각과 시작 시각의 시간 차이를 구할 수 있다. 대상 명령어 실행을 반복한 경우에는 종료 시각과 시작 시각의 시간 차이로부터 구한 실행 측정 시간을 반복 횟수로 나누어 실행 시간의 평균값을 구할 수 있다.When the target command is executed, the end enable
이어서, 도면 부호 S505 단계에서 차단한 외부 인터럽트 신호를 허용한다(S523).Subsequently, the external interrupt signal blocked in step S505 is allowed (S523).
이어서, 시간 보정 단계(S525)에서는 실행 측정 시간에서 대상 명령어 실행 시간이 아닌 시간을 제외한다. 앞서 도면 부호 S521을 참조하여 설명한 CPU 메모리로부터 실행 시작 시각을 읽어와 실행 종료 시각과의 시간 차이를 구하는 단계, 실행 시간의 평균값을 구하는 단계 등의 측정 시간을 구하는 단계는 시간 보정 단계(S525)에서도 실행될 수 있다. 대상 명령어 실행 시간이 아닌 시간은 예컨대, 대상 명령어 처리 전후에 시간 측정 시작 및 종료 정보에 따라 시간 측정 시작 및 종료 명령어 처리에 소비된 시간, 데이터 전달에 소비된 시간, 배열 처리에 소비된 시간 등을 포함한다. 참고로, 대상 명령어 실행 제어시 소비되는 시간인 데이터 전달에 소비된 시간, 배열 처리에 소비된 시간 등의 시간은 입력 데이터를 참고하여 계산할 수 있다.Subsequently, in the time correction step S525, a time other than the execution time of the target instruction is excluded from the execution measurement time. The step of obtaining the measurement time such as reading the execution start time from the CPU memory described above with reference to reference numeral S521 and calculating the time difference from the execution end time, and calculating the average value of the execution time is also performed in the time correction step (S525). Can be executed. The time other than the target instruction execution time is, for example, the time spent for processing the time measurement start and end instructions according to the time measurement start and end information before and after the target instruction processing, the time spent for data transfer, the time spent for array processing, and the like. Include. For reference, time such as time spent in data transfer, time spent in array processing, etc., which is time spent controlling execution of a target instruction, may be calculated by referring to input data.
측정 시간 출력부(313)는 계산이 완료된 대상 명령어의 실행 시간을 출력할 수 있다(S527).
The measurement
이상의 설명은 본 발명의 기술 사상을 예시적으로 설명한 것에 불과한 것으로서, 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자라면 본 발명의 본질적인 특성에서 벗어나지 않는 범위에서 다양한 수정 및 변형이 가능할 것이다.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.
100: PLC 101: 수신부
103: 신호 차단부 105: 저장부
107: 명령어 실행부 109: 계산부
200: 시간 측정 시작 명령어 기능 블록
201: 시작 인에이블 입력부 203: 입력 파라미터 개수 입력부
205: 출력 파라미터 개수 입력부 207: 배열 타입 파라미터 입력부
209: 배열 크기 입력부 211: 반복 횟수 입력부
213: 측정 대상 입력부 221: 시간 측정 시작 출력부
300: 시간 측정 종료 명령어 기능 블록
301: 종료 인에이블 입력부 311: 시간 측정 종료 출력부
313: 측정 시간 출력부 315: 최대 시간 출력부
317: 최소 시간 출력부100: PLC 101: Receiver
103: signal blocking unit 105: storage unit
107: instruction execution unit 109: calculation unit
200: Start time measurement function block
201: start enable input unit 203: input parameter number input unit
205: output parameter number input unit 207: array type parameter input unit
209: array size input unit 211: repeat count input unit
213: measurement target input unit 221: time measurement start output unit
300: Time Measurement End Command Function Block
301: end enable input unit 311: time measurement end output unit
313: measurement time output unit 315: maximum time output unit
317: minimum time output unit
Claims (4)
명령어 실행에 앞서, 제1 시각을 측정하는 단계;
상기 명령어 실행이 끝나면, 제2 시각을 측정하는 단계; 및
상기 제1 시각, 상기 제2 시각, 상기 명령어 실행을 위한 대기 시간을 이용하여 상기 명령어 실행 시간을 계산하는 단계를 포함하는
PLC 검사 방법.In the method of checking the PLC performance by measuring the instruction execution time on the PLC,
Measuring a first time prior to executing the command;
Measuring execution of a second time after the execution of the command; And
Calculating the execution time of the command using the first time, the second time, and a waiting time for executing the command.
PLC inspection method.
외부 인터럽트 신호를 차단하는 단계를 더 포함하는
PLC 검사 방법.The method according to claim 1,
Blocking the external interrupt signal further;
PLC inspection method.
상기 명령어 실행 시간을 계산하는 단계는
상기 제1 시각 및 상기 제2 시각의 시간 차이를 계산하는 단계; 및
상기 계산한 시간 차이로부터 상기 명령어 실행을 위한 대기 시간인 상기 제1 시각 측정 단계 및 상기 제2 시각 측정 단계에서 소요되는 시간, 명령어 실행 제어 정보를 처리하는 시간을 제외하는 단계를 포함하는
PLC 검사 방법.The method according to claim 1,
Calculating the execution time of the command
Calculating a time difference between the first time and the second time; And
Excluding the time spent in the first time measurement step and the second time measurement step, the time for processing command execution control information, which is a waiting time for executing the command, from the calculated time difference.
PLC inspection method.
명령어 실행에 앞서 제1 시각을 측정하고, 상기 명령어 실행이 끝나면 제2 시각을 측정하는 시각 측정부;
상기 제1 시각, 상기 제2 시각, 상기 제1 시각 측정 및 상기 제2 시각 측정에 소요되는 시간, 명령어 실행 제어 정보를 처리하는 시간을 이용하여 상기 명령어 실행 시간을 계산하는 계산부; 및
외부 인터럽트 신호를 차단하는 신호 차단부를 포함하는
PLC.In PLC that checks PLC performance by measuring instruction execution time,
A time measuring unit measuring a first time prior to executing the command and measuring a second time after the execution of the command;
A calculator configured to calculate the command execution time using the first time, the second time, the time spent on the first time measurement and the second time measurement, and the time of processing command execution control information; And
A signal blocking unit for blocking an external interrupt signal
PLC.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020120061128A KR20130137478A (en) | 2012-06-07 | 2012-06-07 | Programmable logic controller and method for examinating programmable logic controller |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020120061128A KR20130137478A (en) | 2012-06-07 | 2012-06-07 | Programmable logic controller and method for examinating programmable logic controller |
Publications (1)
Publication Number | Publication Date |
---|---|
KR20130137478A true KR20130137478A (en) | 2013-12-17 |
Family
ID=49983702
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
KR1020120061128A KR20130137478A (en) | 2012-06-07 | 2012-06-07 | Programmable logic controller and method for examinating programmable logic controller |
Country Status (1)
Country | Link |
---|---|
KR (1) | KR20130137478A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10012972B2 (en) | 2014-10-30 | 2018-07-03 | Lsis Co., Ltd. | PLC system providing a web based service |
KR20190057698A (en) * | 2017-11-20 | 2019-05-29 | 인곡산업 주식회사 | Vision inspection equipment platform to check the quality of endmill |
-
2012
- 2012-06-07 KR KR1020120061128A patent/KR20130137478A/en not_active Application Discontinuation
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10012972B2 (en) | 2014-10-30 | 2018-07-03 | Lsis Co., Ltd. | PLC system providing a web based service |
KR20190057698A (en) * | 2017-11-20 | 2019-05-29 | 인곡산업 주식회사 | Vision inspection equipment platform to check the quality of endmill |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR101006787B1 (en) | Peripheral device of programmable logic controller | |
CN108122596B (en) | Memory test method and device | |
RU2675404C1 (en) | Compressed air flow rate determining method, computational device for this and information media | |
CN113342669A (en) | Verification method and device for shortening convergence time of chip code coverage rate | |
CN109283833A (en) | A kind of time statistical system and method | |
KR20130137478A (en) | Programmable logic controller and method for examinating programmable logic controller | |
US20150058502A1 (en) | I/o device, programmable logic controller, and operation method | |
CN112540290A (en) | Test method and device for clock frequency calibration, storage medium and terminal | |
JP5982845B2 (en) | Trace control apparatus and trace control method | |
CN113898479A (en) | Method for verifying engine parameter protection measures | |
CN110059390B (en) | Device under test verification device and related product | |
CN111640096B (en) | Method, device and terminal for detecting appearance of electronic product | |
CN108269004B (en) | Product life analysis method and terminal equipment | |
CN106896309A (en) | Signal processing apparatus and method, signal offset detection system and method | |
JP6089627B2 (en) | Power consumption estimation apparatus and power consumption estimation method | |
CN109863410B (en) | Method and system for measuring power-on reset time | |
US7844408B2 (en) | System and method for time domain reflectometry testing | |
CN104021059A (en) | System and method for generating test signal for sequence of event | |
KR101409070B1 (en) | Apparatus and method for data processing | |
CN115051762B (en) | Line loss calibration method, device, system, medium and equipment | |
CN117033113B (en) | Control circuit and method for signal delay | |
KR101135747B1 (en) | Method and computer-readable recording medium for controlling a measuring instrument based on ipc communications | |
JP2016146032A (en) | Software covering testing device and method | |
CN115732025A (en) | Method and device for verifying access conflict of RAM (random Access memory) | |
Boyarnikov et al. | A hardware-software system for the automation of verification and calibration of oil metering units secondary equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
WITN | Withdrawal due to no request for examination |