본 발명은 통신 프레임의 엔코딩 방법에 관한 것으로서, 보다 상세하게는 통신 프레임(Frame)의 시작과 끝을 나타내는 콘트롤 바이트(Control Byte)를 정의하고, 통신 프레임에서 콘트롤 바이트 이외의 실제 데이터 영역이 콘트롤 바이트를 가질 수 없도록 데이터 영역을 엔코딩하는 비동기 통신방법을 사용하여 멀티드롭 통신을 가능하게 하는 프레임 엔코딩 방법에 관한 것이다.The present invention relates to a method of encoding a communication frame, and more specifically, to a control byte (Control Byte) indicating the start and end of the communication frame (Frame), the actual data area other than the control byte in the communication frame is the control byte The present invention relates to a frame encoding method for enabling multidrop communication using an asynchronous communication method for encoding a data region so that a data area cannot be obtained.
일반적으로 흔히 사용되며 모든 컴퓨터에서 공통으로 제공되는 시리얼 포트(Serial Port), 즉 RS232C는 비동기 통신방법 만을 제공한다. 비동기 통신은 구현이 쉽고, 빠르며 저렴하지만, 일반적으로 1 대 1 통신(Point-To-Point) 방법에 알맞은 통신 방법이다. 여러 개의 제어기를 1 대 N 통신(Multi-drop) 방법으로 연결하고 PC를 사용하여 전체를 관리하는 시스템은 임베디드 시스템(Embedded System)에서는 흔히 볼 수 있는 구성(Configuration)이다.In general, the serial port (RS232C), which is commonly used and is common to all computers, provides only asynchronous communication method. Asynchronous communication is easy, quick and inexpensive to implement, but is generally the preferred method for point-to-point communication. A system that connects multiple controllers in a 1-to-N communication (Multi-drop) method and manages the whole using a PC is a common configuration in an embedded system.
그러나, 하나의 주제어기가 여러 대의 단말기를 제어하는 멀티드롭 방식의 접속형태에서는 일반적으로 동기(Synchronous) 통신 방식을 사용하며, 비동기(Asynchronous) 통신 방식을 사용하는 경우는 그 예를 찾아보기가 힘들다. 그 이유는 비동기 통신 방식이 멀티드롭형 접속형태에는 접합한 방식이 아니기 때문이다.However, in a multidrop connection type in which one main controller controls several terminals, a synchronous communication method is generally used, and an example is difficult to find when an asynchronous communication method is used. The reason is that the asynchronous communication method is not the one connected to the multidrop connection type.
이와 같은 멀티드롭형 접속형태에서 한 스테이션(Station)에서 송신된 프레임은 모든 스테이션에서 수신된다. 즉, 각 스테이션은 다양하고 많은 프레임을 자기 것이든 아니든 수신받는다. 이때, 데이터의 송·수신을 담당하는 프로토콜(Protocol)이 효율적이기 위해서는 전송라인 상에서 흐르는 각종 비트 패턴(Bit Pattern)들로부터 프레임을 쉽게 구분해 낼 수 있는 방법이 중요하다.In such a multidrop connection type, a frame transmitted at one station is received at all stations. That is, each station receives various and many frames, whether or not it is its own. In this case, in order for the protocol for data transmission and reception to be effective, a method of easily distinguishing a frame from various bit patterns flowing on a transmission line is important.
일반적으로 동기 통신 방식은 프레임의 시작과 끝을 나타내는 특수한 비트 패턴을 가지고 있으므로 자동으로 프레임을 구별할 수 있다. 그러나, 비동기 통신 방식의 경우는 프레임 안의 데이터와 구분이 가는 특수한 비트 패턴이 없으므로 통신 라인 상의 모든 데이터를 복잡하게 검색하여 프레임의 시작과 끝을 구분해 내야만 한다.In general, the synchronous communication method has a special bit pattern indicating the start and end of a frame so that the frame can be automatically distinguished. However, in the asynchronous communication method, since there is no special bit pattern that distinguishes the data in the frame, it is necessary to complexly search all the data on the communication line to distinguish the start and end of the frame.
그러나, 이러한 방법은 첫째, 만일 프레임 상의 에러가 발생할 경우 전체 통신 프로토콜이 불안해 질 확률이 높은 단점이 있다.However, this method has the disadvantage that, firstly, if an error on a frame occurs, there is a high probability that the entire communication protocol becomes unstable.
둘째, 비동기 통신의 특성상 상당히 비효율적이고 복잡하며 강하지 못한 프로토콜(Protocol)을 양산한다. 따라서, 개발자들은 상용 필드버스(FieldBus)를 사용하는데, 이럴 경우 개발 비용이나 시간이 상당히 늘어나는 문제점이 있다.Second, due to the nature of asynchronous communication, it produces a very inefficient, complex, and inefficient protocol. Therefore, developers use a commercial fieldbus (FieldBus), there is a problem that the development cost or time is significantly increased.
이에, 본 발명의 목적은 통신 프레임의 시작과 끝을 나타내는 콘트롤 바이트를 정의하고, 통신 프레임에서 콘트롤 바이트 이외의 실제 데이터 영역이 콘트롤 바이트를 가질 수 없도록 데이터 영역을 엔코딩함으로써 통신 프레임의 시작과 끝을 구분할 수 있는 고유의 비트 패턴을 정할 수 있도록 한 비동기 통신방법을 사용하여 멀티드롭 통신을 가능하게 하는 프레임 엔코딩 방법을 제공하는데 있다.Accordingly, an object of the present invention is to define the control byte indicating the start and end of the communication frame, and to encode the data area so that the actual data area other than the control byte cannot have the control byte in the communication frame, thereby starting and ending the communication frame. The present invention provides a frame encoding method that enables multidrop communication using an asynchronous communication method that allows a unique bit pattern to be distinguishable.
상기와 같은 목적을 달성하기 위하여 본 발명에 따른 비동기 통신방법을 사용하여 멀티드롭 통신을 가능하게 하는 프레임 엔코딩 방법은, 송·수신 프레임의 오리지날 데이터의 BCS 값을 계산하여 새로운 바이트 구성을 위한 필드들을 생성하는 단계와; 상기 생성된 필드들의 최상위 비트를 제외한 나머지 7비트에 상기 송·수신 프레임의 데이터 및 체크섬 필드의 최상위 비트(MSB) 만을 순차적으로 추출하여 엔코딩을 실시하는 단계와; 상기 송·수신 프레임의 모든 데이터 및 체크섬 필드의 엔코딩이 완료되면, 상기 엔코딩에 의해 만들어진 필드들을 상기 데이터 및 체크섬 필드 뒤에 붙이는 단계와; 상기 송·수신 프레임의 데이터 및 체크섬 필드와 상기 생성된 필드들의 최상위 비트를 모두 1로 셋팅 하는 단계를 포함한다.In order to achieve the above object, a frame encoding method for enabling multidrop communication using the asynchronous communication method according to the present invention includes calculating fields of a new byte by calculating a BCS value of original data of a transmission / reception frame. Generating; Performing encoding by sequentially extracting only the most significant bit (MSB) of the data of the transmission / reception frame and the checksum field in the remaining seven bits except the most significant bit of the generated fields; When the encoding of all data and checksum fields of the transmission / reception frame is completed, attaching the fields created by the encoding to the data and checksum fields after the data; Setting all of the most significant bits of the data and checksum fields of the transmission / reception frame and the generated fields to one.
이하, 첨부된 도면을 참조하여 본 발명을 상세하게 설명하고자 한다.Hereinafter, with reference to the accompanying drawings will be described in detail the present invention.
도 1은 본 발명에 따른 프레임 엔코딩 방법의 대상이 되는 시스템 구성도로서, 멀티드롭(Multi-drop) 네트워크(Network) 접속형태(Topology)를 갖는 시스템 구성도이다.1 is a system configuration target of the frame encoding method according to the present invention, which is a system configuration having a multi-drop network connection topology.
도 1을 참조하여 설명하면, 본 발명에 따른 프레임 엔코딩 방법의 대상이 되는 시스템에 있어서 각 스테이션(Station)(10,20-1,20-2,20-3,…,20-N)들은 도 1과 같이 멀티드롭형 네트워크 접속형태를 사용하며, 각 스테이션(10,20-1,20-2,20-3,…,20-N)의 제어기는 비동기(Asynchronous) 통신 만을 지원한다.Referring to FIG. 1, in the system that is the object of the frame encoding method according to the present invention, each station 10, 20-1, 20-2, 20-3,. As shown in Fig. 1, a multidrop network connection type is used, and the controller of each station 10, 20-1, 20-2, 20-3, ..., 20-N only supports asynchronous communication.
특히, 상기 멀티드롭형 접속형태는 주제어기(Primary Station)(10)와 여러 대의 단말기(Secondary Station)(20-1,20-2,20-3,…,20-N)들을 네트워크(30)로 연결하여 전체 시스템을 관리하는 어플리케이션(Application) 등에서 자주 사용되는 통신 연결 방식이다. 그리고, 상기 비동기 통신은 구현이 저렴하고, 간단하며 제어가 비교적 쉬워 자주 사용되는 통신 방식이다.In particular, the multi-drop connection type may include a primary station 10 and a plurality of secondary stations 20-1, 20-2, 20-3,..., 20 -N. It is a communication connection method that is frequently used in applications that manage the whole system by connecting to. In addition, the asynchronous communication is a communication method that is frequently used because it is inexpensive, simple, and relatively easy to control.
그러나, 하나의 주제어기(10)가 여러 대의 단말기(20-1,20-2,20-3,…,20-N)를 제어하는 멀티드롭 방식의 접속형태에서는 일반적으로 동기(Synchronous) 통신 방식을 사용한다.However, in a multidrop connection type in which one master controller 10 controls several terminals 20-1, 20-2, 20-3, ..., 20-N, generally, a synchronous communication method is used. Use
이와 같은 멀티드롭형 접속형태에서 한 스테이션(Station)에서 송신된 프레임은 모든 스테이션에서 수신된다. 이때, 데이터의 송·수신을 담당하는 프로토콜이 효율적이기 위해서는 전송 라인 상에서 흐르는 각종 비트 패턴(Bit Pattern)들로부터 프레임을 쉽게 구분해 낼 수 있는 방법이 중요하다.In such a multidrop connection type, a frame transmitted at one station is received at all stations. In this case, in order for the protocol for data transmission and reception to be effective, a method of easily distinguishing a frame from various bit patterns flowing on a transmission line is important.
그러나, 비동기 통신 방식의 경우는 프레임 안의 데이터와 구분이 가는 특수한 비트 패턴이 없으므로 통신 라인 상의 모든 데이터를 복잡하게 검색하여 프레임의 시작과 끝을 구분해 내야만 한다.However, in the asynchronous communication method, since there is no special bit pattern that distinguishes the data in the frame, it is necessary to complexly search all the data on the communication line to distinguish the start and end of the frame.
도 2는 본 발명에 따른 프레임 엔코딩 방법을 사용하는 통신 프레임의 포맷을 도시한 도면이다.2 is a diagram illustrating a format of a communication frame using a frame encoding method according to the present invention.
도 2에 도시된 통신 프레임 포맷의 각 필드(Field)의 내용은 다음과 같다.The contents of each field of the communication frame format shown in FIG. 2 are as follows.
먼저, STX(Start of TeXt) 필드는 통신 프레임의 시작을 나타내고, ETX(End of TeXt) 필드는 통신 프레임의 끝을 나타낸다.First, the Start of TeXt (STX) field indicates the start of a communication frame, and the End of TeXt (ETX) field indicates the end of a communication frame.
Target Station ID 필드는 목적지 스테이션의 ID를 나타내고, OP Code 필드는 프레임의 종류를 나타내는 Operation Code를 나타낸다.The Target Station ID field indicates an ID of a destination station, and the OP Code field indicates an operation code indicating a type of frame.
그리고, BCS(Binary Check Sum) 필드는 데이터 영역의 체크섬(Check Sum) 값이며 2 byte로 구성된다. BCS의 첫번째 바이트(Byte)는 데이터 영역의 짝수번째 바이트를 합한 값이며, 두번째 바이트는 데이터 영역의 홀수번째 바이트를 합한 값이다. 마지막으로 Data 필드는 실제적인 데이터를 나타낸다.The BCS (Binary Check Sum) field is a check sum value of the data area and consists of 2 bytes. The first byte of the BCS is the sum of even-numbered bytes of the data area, and the second byte is the sum of odd-numbered bytes of the data area. Finally, the Data field represents the actual data.
본 발명에 따른 비동기 통신방법을 사용하여 멀티드롭 통신을 가능하게 하는 프레임 엔코딩 방법은, 상술한 바와 같은 내용의 필드들로 구성된 송·수신 프레임을 제어하는 일련의 콘트롤 바이트(Control Byte)를 정의하고, 이러한 콘트롤 바이트가 프레임의 Data 필드 및 BCS 필드에서 나타나지 않도록 프레임의 Data 필드와 BCS 필드를 엔코딩(Encoding)한다. 이때, 도 2의 프레임 포맷에서 STX, ETX, Target Station ID, OP Code가 콘트롤 바이트이고, 이 값들은 0x80, 즉 128 보다 작은 값을 갖는다.The frame encoding method for enabling multidrop communication using the asynchronous communication method according to the present invention defines a series of control bytes for controlling a transmission / reception frame composed of the fields described above. Encode the Data field and the BCS field of the frame so that these control bytes do not appear in the Data field and the BCS field of the frame. At this time, in the frame format of FIG. 2, STX, ETX, Target Station ID, and OP Code are control bytes, and these values have a value smaller than 0x80, that is, 128.
도 3은 도 2의 통신 프레임에서 콘트롤 바이트 이외의 실제 데이터 영역을 엔코딩하는 방법을 설명하기 위한 도면이다.FIG. 3 is a diagram for describing a method of encoding an actual data area other than a control byte in the communication frame of FIG. 2.
도 3을 참조하여 프레임 엔코딩 방법을 보다 상세하게 설명하면 다음과 같다.The frame encoding method will be described in more detail with reference to FIG. 3.
먼저, 송·수신 프레임(Frame)의 오리지날 데이터(Original Data)의 BCS 값을 계산하여 새로운 바이트(Byte)를 구성하는데 필요한 도 3의 하단에 도시된 바와 같은 필드(Field)들을 생성한다.First, the BCS values of the original data of the transmission / reception frame Frame are calculated to generate fields as shown in the lower part of FIG. 3 required to construct a new byte.
다음, 상기 생성된 필드들의 8비트(Bit)로 구성된 1바이트(Byte) 중에 최상위 비트(Most Significant Bit; MSB)를 제외한 나머지 7비트(bit)에 상기 송·수신 프레임의 데이터 및 체크섬 필드(Data & BCS)의 최상위 비트(MSB) 만을 순차적으로 추출하여 엔코딩(Encoding)을 실시한다.Next, the data and the checksum field of the transmission / reception frame in the remaining 7 bits except the Most Significant Bit (MSB) among 1 byte composed of 8 bits of the generated fields. Only the most significant bit (MSB) of & BCS) is sequentially extracted and encoded.
즉, 도 3의 상단에 도시된 데이터 및 체크섬 필드(Data & BCS)의 8비트로 구성된 1바이트 중에 최상위 비트(MSB), 즉 최상위 1비트를 추출한 후 추출된 1비트들로 새로운 바이트를 구성하는데, 7개의 비트들을 모아 최상위 비트(MSB)를 제외한 하위 7비트 만을 구성한다.That is, after extracting the most significant bit (MSB), that is, the most significant 1 bit, from among 1 byte composed of 8 bits of the data and checksum fields (Data & BCS) shown in the upper part of FIG. The seven bits are collected to form only the lower seven bits except the most significant bit (MSB).
이러한 방식으로 송·수신 프레임의 데이터 및 체크섬 필드(Data & BCS)를 모두 엔코딩한 후 엔코딩이 완료되면, 엔코딩에 의해 새롭게 만들어진 필드들을 데이터 및 체크섬 필드(Data & BCS) 뒤에 붙인다.In this manner, after encoding both data and checksum fields (Data & BCS) of the transmission / reception frame and encoding is completed, fields newly created by encoding are attached to the data and checksum fields (Data & BCS).
그리고, 상기 송·수신 프레임의 데이터 및 체크섬 필드(Data & BCS)와, 그 뒤에 붙여진 바이트로 구성된 필드들의 최상위 비트(MSB)를 모두 1로 셋팅(Setting) 한다. 그러므로, 상기 송·수신 프레임의 데이터 및 체크섬 필드(Data & BCS)와 새롭게 생성된 필드들의 바이트 값들은 최상위 비트(MSB)가 모두 1이 됨으로 0x80, 즉 128 이상의 값을 갖는다.Then, all of the most significant bits (MSB) of the data and checksum fields (Data & BCS) of the transmission / reception frame and the bytes appended thereto are set to one. Therefore, the byte values of the data and checksum fields (Data & BCS) of the transmission / reception frame and the newly generated fields have a value of 0x80, that is, 128 or more because all of the most significant bits (MSB) are 1s.
따라서, 본 발명에 따른 비동기 통신방법을 사용하여 멀티드롭 통신을 가능하게 하는 프레임 엔코딩 방법은, 통신 프레임에서 콘트롤 바이트, 즉 STX, ETX, Target Station ID, OP Code 필드 이외의 실제 데이터 영역, 즉 Data & BCS 필드가 콘트롤 바이트를 가질 수 없도록 데이터 영역을 엔코딩함으로써 비동기 통신에서 통신 프레임의 시작과 끝을 구분할 수 있는 고유의 비트 패턴을 정하여 멀티드롭 통신을 가능하게 한다.Therefore, the frame encoding method for enabling multidrop communication using the asynchronous communication method according to the present invention, the actual data area other than the control byte, that is, STX, ETX, Target Station ID, OP Code field in the communication frame, that is, Data By encoding the data area so that the & BCS field cannot have a control byte, multidrop communication is possible by defining a unique bit pattern that distinguishes the start and end of a communication frame in asynchronous communication.
이상에서 설명한 것은 본 발명에 따른 비동기 통신방법을 사용하여 멀티드롭 통신을 가능하게 하는 프레임 엔코딩 방법에 대한 하나의 실시예에 불과한 것으로서, 본 발명이 속하는 분야에서 통상의 지식을 가진 자라면 누구든지 다양한 변경 실시가 가능한 범위까지 본 발명의 기술적 정신이 있다고 할 것이다.What has been described above is only one embodiment of a frame encoding method for enabling multidrop communication using the asynchronous communication method according to the present invention, and anyone skilled in the art to which the present invention pertains It will be said that there is a technical spirit of the present invention to the extent that modifications can be made.
이상에서 살펴본 바와 같이, 본 발명에 따른 비동기 통신방법을 사용하여 멀티드롭 통신을 가능하게 하는 프레임 엔코딩 방법은, 통신 프레임의 시작과 끝을 나타내는 콘트롤 바이트를 정의하고, 콘트롤 바이트 이외의 실제 데이터 영역이 콘트롤 바이트를 가질 수 없도록 데이터 영역을 엔코딩함으로써 하나의 주제어기가 여러 대의 단말기를 제어하는 멀티드롭 네트워크 접속형태를 갖는 시스템에서 비동기 통신이 가능하도록 하는 효과가 있다.As described above, the frame encoding method for enabling multidrop communication using the asynchronous communication method according to the present invention defines a control byte indicating the start and end of the communication frame, and the actual data area other than the control byte is defined. By encoding the data area so that it cannot have control bytes, it is effective to enable asynchronous communication in a system having a multidrop network connection in which one main controller controls several terminals.
도 1은 본 발명에 따른 프레임 엔코딩 방법의 대상이 되는 시스템 구성도.1 is a system configuration subject to the frame encoding method according to the present invention.
도 2는 본 발명에 따른 프레임 엔코딩 방법을 사용하는 통신 프레임의 포맷을 도시한 도면.2 illustrates a format of a communication frame using the frame encoding method according to the present invention.
도 3은 도 2의 통신 프레임에서 콘트롤 바이트 이외의 실제 데이터 영역을 엔코딩하는 방법을 설명하기 위한 도면.3 is a view for explaining a method of encoding a real data area other than a control byte in the communication frame of FIG.
* 도면의 주요부분에 대한 부호의 설명 *Explanation of symbols on the main parts of the drawings
10 : 주제어기 20-1,20-2,20-3,…,20-N : 단말기10: main controller 20-1,20-2,20-3,... , 20-N: terminal
30 : 네트워크30: network
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| KR1020030067537AKR20050031285A (en) | 2003-09-29 | 2003-09-29 | Frame encoding method where the multi-drop communication using asynchronous communication method is possible |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| KR1020030067537AKR20050031285A (en) | 2003-09-29 | 2003-09-29 | Frame encoding method where the multi-drop communication using asynchronous communication method is possible |
| Publication Number | Publication Date |
|---|---|
| KR20050031285Atrue KR20050031285A (en) | 2005-04-06 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| KR1020030067537AWithdrawnKR20050031285A (en) | 2003-09-29 | 2003-09-29 | Frame encoding method where the multi-drop communication using asynchronous communication method is possible |
| Country | Link |
|---|---|
| KR (1) | KR20050031285A (en) |
| Publication | Publication Date | Title |
|---|---|---|
| CN105656600B (en) | A kind of communication means of the adaptive two kinds of communication protocol of slave station | |
| CN110968052B (en) | Process control device and method for managing discrete process signals in a process plant | |
| CN102045334A (en) | Protocol conversion method and device | |
| US7076715B2 (en) | Safety network using phantom address information | |
| CN102761391B (en) | Oil field Internet of Things system communication method | |
| KR20090042951A (en) | Apparatus, Systems, and Methods Regarding the PLC | |
| CN111131533A (en) | Automatic address allocation method for serial communication system | |
| US20240081204A1 (en) | Auto-assignment of devices of a multi-wire irrigation control system to irrigation zones | |
| CN117914961B (en) | Industrial gateway and protocol conversion method | |
| CN117349201B (en) | Multi-slave control method, system and storage medium based on serial port communication | |
| KR20040028917A (en) | Communication controller and method of transforming information | |
| CN106407139B (en) | Method and Peripheral Components and CPU Unit for Transferring HART Variables | |
| CN103217956A (en) | Industrial control system as well as control method and control device thereof | |
| CN107453844B (en) | Method and device for automatically networking intelligent equipment | |
| CN117254987B (en) | Communication method, communication device, and storage medium | |
| KR20050031285A (en) | Frame encoding method where the multi-drop communication using asynchronous communication method is possible | |
| CN100530011C (en) | Automatic connection system and method for multiple machines | |
| CN105205022B (en) | A kind of more Console port collocation methods and system | |
| CN108898201A (en) | Information association system and method for solar assembly | |
| KR101950374B1 (en) | Non-standard protocol reverse engineering analysis apparatus | |
| CN113301093A (en) | Remote upgrading system for software of industrial controller | |
| JP3854273B2 (en) | Apparatus and method for setting communication packet | |
| CN114338265B (en) | Program downloading system and method based on TTP/C bus | |
| CN101846986B (en) | Method for detecting serial digital quantity signals | |
| JP2006042164A (en) | Gateway device |
| Date | Code | Title | Description |
|---|---|---|---|
| PA0109 | Patent application | Patent event code:PA01091R01D Comment text:Patent Application Patent event date:20030929 | |
| PG1501 | Laying open of application | ||
| PC1203 | Withdrawal of no request for examination | ||
| WITN | Application deemed withdrawn, e.g. because no request for examination was filed or no examination fee was paid |