KR102268139B1 - Automatic ID allocation method of slave devices according to distance order - Google Patents

Automatic ID allocation method of slave devices according to distance order Download PDF

Info

Publication number
KR102268139B1
KR102268139B1 KR1020200064937A KR20200064937A KR102268139B1 KR 102268139 B1 KR102268139 B1 KR 102268139B1 KR 1020200064937 A KR1020200064937 A KR 1020200064937A KR 20200064937 A KR20200064937 A KR 20200064937A KR 102268139 B1 KR102268139 B1 KR 102268139B1
Authority
KR
South Korea
Prior art keywords
slave
slave device
sequence
master device
slave devices
Prior art date
Application number
KR1020200064937A
Other languages
Korean (ko)
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 KR1020200064937A priority Critical patent/KR102268139B1/en
Application granted granted Critical
Publication of KR102268139B1 publication Critical patent/KR102268139B1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/30Managing network names, e.g. use of aliases or nicknames
    • H04L61/3015Name registration, generation or assignment
    • H04L61/302Administrative registration, e.g. for domain names at internet corporation for assigned names and numbers [ICANN]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L12/40052High-speed IEEE 1394 serial bus
    • H04L12/40078Bus configuration
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/12Network monitoring probes
    • H04L61/2038
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5038Address allocation for local use, e.g. in LAN or USB networks, or in a controller area network [CAN]

Abstract

The present invention relates to a method of automatically allocating an ID of a slave device in accordance with distance order, capable of promoting convenience in control by automatically allocating a turn identification (ID) in order of closest to a master, in a distributed system comprising the master and a plurality of slaves. A master device collects a unique ID of a slave device by scanning the slave device connected through communication when a turn ID of the slave device is allocated; creates a management table for control based on the collected unique ID of the slave device; transmits a start signal for allocating the turn ID of the slave device to the slave device through an output port; allocates the turn ID when receiving a response transmitted from the slave device through an input port; and stores the allocated turn ID of the slave device in the management table. The master device recognizes order of receiving the response transmitted from the slave device as distance order with the master device, and then, automatically allocates the turn ID of the slave device in accordance with the distance order.

Description

거리 순서에 따른 슬레이브 디바이스의 ID 자동할당방법{Automatic ID allocation method of slave devices according to distance order}Automatic ID allocation method of slave devices according to distance order}

본 발명은 거리 순서에 따른 슬레이브 디바이스의 ID 자동할당방법에 관한 것으로, 특히 마스터와 복수의 슬레이브로 이루어진 분산형 시스템에서, 마스터에 근접한 순서대로 순번 ID(identification)를 자동으로 할당하여 관제에 편리함을 도모하도록 한 거리 순서에 따른 슬레이브 디바이스의 ID 자동할당방법에 관한 것이다.The present invention relates to a method for automatically allocating IDs of slave devices according to distance order, particularly in a distributed system consisting of a master and a plurality of slaves, by automatically allocating IDs (identifications) in the order of proximity to the master for convenient control. It relates to a method for automatically allocating IDs of slave devices according to the order of distances.

LAN(Local Area Network), I2C(Inter-Integrated Circuit), CAN(Controller Area Network), RS485(Recommended Standard 485)와 같은 산업현장에서 많이 사용하는 통신규격들은 디바이스간 설치되는 거리와 데이터양이나 사용하고자 하는 용도에 따라 선택적으로 통신방식을 선정한다. 생산현장이나 데이터센터같이 다수의 디바이스가 사용되는 경우 일반적으로 사용자는 도면 작업등을 통해 설비들을 관리하고, 해당 위치의 장비들에 ID를 부여하여 해당 설비들을 관리하고 모니터링하는 관제업무를 진행한다.Communication standards widely used in industrial fields such as LAN (Local Area Network), I2C (Inter-Integrated Circuit), CAN (Controller Area Network), and RS485 (Recommended Standard 485) are The communication method is selectively selected according to the intended use. When multiple devices are used, such as a production site or a data center, a user generally manages the facilities through drawing work, etc., and assigns IDs to the devices at the location to manage and monitor the facilities.

관제시스템 구축을 통해 통상적으로 단일의 마스터(Master)의 하위에 복수의 슬레이브(Slave)를 등록하고, 각각의 슬레이브에 아이디(ID, identification)를 할당하고, 할당된 아이디를 호출하고 응답하는 방식으로 통신이 이루어진다.Through the establishment of the control system, a plurality of slaves are usually registered under a single master, an ID is assigned to each slave, and the assigned ID is called and answered. communication takes place.

복수의 슬레이브의 각각에 ID를 할당하는 방법으로는, 수작업을 통해 개별 슬레이브의 ID를 확인하여 등록하거나, 직접 고유의 주소를 부여하여 도면과 매칭하는 작업 등을 수행하여 ID를 부여하는 방법을 이용하므로, ID 부여가 복잡하다는 단점이 있다.As a method of assigning an ID to each of a plurality of slaves, the ID is assigned by manually checking the ID of each slave and registering it, or by directly assigning a unique address to match the drawing. Therefore, there is a disadvantage that ID assignment is complicated.

LAN, I2C, CAN, RS485와 같은 통신 방식들은 여러 디바이스간에 지정된 ID나 어드레스를 통해 상호 간의 통신은 가능하나, 모든 위치의 정보들은 사용자가 직접 확인하고 관리해야 한다.Communication methods such as LAN, I2C, CAN, and RS485 enable mutual communication through designated IDs or addresses among multiple devices, but the user must check and manage all location information.

한편, 마스터-슬레이브 관계로 이루어진 통신 시스템에서 슬레이브의 ID를 자동으로 부여하는 종래의 기술이 <특허문헌 1> 내지 <특허문헌 2> 에 개시되어 있다.On the other hand, a conventional technique for automatically assigning an ID of a slave in a communication system consisting of a master-slave relationship is disclosed in <Patent Document 1> to <Patent Document 2>.

<특허문헌 1> 은 LIN(Local Interconnect Network) 통신을 이용하는 시스템에서 각각의 슬레이브 모듈에 저항 또는 절연 모듈을 개별 장착하고, 슬레이브 모듈에서 개별적으로 측정된 전압에 기초하여 자동으로 LIN ID를 부여한다.In <Patent Document 1>, a resistance or insulation module is individually mounted on each slave module in a system using LIN (Local Interconnect Network) communication, and a LIN ID is automatically assigned based on a voltage individually measured by the slave module.

이러한 종래기술은 개별 슬레이브 모듈에 각각 저항 또는 절연 모듈을 개별적으로 설치해야 하는 복잡함이 있다.This prior art has complexity in that it is necessary to individually install a resistor or an insulating module in each slave module.

또한, <특허문헌 2> 는 각각의 슬레이브 장치에 통신선을 연결 및 차단하기 위한 스위칭장치를 설치하고, 마스터 장치에서 슬레이브 장치에 설치된 스위칭장치를 개별적으로 제어하면서 마스터 장치와 연결된 복수의 슬레이브 장치에 자동으로 아이디를 할당한다.In addition, <Patent Document 2> installs a switching device for connecting and disconnecting a communication line in each slave device, and individually controlling the switching device installed in the slave device in the master device while automatically controlling the plurality of slave devices connected to the master device. is assigned an ID.

이러한 종래기술은 개별 슬레이브 장치에 통신라인을 연결 및 차단하기 위해 스위칭장치를 설치해야 하는 복잡함이 있다.This prior art has complexity in that it is necessary to install a switching device to connect and block communication lines to individual slave devices.

대한민국 등록특허 10-0913263(2009.08.13. 등록)(슬레이브 모듈에 엘아이엔 아이디를 자동으로 부여하는 방법 및 슬레이브 모듈)Republic of Korea Patent 10-0913263 (Registered on August 13, 2009) (Method of automatically assigning LIN ID to slave module and slave module) 대한민국 공개특허 10-2011-0107626(2011.10.04. 공개)(슬레이브 장치 및 그 아이디 할당 방법)Korean Patent Laid-Open Patent Publication No. 10-2011-0107626 (published on Oct. 4, 2011) (Slave device and its ID allocation method)

따라서 본 발명은 상기와 같은 일반적인 관제시스템에서 수동으로 슬레이브 장치의 ID를 부여하는 방법 및 종래기술에서 발생하는 제반 문제점을 해결하기 위해서 제안된 것으로서, 마스터와 복수의 슬레이브로 이루어진 분산형 시스템에서, 마스터에 근접한 순서대로 순번 ID(identification)를 자동으로 부여하여 관제에 편리함을 도모하도록 한 거리 순서에 따른 슬레이브 디바이스의 ID 자동할당방법을 제공하는 데 그 목적이 있다.Therefore, the present invention has been proposed to solve the problems occurring in the method of manually assigning the ID of a slave device in the general control system as described above and in the prior art. In a distributed system composed of a master and a plurality of slaves, the master An object of the present invention is to provide a method for automatically assigning IDs (identifications) of slave devices according to the distance sequence in order to facilitate control by automatically assigning IDs (identifications) in the order close to the .

상기한 바와 같은 목적을 달성하기 위하여, 본 발명에 따른 "거리 순서에 따른 슬레이브 디바이스의 ID 자동할당방법"의 제1 실시 예는,In order to achieve the above object, the first embodiment of the "method for automatically allocating IDs of slave devices according to distance order" according to the present invention,

단일의 마스터 디바이스와 그 하위에 복수의 슬레이브 디바이스가 연결되어 통신이 이루어지는 시스템에서 복수의 슬레이브 디바이스의 ID를 자동으로 할당하기 위한 방법으로서,A method for automatically allocating IDs of a plurality of slave devices in a system in which a single master device and a plurality of slave devices are connected under it to communicate,

상기 마스터 디바이스는,The master device is

(a) 슬레이브 디바이스의 순번 ID를 할당시 통신으로 연결된 슬레이브 디바이스를 스캔하여 슬레이브 디바이스의 고유 ID를 수집하는 단계;(a) collecting a unique ID of the slave device by scanning a slave device connected through communication when assigning a sequence ID of the slave device;

(b) 상기 (a)단계에서 수집한 슬레이브 디바이스의 고유 ID를 기초로 관제를 위한 관리 테이블을 생성하는 단계;(b) generating a management table for control based on the unique ID of the slave device collected in step (a);

(c) 상기 슬레이브 디바이스의 순번 ID를 할당하기 위한 시작신호를 출력포트를 통해 슬레이브 디바이스로 전송하고, 슬레이브 디바이스로부터 전송된 응답을 입력포트를 통해 수신하면 순번 ID를 할당하고, 할당된 슬레이브 디바이스의 순번 ID를 상기 관리 테이블에 저장하는 단계를 포함하고,(c) When a start signal for allocating the sequence ID of the slave device is transmitted to the slave device through the output port, and a response transmitted from the slave device is received through the input port, the sequence ID is assigned, and the Storing the sequence ID in the management table,

상기 복수의 슬레이브 디바이스는,The plurality of slave devices,

(d) 입력 포트를 통해 순번 ID를 할당하기 위한 시작신호가 입력되면, 자신의 고유 ID를 상기 마스터 디바이스로 전송하고, 상기 마스터 디바이스로부터 순번 ID를 수신하는 단계;(d) when a start signal for allocating a turn ID is input through an input port, transmitting its own ID to the master device, and receiving a turn ID from the master device;

(e) 상기 (d)단계에서 수신한 순번 ID를 저장하고, 출력포트를 통해 상기 시작신호를 후단으로 출력해주는 단계를 포함하는 것을 특징으로 한다.(e) storing the sequence ID received in step (d), and outputting the start signal to the rear end through an output port.

상기에서 마스터 디바이스는 슬레이브 디바이스로부터 전송된 응답을 수신한 순서를 마스터 디바이스를 기준으로 한 거리 순서로 인식하고, 거리 순서에 따라 슬레이브 디바이스의 순번 ID를 할당하는 것을 특징으로 한다.In the above, it is characterized in that the master device recognizes the order of receiving the response transmitted from the slave device as a distance order based on the master device, and allocates a sequence ID of the slave device according to the distance order.

상기에서 복수의 슬레이브 디바이스는 전단장치와 통신을 위한 제1입출력포트, 후단장치와 통신을 위한 제2입출력포트를 구비한 것을 특징으로 한다.In the above, the plurality of slave devices is characterized in that it has a first input/output port for communication with the front end device and a second input/output port for communication with the rear end device.

상기한 바와 같은 목적을 달성하기 위하여, 본 발명에 따른 "거리 순서에 따른 슬레이브 디바이스의 ID 자동할당방법"의 제2 실시 예는,In order to achieve the above object, the second embodiment of the "method for automatically assigning IDs of slave devices according to distance order" according to the present invention is,

단일의 마스터 디바이스와 그 하위에 복수의 슬레이브 디바이스가 연결되어 통신이 이루어지는 시스템에서 복수의 슬레이브 디바이스의 ID를 자동으로 할당하기 위한 방법으로서,A method for automatically allocating IDs of a plurality of slave devices in a system in which a single master device and a plurality of slave devices are connected under it to communicate,

상기 마스터 디바이스는,The master device is

(a) 슬레이브 디바이스의 순번 ID를 할당시 슬레이브 디바이스의 관제를 위한 관리 테이블을 생성하는 단계;(a) generating a management table for control of the slave device when assigning a sequence ID of the slave device;

(b) 상기 슬레이브 디바이스의 순번 ID를 할당하기 위한 시작신호를 출력포트를 통해 슬레이브 디바이스로 전송하고, 슬레이브 디바이스로부터 전송된 응답을 입력포트를 통해 수신하면 순번 ID를 할당하고, 할당된 슬레이브 디바이스의 순번 ID와 슬레이브 디바이스의 고유 ID 및 하위에 연결된 전체 슬레이브 디바이스의 개수 정보를 상기 관리 테이블에 저장하는 단계를 포함하고,(b) When a start signal for allocating the sequence ID of the slave device is transmitted to the slave device through the output port, and a response transmitted from the slave device is received through the input port, the sequence ID is assigned, and the Storing, in the management table, information on the sequence number ID, the unique ID of the slave device, and the number of all slave devices connected to the lower level,

상기 복수의 슬레이브 디바이스는,The plurality of slave devices,

(c) 입력 포트를 통해 순번 ID를 할당하기 위한 시작신호가 입력되면, 자신의 고유 ID를 상기 마스터 디바이스로 전송하고, 상기 마스터 디바이스로부터 순번 ID를 수신하는 단계;(c) when a start signal for allocating a turn ID is input through an input port, transmitting its own ID to the master device, and receiving a turn ID from the master device;

(d) 상기 (c)단계에서 수신한 순번 ID를 저장하고, 출력포트를 통해 상기 시작신호를 후단으로 출력해주는 단계를 포함하는 것을 특징으로 한다.(d) storing the sequence ID received in step (c), and outputting the start signal to the rear end through an output port.

상기에서 마스터 디바이스는 슬레이브 디바이스로부터 전송된 응답을 수신한 순서를 마스터 디바이스를 기준으로 한 거리 순서로 인식하고, 거리 순서에 따라 슬레이브 디바이스의 순번 ID를 할당하는 것을 특징으로 한다.In the above, it is characterized in that the master device recognizes the order of receiving the response transmitted from the slave device as a distance order based on the master device, and allocates a sequence ID of the slave device according to the distance order.

본 발명에 따르면 마스터와 복수의 슬레이브로 이루어진 분산형 통신 시스템에서, 마스터에 거리가 근접한 순서대로 순번 ID(identification)를 자동으로 할당해줌으로써, 전체 시스템의 설치에 편리함을 도모해주고, 관리에 편리성을 도모해주는 효과가 있다.According to the present invention, in a distributed communication system consisting of a master and a plurality of slaves, by automatically allocating IDs (identifications) in the order of proximity to the master in order of proximity to the master, it promotes convenience in installation of the entire system and convenience in management has the effect of promoting

도 1은 본 발명에 따른 거리 순서에 따른 슬레이브 디바이스의 ID 자동할당방법이 적용되는 통신 시스템의 구성도,
도 2는 도 1의 통신케이블 구성 예시도,
도 3은 본 발명에서 거리 순서대로 슬레이브 디바이스에 ID를 할당하는 원리도,
도 4a 및 도 4b는 본 발명에 따른 거리 순서에 따른 슬레이브 디바이스의 ID 자동할당방법의 제1 실시 예 흐름도,
도 5a 및 도 5b는 본 발명에 따른 거리 순서에 따른 슬레이브 디바이스의 ID 자동할당방법의 제2 실시 예 흐름도이다.
1 is a block diagram of a communication system to which an automatic ID assignment method of a slave device according to a distance sequence according to the present invention is applied;
2 is an exemplary diagram of the communication cable configuration of FIG.
3 is a principle diagram of allocating IDs to slave devices in order of distance in the present invention;
4A and 4B are flowcharts of a first embodiment of a method for automatically assigning IDs to slave devices according to distance order according to the present invention;
5A and 5B are flowcharts of a method for automatically allocating IDs of slave devices according to distance order according to a second embodiment of the present invention.

이하 본 발명의 바람직한 실시 예에 따른 거리 순서에 따른 슬레이브 디바이스의 ID 자동할당방법을 첨부된 도면을 참조하여 상세하게 설명한다.Hereinafter, a method for automatically allocating IDs of slave devices according to distance order according to a preferred embodiment of the present invention will be described in detail with reference to the accompanying drawings.

이하에서 설명되는 본 발명에 사용된 용어나 단어는 통상적이거나 사전적인 의미로 한정해서 해석되어서는 안 되며, 발명자는 그 자신의 발명을 가장 최선의 방법으로 설명하기 위해 용어의 개념으로 적절하게 정의할 수 있다는 원칙에 입각하여 본 발명의 기술적 사상에 부합하는 의미와 개념으로 해석되어야만 한다.The terms or words used in the present invention described below should not be construed as being limited to conventional or dictionary meanings, and the inventor may appropriately define the concept of terms in order to best describe his invention. It should be interpreted as meaning and concept consistent with the technical idea of the present invention based on the principle that it can be

따라서 본 명세서에 기재된 실시 예와 도면에 도시된 구성은 본 발명의 바람직한 실시 예에 불과할 뿐이고, 본 발명의 기술적 사상을 모두 대변하는 것은 아니므로, 본 출원 시점에서 이들을 대체할 수 있는 다양한 균등물과 변형 예들이 있을 수 있음을 이해하여야 한다.Therefore, the embodiments described in this specification and the configurations shown in the drawings are only preferred embodiments of the present invention, and do not represent all of the technical spirit of the present invention, so various equivalents and It should be understood that there may be variations.

도 1a 및 도 1b는 본 발명의 바람직한 실시 예에 따른 거리 순서에 따른 슬레이브 디바이스의 ID 자동할당방법이 적용되는 시스템(예를 들어, 관제 시스템)의 개략 구성도로서, 단일의 마스터 디바이스(100)와 그 하위에 복수의 슬레이브(Slave) 디바이스(201 - 200+N)가 연결되고, 마스터 디바이스(100)에서 각각의 슬레이브 디바이스(201 - 200+N)에 아이디(ID, identification)를 자동으로 할당하고, 할당된 아이디를 호출하고 응답하는 방식으로 통신을 하여, 관제가 이루어진다.1A and 1B are schematic diagrams of a system (eg, a control system) to which an automatic ID assignment method of a slave device according to a distance sequence is applied according to a preferred embodiment of the present invention, a single master device 100 A plurality of slave devices (201 - 200+N) are connected to and below, and an ID (identification) is automatically assigned to each slave device (201 - 200+N) in the master device 100 and control by calling and responding to the assigned ID.

도 1a는 마스터 디바이스(100)와 복수의 슬레이브 디바이스(201 - 200+N)가 동일한 통신 케이블로 전부 연결되는 형태의 통신 시스템이고, 도 1b는 마스터 디바이스(100)와 복수의 슬레이브 디바이스(201 - 200+N)가 동일한 통신 케이블로 전부 연결되되 링 구조 형태로 구현되어, 맨 후미에 장착된 슬레이브 디바이스(200+N)의 출력이 별도의 통신 케이블을 통해 마스터 디바이스(100)에 연결되는 형태이다.1a is a communication system of a type in which the master device 100 and a plurality of slave devices 201 - 200+N are all connected with the same communication cable, and FIG. 1b is a master device 100 and a plurality of slave devices 201 - 200+N) are all connected with the same communication cable, but implemented in a ring structure form, so that the output of the slave device 200+N mounted at the rear is connected to the master device 100 through a separate communication cable.

도 1a나 도 1b를 구현하는 시스템의 구성 및 동작은 동일하므로, 이하 설명의 편의를 위해 하나의 슬레이브 디바이스(201)에 대해서만 설명하기로 한다.Since the configuration and operation of the system implementing FIG. 1A or FIG. 1B are the same, only one slave device 201 will be described below for convenience of description.

여기서 마스터 디바이스(100)는 자신에게 근접한 거리 순서대로 순번 ID(identification)를 자동으로 할당해줌으로써, 전체 시스템의 설치에 편리함을 도모해주고, 관리에 편리성을 도모해준다.Here, the master device 100 automatically allocates IDs (identifications) in the order of distances close to them, thereby providing convenience in installation of the entire system and convenience in management.

여기서 순번 ID라 함은 슬레이브 디바이스에 각각 부여되는 고유 ID와는 달리 마스터 디바이스(100)에서 몇 번째로 연결된 슬레이브 디바이스인지를 구분하기 위한 식별정보로서, 마스터 디바이스(100)로부터 거리 순서에 따라 부여되는 ID라 할수 있다. 예컨대, 고유 ID는 슬레이브 디바이스를 식별하기 위한 식별정보이고, 순번 ID는 마스터 디바이스에서 몇 번째로 연결된 슬레이브 디바이스인지를 식별하기 위한 식별정보이다.Here, the sequence ID is identification information for distinguishing the number of connected slave devices from the master device 100, unlike the unique IDs each assigned to the slave devices, and is an ID given according to the order of distance from the master device 100 can be said For example, the unique ID is identification information for identifying the slave device, and the sequence ID is identification information for identifying the number of connected slave devices in the master device.

각각의 슬레이브 디바이스(200 - 200+N)는 전단장치와 통신을 위한 제1입출력포트(GP-I, GP-O), 후단장치와 통신을 위한 제2입출력포트(GP-I, GP-O)를 구비한다. 여기서 전단장치는 마스터 디바이스 또는 슬레이브 디바이스가 될 수 있으며, 후단장치는 슬레이브 디바이스를 의미한다. 즉, 마스터 디바이스를 기준으로 가장 근접하게 설치된 첫 번째 슬레이브 디바이스는 전단장치가 마스터 디바이스가되며 후단 장치는 슬레이브 디바이스가 되며, 두 번째 슬레이브 디바이스는 전단장치가 슬레이브 디바이스가 되고 후단장치가 슬레이브 디바이스가 된다.Each slave device (200 - 200+N) has a first input/output port (GP-I, GP-O) for communication with a front end device, and a second input/output port (GP-I, GP-O) for communication with a rear end device ) is provided. Here, the front end device may be a master device or a slave device, and the rear end device means a slave device. That is, in the first slave device installed closest to the master device, the front end becomes the master device, the rear end becomes the slave device, and in the second slave device, the front end becomes the slave device and the rear end becomes the slave device. .

한편, 본 발명에서 통신 연결을 위해 통신 케이블은 도 2와 같이 구현하였다.Meanwhile, in the present invention, a communication cable for communication connection is implemented as shown in FIG. 2 .

슬레이브 디바이스(201)를 예로 들면, 전단장치와 통신을 위한 제1입출력포트(201a)와 후단장치와 통신을 위한 제2입출력포트(201b)를 구비한다.Taking the slave device 201 as an example, it includes a first input/output port 201a for communication with the front end device and a second input/output port 201b for communication with the rear end device.

각각의 입출력 포트(GP-I, GP-O)는 핀 사양에 따라 그 위치가 달라질 수 있다.The location of each input/output port (GP-I, GP-O) may vary according to pin specifications.

예를 들어, 전단장치와 통신을 위한 제1입출력포트(201a)에서 4핀/6핀/8핀 사양은 모두 3번 핀을 입력 포트(GP-I), 4번 핀을 출력 포트(GP-O)로 설정하고, 후단장치와 통신을 위한 제2입출력포트(201b)에서 4핀/6핀 사양은 3번 핀을 입력 포트로 4번 핀을 출력포트로 설정하나, 8핀 사영에서는 3번 핀을 출력포트로 그리고 4번 핀을 입력 포트로 설정한다.For example, in the first input/output port (201a) for communication with the front end device, the 4-pin/6-pin/8-pin specification uses pin 3 as the input port (GP-I), and pin 4 as the output port (GP- O), and in the 2nd input/output port 201b for communication with the rear end device, the 4-pin/6-pin specification sets pin 3 as an input port and pin 4 as an output port, but in 8-pin projection, it is set to No. Set pin as the output port and pin 4 as the input port.

도 3은 본 발명에 따른 거리 순서에 따른 슬레이브 디바이스의 ID 자동할당방법의 동작 원리를 설명하기 위한 도면이다.3 is a diagram for explaining the operation principle of the method for automatically assigning IDs of slave devices according to distance order according to the present invention.

링 구조가 아닌 통신 케이블 연결 상태에서, 마스터 디바이스와 모든 슬레이브 디바이스를 설치하고 통신 케이블로 연결한 상태에서 슬레이브 디바이스의 ID를 자동으로 할당한다.In the state where the communication cable is connected instead of the ring structure, the ID of the slave device is automatically assigned while the master device and all slave devices are installed and connected with the communication cable.

즉, 마스터 디바이스는 출력 포트를 통해 순번 ID 할당을 위한 시작신호를 출력하고(1), 마스터 디바이스에 가장 근접한 첫 번째 슬레이브 디바이스(SL1)는 제1입출력포트의 입력포트로 시작신호(ID_START)를 입력받는다. 시작신호(ID_START)를 입력받은 슬레이브 디바이스(SL1)는 제1입출력포트의 출력포트로 마스터 디바이스에 자신의 고유 ID를 전송하고, 마스터 디바이스는 수신한 슬레이브 디바이스의 고유 ID에 첫 번째 순번 ID를 매핑하여 관제 관리 테이블에 저장하고, 첫 번째 순번 ID를 슬레이브 디바이스(SL1)에 전달한다. 이로써 슬레이브 디바이스(SL1)는 마스터 디바이스 기준으로 거리상 가장 근접한 첫 번째 슬레이브 디바이스가 된다. 첫 번째 순번 ID를 수신한 슬레이브 디바이스(SLl)는 수신한 순번 ID를 저장하고, 제2입출력포트 출력포트를 통해 후단의 슬레이브 디바이스(SL2)에 시작신호(ID_START)(1)를 전달한다.That is, the master device outputs the start signal for the sequence ID assignment through the output port (1), and the first slave device (SL1) closest to the master device sends the start signal (ID_START) to the input port of the first input/output port. get input The slave device SL1 receiving the start signal ID_START transmits its own ID to the master device to the output port of the first input/output port, and the master device maps the first ID to the received unique ID of the slave device. to store it in the control management table, and deliver the first turn ID to the slave device SL1. Accordingly, the slave device SL1 becomes the first slave device closest to the master device by distance. The slave device SLl that has received the first turn ID stores the received turn ID and transmits the start signal ID_START (1) 1 to the slave device SL2 at the rear end through the second input/output port output port.

슬레이브 디바이스(SL2)는 제1입출력포트의 입력포트로 시작신호(ID_START)를 입력받고 제1입출력포트의 출력포트로 자신의 고유 ID를 전송한다. 이렇게 전송되는 고유 ID는 슬레이브 디바이스(SL1)를 거쳐 마스터 디바이스에 전달된다. 마스터 디바이스는 수신한 슬레이브 디바이스의 고유 ID에 두 번째 순번 ID를 매핑하여 관제 관리 테이블에 저장하고, 두 번째 순번 ID를 슬레이브 디바이스(SL1)에 전달한다. 슬레이브 디바이스(SL1)는 전달받은 두 번째 순번 ID를 그대로 바이패스하게 되고, 첫 번째 슬레이브 디바이스(SL1)를 통과한 두 번째 순번 ID는 슬레이브 디바이스(SL2)에 전달된다. 이로써 슬레이브 디바이스(SL2)는 마스터 디바이스 기준으로 거리상 두 번째 가까운 슬레이브 디바이스가 된다. 두 번째 순번 ID를 수신한 슬레이브 디바이스(SL2)는 수신한 순번 ID를 저장하고, 제2입출력포트 출력포트를 통해 후단의 슬레이브 디바이스(SL3)에 시작신호(ID_START)(1)를 전달한다.The slave device SL2 receives the start signal ID_START as an input port of the first input/output port and transmits its own ID to the output port of the first input/output port. The transmitted unique ID is transmitted to the master device through the slave device SL1. The master device maps the second turn ID to the received unique ID of the slave device, stores it in the control management table, and delivers the second turn ID to the slave device SL1. The slave device SL1 bypasses the received second turn ID as it is, and the second turn ID that has passed through the first slave device SL1 is transferred to the slave device SL2 . Accordingly, the slave device SL2 becomes the second closest slave device in distance based on the master device. The slave device SL2 that has received the second turn ID stores the received turn ID, and transmits the start signal ID_START (1) 1 to the slave device SL3 at the rear end through the second input/output port output port.

이러한 과정을 통해 마스터 디바이스에 연결되는 모든 슬레이브 디바이스에 대하여 순번 ID를 자동으로 할당한다.Through this process, sequential IDs are automatically assigned to all slave devices connected to the master device.

여기서 링 구조가 아닌 시스템에서는 마스터 디바이스에서 초기 통신시 스캔 동작을 통해 연결된 모든 슬레이브 디바이스의 개수를 수집하여 관리 테이블을 생성하므로, 마스터 디바이스에서는 연결된 슬레이브 디바이스의 개수에 대응하게 순번 ID를 할당하면 된다.Here, in a system that is not a ring structure, the master device collects the number of all connected slave devices through a scan operation during initial communication to create a management table, so the master device may allocate a sequence ID corresponding to the number of connected slave devices.

링 구조의 시스템에서는 초기 통신시 스캔 동작을 할 때, 맨 마지막에 연결된 슬레이브 디바이스는 그 출력이 마스터 디바이스에 연결되는 구조이므로, 마스터 디바이스는 별도의 통신 케이블로 피드백신호가 전달되면 해당 슬레이브 디바이스가 마지막이라고 판단하고, 수집한 슬레이브 디바이스의 고유 ID의 개수를 연산하여 연결된 슬레이브 디바이스의 개수를 파악한다. 슬레이브 디바이스의 개수를 파악한 후의 슬레이브 디바이스의 순번 ID를 할당하는 방식도 전술한 슬레이브 디바이스의 순번 ID를 할당하는 방식과 동일하게 이루어진다.In a ring structure system, when a scan operation is performed during initial communication, the last connected slave device has a structure in which its output is connected to the master device. to determine the number of connected slave devices by calculating the number of unique IDs of the collected slave devices. The method of allocating the order IDs of the slave devices after determining the number of slave devices is the same as the method of allocating the order IDs of the slave devices.

이하, 링 구조가 아닌 시스템에서 슬레이브 디바이스의 순번 ID를 할당하는 방법과 링 구조의 시스템에서 슬레이브 디바이스의 순번 ID를 할당하는 방법을 구분하여 설명하면 다음과 같다.Hereinafter, a method of allocating a sequence ID of a slave device in a system not having a ring structure and a method of allocating a sequence ID of a slave device in a system having a ring structure will be separately described as follows.

도 4a 및 도 4b는 본 발명의 "거리 순서에 따른 슬레이브 디바이스의 ID 자동할당방법"의 제1 실시 예 흐름도로서, 단일의 마스터 디바이스와 그 하위에 복수의 슬레이브 디바이스가 연결되어 통신이 이루어지는 시스템에서 복수의 슬레이브 디바이스의 ID를 자동으로 할당하기 위한 방법이다.4A and 4B are flowcharts of a first embodiment of "a method for automatically assigning IDs to slave devices according to distance order" of the present invention. In a system in which a single master device and a plurality of slave devices are connected to the lower level of the present invention, communication is performed. This is a method for automatically allocating IDs of a plurality of slave devices.

도 4a는 마스터 디바이스(100)에서 이루어지는 슬레이브 디바이스의 ID를 자동으로 할당하는 과정으로서, (a) 슬레이브 디바이스(201 - 200+N)의 순번 ID를 할당시 통신으로 연결된 슬레이브 디바이스(201 - 200+N)를 스캔하여 슬레이브 디바이스(201 - 200+N)의 고유 ID를 수집하는 단계(S11 - S12), (b) 상기 (a)단계에서 수집한 슬레이브 디바이스(201 - 200+N)의 고유 ID를 기초로 관제를 위한 관리 테이블을 생성하는 단계(S13), (c) 상기 슬레이브 디바이스(201 - 200+N)의 순번 ID를 할당하기 위한 시작신호(ID_START)를 출력포트를 통해 슬레이브 디바이스(201 - 200+N)로 전송하고, 슬레이브 디바이스(201 - 200+N)로부터 전송된 응답을 입력포트를 통해 수신하면 순번 ID를 할당하고, 할당된 슬레이브 디바이스(201 - 200+N)의 순번 ID를 상기 관리 테이블에 저장하는 단계(S14 - S19)를 포함한다.Figure 4a is a process of automatically allocating the ID of the slave device made in the master device 100, (a) the slave device (201 - 200+) connected through communication when the sequence ID of the slave device (201 - 200+N) is assigned. Scanning N) to collect the unique IDs of the slave devices 201 - 200+N (S11 - S12), (b) the unique IDs of the slave devices 201 - 200+N collected in the step (a) Step (S13) of generating a management table for control based on (S13), (c) a start signal (ID_START) for allocating a sequence ID of the slave devices 201 - 200+N through an output port to the slave device 201 - 200+N) and when the response transmitted from the slave device (201 - 200+N) is received through the input port, a sequence ID is assigned, and the sequence ID of the assigned slave device (201 - 200+N) is and storing in the management table (S14 - S19).

여기서 마스터 디바이스(100)는 슬레이브 디바이스(201 - 200+N)로부터 전송된 응답을 수신한 순서를 마스터 디바이스(100)를 기준으로 한 거리 순서로 인식하고, 거리 순서에 따라 슬레이브 디바이스(201 - 200+N)의 순번 ID를 할당한다.Here, the master device 100 recognizes the order of receiving the response transmitted from the slave devices 201 - 200+N as a distance order based on the master device 100, and according to the distance order, the slave devices 201 - 200 +N) sequence ID is assigned.

도 4b는 슬레이브 디바이스(201 - 200+N)에서 이루어지는 슬레이브 디바이스의 ID의 할당 과정으로서, (d) 입력 포트를 통해 순번 ID를 할당하기 위한 시작신호((ID_START)가 입력되면, 자신의 고유 ID를 상기 마스터 디바이스(100)로 전송하고, 상기 마스터 디바이스(100)로부터 순번 ID를 수신하는 단계(S21 - S22), (e) 상기 (d)단계에서 수신한 순번 ID를 저장하고, 출력포트를 통해 상기 시작신호(ID_START)를 후단으로 출력해주는 단계(S23 - S26)를 포함한다.FIG. 4b is a process of allocating an ID of a slave device performed by the slave devices 201 - 200+N. (d) When a start signal ((ID_START) for allocating a sequence ID is inputted through an input port, its own ID is transmitted to the master device 100, receiving the sequence ID from the master device 100 (S21 - S22), (e) storing the sequence ID received in the step (d), and an output port and outputting the start signal (ID_START) to the rear through the step (S23 - S26).

이와 같이 구성된 본 발명의 "거리 순서에 따른 슬레이브 디바이스의 ID 자동할당방법"의 제1 실시 예를 구체적으로 설명하면 다음과 같다.The first embodiment of the "method for automatically allocating IDs of slave devices according to distance order" of the present invention configured as described above will be described in detail as follows.

먼저, 사용자의 외부 ID 할당 명령에 따라 마스터 디바이스(100)는 단계 S11에서 슬레이브 디바이스의 순번 ID를 자동으로 할당하는 모드로 진입한다.First, according to a user's external ID assignment command, the master device 100 enters a mode of automatically allocating the sequence ID of the slave device in step S11.

이어, 단계 S12에서 통신으로 연결된 슬레이브 디바이스(201 - 200+N)를 스캔하여 슬레이브 디바이스(201 - 200+N)의 고유 ID를 수집한다.Next, in step S12, the slave devices 201 - 200+N connected through communication are scanned to collect unique IDs of the slave devices 201 - 200+N.

여기서 복수의 슬레이브 디바이스(201 - 200+N)는 마스터 디바이스(100)가 통신으로 접속되면, 자신을 식별하기 위한 정보인 고유 ID 정보를 마스터 디바이스(100)로 전송한다.Here, the plurality of slave devices 201 - 200+N transmits unique ID information, which is information for identifying themselves, to the master device 100 when the master device 100 is connected through communication.

단계 S13에서 마스터 디바이스(100)는 수집한 슬레이브 디바이스(201 - 200+N)의 고유 ID를 기초로 관제를 위한 관리 테이블을 생성한다.In step S13, the master device 100 creates a management table for control based on the unique IDs of the collected slave devices (201 - 200+N).

여기서 관리 테이블은 전체 슬레이브 디바이스의 개수 정보, 슬레이브 디바이스의 고유 ID 정보 및 순번 ID 정보를 포함할 수 있다. 상기 슬레이브 디바이스의 스캔을 통해 전체 슬레이브 디바이스의 개수를 산출할 수 있으며, 슬레이브 디바이스의 고유 ID도 확인할 수 있다. 이렇게 산출된 전체 슬레이브 디바이스의 개수 정보 및 슬레이브 디바이스의 고유 ID는 상기 관리 테이블에 저장한다.Here, the management table may include information on the total number of slave devices, unique ID information of the slave devices, and order ID information. The total number of slave devices can be calculated through the scan of the slave devices, and a unique ID of the slave devices can also be checked. Information on the total number of slave devices calculated in this way and unique IDs of the slave devices are stored in the management table.

다음으로, 슬레이브 디바이스의 순번 ID를 할당하기 위해서, 단계 S14에서 순번 ID를 할당하기 위한 시작신호(ID_START)(순번 ID = 1)를 출력포트를 통해 슬레이브 디바이스(201 - 200+N)로 전송한다.Next, in order to allocate the sequence ID of the slave device, a start signal (ID_START) (sequence ID = 1) for allocating the sequence ID in step S14 is transmitted to the slave devices 201 - 200+N through the output port. .

상기 시작신호를 수신한 슬레이브 디바이스(예를 들어, 201)는 응답 신호로 자신의 고유 ID를 상기 마스터 디바이스(100)로 전송한다. 단계 S15에서 마스터 디바이스(100)는 슬레이브 디바이스로부터 전송된 응답 신호인 고유 ID를 확인한다.The slave device (eg, 201 ) that has received the start signal transmits its own ID to the master device 100 as a response signal. In step S15, the master device 100 checks the unique ID, which is a response signal transmitted from the slave device.

이어, 단계 S16에서 확인한 고유 ID에 해당하는 슬레이브 디바이스를 자신으로부터 가장 거리상 근접한 첫 번째 슬레이브 디바이스로 판단하고, 순번 ID로 1을 부여하고, 관리 테이블의 순번 ID를 갱신한다. 즉, 관리 테이블의 순번 ID 1에 해당 슬레이브 디바이스의 고유 ID를 매칭한다.Next, the slave device corresponding to the unique ID confirmed in step S16 is determined as the first slave device closest to the first slave device in terms of distance, and 1 is assigned as the order ID, and the order ID of the management table is updated. That is, the unique ID of the corresponding slave device is matched with the order ID 1 of the management table.

이어, 단계 S17에서 현재 순번 ID에 1을 가산하여 순번 ID를 설정하고, 이를 다시 슬레이브 디바이스(202 - 200+N)에 전송한다.Next, in step S17, 1 is added to the current sequence ID to set the sequence ID, and the sequence ID is again transmitted to the slave devices 202 - 200+N.

이때, 순번 ID를 부여받은 첫 번째 슬레이브 디바이스(201)는 순번 ID를 부여받으면 이를 저장하고, 출력포트를 통해 시작신호를 연결된 후단 슬레이브 디바이스(202)로 전송한다.At this time, when the first slave device 201 to which the turn ID is assigned receives the turn ID, it stores it, and transmits a start signal to the connected downstream slave device 202 through the output port.

상기 시작신호를 수신한 슬레이브 디바이스(202)는 응답 신호로 자신의 고유 ID를 상기 마스터 디바이스(100)로 전송한다. 마스터 디바이스(100)는 슬레이브 디바이스로부터 전송된 응답 신호인 고유 ID를 확인한다.The slave device 202 receiving the start signal transmits its own ID to the master device 100 as a response signal. The master device 100 checks the unique ID, which is a response signal transmitted from the slave device.

이어, 확인한 고유 ID에 해당하는 슬레이브 디바이스를 자신으로부터 가장 거리상 근접한 두 번째 슬레이브 디바이스로 판단하고, 순번 ID로 2를 부여하고, 관리 테이블의 순번 ID를 갱신한다. 즉, 관리 테이블의 순번 ID 2에 해당 슬레이브 디바이스의 고유 ID를 매칭한다.Next, it is determined that the slave device corresponding to the identified unique ID is the second slave device closest to it in terms of distance, assigns 2 as the sequence ID, and updates the sequence ID of the management table. That is, the unique ID of the corresponding slave device is matched with the order ID 2 of the management table.

이어, 다시 현재 순번 ID에 1을 가산하여 순번 ID를 설정하고, 이를 다시 슬레이브 디바이스(202 - 200+N)에 전송한다.Next, 1 is added to the current turn ID again to set the turn ID, and it is again transmitted to the slave devices 202 - 200+N.

이러한 과정은 관리 테이블에 생성한 전체 슬레이브 디바이스의 개수에 대응하는 횟수만큼 반복 수행되며, 단계 S18에서 순번 ID가 전체 슬레이브 디바이스의 개수(N)보다 크면 연결된 모든 슬레이브 디바이스의 순번 ID의 할당이 완료된 것으로 판단을 한다.This process is repeated as many times as the number of times corresponding to the total number of slave devices created in the management table, and if the sequence ID is greater than the total number of slave devices (N) in step S18, the assignment of sequence IDs of all connected slave devices is completed. make a judgment

순번 ID의 할당이 완료되면 단계 S19로 이동하여, 순번 ID의 할당을 종료하고, 생성한 관리 테이블을 저장한다.When the assignment of the sequence ID is completed, the flow advances to step S19, the assignment of the sequence ID is finished, and the generated management table is stored.

이후 관리 테이블을 기준으로 마스터 디바이스에서는 슬레이브 디바이스를 관제하면 된다.After that, the master device can control the slave device based on the management table.

한편, 슬레이브 디바이스(201 - 200+N)는 도 4b에 도시한 바와 같이, 단계 S21에서 입력 포트를 통해 순번 ID를 할당하기 위한 시작신호((ID_START)가 입력되면, 단계 S22와 같이 응답 신호를 마스터 디바이스에 전송한다. 여기서 응답 신호로는 마스터 디바이스로 시작신호를 수신했다는 신호이거나 마스터 디바이스의 요청에 따라 신호 수신을 회신하는 방법을 이용할 수 있다.On the other hand, as shown in FIG. 4b, the slave devices 201 - 200+N receive a response signal as shown in step S22 when a start signal ((ID_START) for allocating a sequence ID is inputted through the input port in step S21. It is transmitted to the master device, where the response signal is a signal that the start signal has been received by the master device or a method of replying to the signal reception according to the request of the master device may be used.

이후, 단계 S23에서 슬레이브 디바이스(201)는 자신의 고유 ID를 상기 마스터 디바이스(100)로 전송하고, 단계 S24에서 상기 마스터 디바이스(100)로부터 순번 ID를 수신한다.Thereafter, the slave device 201 transmits its own ID to the master device 100 in step S23, and receives a sequence ID from the master device 100 in step S24.

이어, 단계 S25에서 수신한 순번 ID를 저장하고, 단계 S26에서 출력포트를 통해 상기 시작신호(ID_START)를 후단으로 출력해준다.Next, the sequence ID received in step S25 is stored, and the start signal ID_START is output to the rear end through an output port in step S26.

여기서 후단은 다른 슬레이브 디바이스로서, 다른 슬레이브 디바이스도 상기와 같이 시작신호를 수신하면 전단의 슬레이브 디바이스와 동일하게 동작을 하여 순번 ID를 할당받고, 그 이하의 단계를 수행한다.Here, the rear stage is another slave device, and when the other slave device receives the start signal as described above, it operates in the same manner as the previous stage slave device, is assigned a sequence ID, and performs the following steps.

이러한 과정을 통해 마스터 디바이스에 연결된 모든 슬레이브 디바이스의 순번 ID를 자동으로 할당하게 되는 것이다.Through this process, the sequence IDs of all slave devices connected to the master device are automatically assigned.

도 5a 및 도 5b는 본 발명의 "거리 순서에 따른 슬레이브 디바이스의 ID 자동할당방법"의 제2 실시 예를 보인 흐름도로서, 단일의 마스터 디바이스와 그 하위에 복수의 슬레이브 디바이스가 링 구조로 연결되어 통신이 이루어지는 시스템에서 복수의 슬레이브 디바이스의 ID를 자동으로 할당하기 위한 방법이다.5A and 5B are flowcharts showing a second embodiment of "a method for automatically assigning IDs to slave devices according to distance order" of the present invention, in which a single master device and a plurality of slave devices below it are connected in a ring structure. A method for automatically allocating IDs of a plurality of slave devices in a communication system.

도 5a는 마스터 디바이스(100)에서 슬레이브 디바이스의 순번 ID를 자동으로 할당하는 과정으로서, (a) 슬레이브 디바이스(201 - 200+N)의 순번 ID 할당시 슬레이브 디바이스(201 - 200+N)의 관제를 위한 관리 테이블을 생성하는 단계(S31 - S32), (b) 상기 슬레이브 디바이스(201 - 200+N)의 순번 ID를 할당하기 위한 시작신호(ID_START)를 출력포트를 통해 슬레이브 디바이스(201 - 200+N)로 전송하고, 슬레이브 디바이스(201 - 200+N)로부터 전송된 응답을 입력포트를 통해 수신하면 순번 ID를 할당하고, 할당된 슬레이브 디바이스(201 - 200+N)의 순번 ID와 슬레이브 디바이스(201 - 200+N)의 고유 ID 및 하위에 연결된 전체 슬레이브 디바이스의 개수 정보를 상기 관리 테이블에 저장하는 단계(S33 - S38)를 포함한다.5a is a process of automatically allocating the sequence ID of the slave device in the master device 100. (a) Control of the slave device (201 - 200+N) when the sequence ID of the slave device (201 - 200+N) is allocated generating a management table for (S31 - S32), (b) a start signal (ID_START) for allocating a sequence ID of the slave devices 201 - 200+N through an output port to the slave devices 201 - 200 +N) and when a response transmitted from the slave device (201 - 200+N) is received through the input port, a sequence ID is assigned, and the sequence ID of the assigned slave device (201 - 200+N) and the slave device and storing ( S33 - S38 ) the unique ID of (201 - 200+N) and information on the number of all slave devices connected to the lower level in the management table.

도 5b는 복수의 슬레이브 디바이스(201 = 200+N)에서 거리 순서에 따라 ID를 자동으로 할당받는 과정을 보인 것으로서, (c) 입력 포트를 통해 순번 ID를 할당하기 위한 시작신호(ID_START)가 입력되면, 자신의 고유 ID를 상기 마스터 디바이스(100)로 전송하고, 상기 마스터 디바이스(100)로부터 순번 ID를 수신하는 단계(S41 - S44), (d) 상기 (c)단계에서 수신한 순번 ID를 저장하고, 출력포트를 통해 상기 시작신호(ID_START)를 후단으로 출력해주는 단계(S45 - S46)를 포함한다.FIG. 5b shows a process in which IDs are automatically assigned according to distance order from a plurality of slave devices (201 = 200+N), (c) a start signal (ID_START) for allocating a sequence ID through an input port is input If it is, it transmits its own ID to the master device 100, and receives the sequence ID from the master device 100 (S41 - S44), (d) the sequence ID received in the step (c) and outputting the start signal (ID_START) to the rear end through an output port (S45 - S46).

이와 같이 구성된 본 발명의 "거리 순서에 따른 슬레이브 디바이스의 ID 자동할당방법"의 제2 실시 예를 구체적으로 설명하면 다음과 같다.A second embodiment of the "method for automatically allocating IDs of slave devices according to distance order" of the present invention configured as described above will be described in detail.

먼저, 사용자의 외부 ID 할당 명령에 따라 마스터 디바이스(100)는 단계 S31에서 슬레이브 디바이스의 순번 ID를 자동으로 할당하는 모드로 진입한다.First, in response to a user's external ID assignment command, the master device 100 enters a mode in which a sequence ID of the slave device is automatically assigned in step S31.

이어, 단계 S32에서 통신으로 연결된 슬레이브 디바이스(201 - 200+N)의 관제를 위한 관리 테이블을 생성한다.Next, in step S32, a management table for controlling the slave devices 201 - 200+N connected by communication is generated.

여기서 관리 테이블은 전체 슬레이브 디바이스의 개수 정보, 슬레이브 디바이스의 고유 ID 정보 및 순번 ID 정보를 포함할 수 있다. Here, the management table may include information on the total number of slave devices, unique ID information of the slave devices, and order ID information.

다음으로, 슬레이브 디바이스의 순번 ID를 할당하기 위해서, 단계 S33에서 순번 ID를 할당하기 위한 시작신호(ID_START)(순번 ID = 1)를 출력포트를 통해 슬레이브 디바이스(201 - 200+N)로 전송한다.Next, in order to allocate the sequence ID of the slave device, a start signal (ID_START) (sequence ID = 1) for allocating the sequence ID in step S33 is transmitted to the slave devices 201 - 200+N through the output port. .

상기 시작신호를 수신한 슬레이브 디바이스(예를 들어, 201)는 응답 신호로 자신의 고유 ID를 상기 마스터 디바이스(100)로 전송한다. 단계 S34에서 마스터 디바이스(100)는 슬레이브 디바이스로부터 전송된 응답 신호인 고유 ID를 확인한다.The slave device (eg, 201) that has received the start signal transmits its own ID to the master device 100 as a response signal. In step S34, the master device 100 checks the unique ID, which is a response signal transmitted from the slave device.

이어, 단계 S35에서 확인한 고유 ID에 해당하는 슬레이브 디바이스를 자신으로부터 가장 거리상 근접한 첫 번째 슬레이브 디바이스로 판단하고, 순번 ID로 1을 부여하고, 관리 테이블의 순번 ID를 갱신한다. 즉, 관리 테이블의 순번 ID 1에 해당 슬레이브 디바이스의 고유 ID를 매칭한다.Next, the slave device corresponding to the unique ID confirmed in step S35 is determined as the first slave device closest to the first slave device in terms of distance, and 1 is assigned as the order ID, and the order ID of the management table is updated. That is, the unique ID of the corresponding slave device is matched with the order ID 1 of the management table.

이어, 단계 S36에서 현재 순번 ID에 1을 가산하여(순번 ID + 1) 순번 ID를 설정하고, 이를 다시 슬레이브 디바이스(202 - 200+N)에 전송한다.Next, in step S36, 1 is added to the current sequence ID (sequence ID + 1) to set the sequence ID, and this is again transmitted to the slave devices 202 - 200+N.

이때, 순번 ID를 부여받은 첫 번째 슬레이브 디바이스(201)는 순번 ID를 부여받으면 이를 저장하고, 출력포트를 통해 시작신호를 연결된 후단 슬레이브 디바이스(202)로 전송한다.At this time, the first slave device 201 to which the sequence ID is assigned stores the sequence ID when it is assigned, and transmits a start signal to the connected downstream slave device 202 through the output port.

상기 시작신호를 수신한 슬레이브 디바이스(202)는 응답 신호로 자신의 고유 ID를 상기 마스터 디바이스(100)로 전송한다. 마스터 디바이스(100)는 슬레이브 디바이스로부터 전송된 응답 신호인 고유 ID를 확인한다.The slave device 202 receiving the start signal transmits its own ID to the master device 100 as a response signal. The master device 100 checks the unique ID, which is a response signal transmitted from the slave device.

이어, 확인한 고유 ID에 해당하는 슬레이브 디바이스를 자신으로부터 가장 거리상 근접한 두 번째 슬레이브 디바이스로 판단하고, 순번 ID로 2를 부여하고, 관리 테이블의 순번 ID를 갱신한다. 즉, 관리 테이블의 순번 ID 2에 해당 슬레이브 디바이스의 고유 ID를 매칭한다.Next, it is determined that the slave device corresponding to the identified unique ID is the second slave device closest to it in terms of distance, assigns 2 as the sequence ID, and updates the sequence ID of the management table. That is, the unique ID of the corresponding slave device is matched with the order ID 2 of the management table.

이어, 다시 현재 순번 ID에 1을 가산하여 순번 ID를 설정하고, 이를 다시 슬레이브 디바이스(202 - 200+N)에 전송한다.Next, 1 is added to the current turn ID again to set the turn ID, and it is again transmitted to the slave devices 202 - 200+N.

이러한 과정은 마스터 디바이스에 연결된 모든 슬레이브 디바이스에서 동일하게 이루어지며, 다만, 맨 마지막에 연결된 슬레이브 디바이스는 시작신호(ID_START)를 개별 통신 케이블을 통해 다시 마스터 디바이스(100)에 전송한다.This process is the same for all slave devices connected to the master device, but the last connected slave device transmits the start signal ID_START back to the master device 100 through an individual communication cable.

마스터 디바이스는 단계 S37과 같이 시작신호를 수신하면, 해당 슬레이브 디바이스가 마지막 슬레이브 디바이스라고 판단을 한다.When the master device receives the start signal as in step S37, it is determined that the corresponding slave device is the last slave device.

이후, 단계 S38에서 모든 슬레이브 디바이스의 순번 ID의 할당이 완료된 것으로 판단을 하고, 순번 ID의 할당을 종료하고, 생성한 관리 테이블을 저장한다.Thereafter, in step S38, it is determined that the assignment of the order IDs of all the slave devices is completed, the assignment of the order IDs is terminated, and the generated management table is stored.

여기서 부여한 순번 ID를 통해 전체 슬레이브 디바이스의 개수도 알 수 있으며, 관리 테이블에는 전체 슬레이브 디바이스의 개수 정보, 슬레이브 디바이스의 고유 ID 정보, 슬레이브 디바이스의 순번 ID 정보를 업데이트하여 저장한다.The total number of slave devices can also be known through the given sequence ID, and information on the total number of slave devices, unique ID information of the slave devices, and sequence ID information of the slave devices are updated and stored in the management table.

이후 관리 테이블을 기준으로 마스터 디바이스에서는 슬레이브 디바이스를 관제하면 된다.After that, the master device can control the slave device based on the management table.

한편, 슬레이브 디바이스(201 - 200+N)는 도 5b에 도시한 바와 같이, 단계 S41에서 입력 포트를 통해 순번 ID를 할당하기 위한 시작신호((ID_START)가 입력되면, 단계 S42와 같이 응답 신호를 마스터 디바이스에 전송한다. 여기서 응답 신호로는 마스터 디바이스로 시작신호를 수신했다는 신호이거나 마스터 디바이스의 요청에 따라 신호 수신을 회신하는 방법을 이용할 수 있다.On the other hand, as shown in FIG. 5b, the slave devices 201 - 200+N receive a response signal as shown in step S42 when a start signal ((ID_START) for allocating a sequence ID is inputted through the input port in step S41. It is transmitted to the master device, where the response signal is a signal that the start signal has been received by the master device or a method of replying to the signal reception according to the request of the master device may be used.

이후, 단계 S43에서 슬레이브 디바이스(201)는 자신의 고유 ID를 상기 마스터 디바이스(100)로 전송하고, 단계 S44에서 상기 마스터 디바이스(100)로부터 전송된 순번 ID를 수신한다.Thereafter, the slave device 201 transmits its own ID to the master device 100 in step S43, and receives the sequence ID transmitted from the master device 100 in step S44.

이어, 단계 S45에서 수신한 순번 ID를 저장하고, 단계 S46에서 출력포트를 통해 상기 시작신호(ID_START)를 후단으로 출력해준다.Next, the sequence ID received in step S45 is stored, and the start signal ID_START is output to the rear end through an output port in step S46.

여기서 후단은 다른 슬레이브 디바이스일 수 있으나, 맨 마지막에 위치한 슬레이브 디바이스는 후단이 마스터 디바이스가 된다.Here, the rear end may be another slave device, but in the last slave device, the rear end becomes the master device.

이러한 과정을 통해 마스터 디바이스에 연결된 모든 슬레이브 디바이스의 순번 ID를 거리 순서에 따라 자동으로 할당하게 되는 것이다.Through this process, the sequence IDs of all slave devices connected to the master device are automatically assigned according to the distance order.

이상 본 발명자에 의해서 이루어진 발명을 상기 실시 예에 따라 구체적으로 설명하였지만, 본 발명은 상기 실시 예에 한정되는 것은 아니고 그 요지를 이탈하지 않는 범위에서 여러 가지로 변경 가능한 것은 이 기술분야에서 통상의 지식을 가진 자에게 자명하다.Although the invention made by the present inventor has been described in detail according to the above embodiment, the present invention is not limited to the above embodiment, and it is common knowledge in the art that various changes can be made without departing from the gist of the present invention. self-evident to those who have

100: 마스터 디바이스
201 - 200+N: 슬레이브 디바이스
201a: 제1입출력포트
202b: 제2입출력포트
100: master device
201 - 200+N: slave device
201a: first input/output port
202b: second input/output port

Claims (5)

단일의 마스터 디바이스와 그 하위에 복수의 슬레이브 디바이스가 연결되어 통신이 이루어지는 시스템에서 복수의 슬레이브 디바이스의 순번 ID를 자동으로 할당하기 위한 방법으로서,
상기 마스터 디바이스는,
(a) 슬레이브 디바이스의 순번 ID를 할당시 통신으로 연결된 슬레이브 디바이스를 스캔하여 슬레이브 디바이스의 고유 ID를 수집하는 단계;
(b) 상기 (a)단계에서 수집한 슬레이브 디바이스의 고유 ID를 기초로 관제를 위한 관리 테이블을 생성하는 단계;
(c) 상기 슬레이브 디바이스의 순번 ID를 할당하기 위한 시작신호를 출력포트를 통해 슬레이브 디바이스로 전송하고, 슬레이브 디바이스로부터 전송된 응답을 입력포트를 통해 수신하면 순번 ID를 할당하고, 할당된 슬레이브 디바이스의 순번 ID를 상기 관리 테이블에 저장하는 단계를 실행하고,
상기 복수의 슬레이브 디바이스는,
(d) 입력 포트를 통해 순번 ID를 할당하기 위한 시작신호가 입력되면, 자신의 고유 ID를 상기 마스터 디바이스로 전송하고, 상기 마스터 디바이스로부터 순번 ID를 수신하는 단계;
(e) 상기 (d)단계에서 수신한 순번 ID를 저장하고, 출력포트를 통해 상기 시작신호를 후단으로 출력해주는 단계를 실행하며,
상기 마스터 디바이스는 슬레이브 디바이스로부터 전송된 응답을 수신한 순서를 마스터 디바이스와의 거리 순서로 인식하고, 거리 순서에 따라 슬레이브 디바이스의 순번 ID를 할당하며,
상기 순번 ID는 마스터 디바이스에서 몇 번째로 연결된 슬레이브 디바이스인지를 식별하기 위한 식별정보인 것을 특징으로 하는 거리 순서에 따른 슬레이브 디바이스의 ID 자동할당방법.
A method for automatically allocating a sequence ID of a plurality of slave devices in a system in which a single master device and a plurality of slave devices are connected to and communicated thereunder,
The master device is
(a) collecting a unique ID of the slave device by scanning a communication-connected slave device when assigning a sequence ID of the slave device;
(b) generating a management table for control based on the unique ID of the slave device collected in step (a);
(c) When a start signal for allocating the sequence ID of the slave device is transmitted to the slave device through the output port, and a response transmitted from the slave device is received through the input port, the sequence ID is assigned, and the Execute the step of storing the sequence ID in the management table,
The plurality of slave devices,
(d) when a start signal for allocating a turn ID is input through an input port, transmitting its own ID to the master device, and receiving a turn ID from the master device;
(e) storing the sequence ID received in step (d) and outputting the start signal to the rear through an output port;
The master device recognizes the order of receiving the response transmitted from the slave device as the distance order with the master device, and assigns the order ID of the slave device according to the distance order,
The sequence ID is identification information for identifying the number of connected slave devices in the master device. The method for automatically assigning IDs to slave devices according to distance order.
삭제delete 청구항 1에서, 상기 복수의 슬레이브 디바이스는 전단장치와 통신을 위한 제1입출력포트, 후단장치와 통신을 위한 제2입출력포트를 구비한 것을 특징으로 하는 거리 순서에 따른 슬레이브 디바이스의 ID 자동할당방법.
The method according to claim 1, wherein the plurality of slave devices have a first input/output port for communication with the front end device and a second input/output port for communication with the rear end device.
단일의 마스터 디바이스와 그 하위에 복수의 슬레이브 디바이스가 연결되어 통신이 이루어지는 시스템에서 복수의 슬레이브 디바이스의 순번 ID를 자동으로 할당하기 위한 방법으로서,
상기 마스터 디바이스는,
(a) 슬레이브 디바이스의 순번 ID를 할당시 슬레이브 디바이스의 관제를 위한 관리 테이블을 생성하는 단계;
(b) 상기 슬레이브 디바이스의 순번 ID를 할당하기 위한 시작신호를 출력포트를 통해 슬레이브 디바이스로 전송하고, 슬레이브 디바이스로부터 전송된 응답을 입력포트를 통해 수신하면 순번 ID를 할당하고, 할당된 슬레이브 디바이스의 순번 ID와 슬레이브 디바이스의 고유 ID 및 하위에 연결된 전체 슬레이브 디바이스의 개수 정보를 상기 관리 테이블에 저장하는 단계를 실행하고,
상기 복수의 슬레이브 디바이스는,
(c) 입력 포트를 통해 순번 ID를 할당하기 위한 시작신호가 입력되면, 자신의 고유 ID를 상기 마스터 디바이스로 전송하고, 상기 마스터 디바이스로부터 순번 ID를 수신하는 단계;
(d) 상기 (c)단계에서 수신한 순번 ID를 저장하고, 출력포트를 통해 상기 시작신호를 후단으로 출력해주는 단계를 실행하며,
상기 마스터 디바이스는 슬레이브 디바이스로부터 전송된 응답을 수신한 순서를 마스터 디바이스와의 거리 순서로 인식하고, 거리 순서에 따라 슬레이브 디바이스의 순번 ID를 할당하며,
상기 순번 ID는 마스터 디바이스에서 몇 번째로 연결된 슬레이브 디바이스인지를 식별하기 위한 식별정보인 것을 특징으로 하는 거리 순서에 따른 슬레이브 디바이스의 ID 자동할당방법.

A method for automatically allocating a sequence ID of a plurality of slave devices in a system in which a single master device and a plurality of slave devices are connected to and communicated thereunder,
The master device is
(a) generating a management table for the control of the slave device when assigning a sequence ID of the slave device;
(b) When a start signal for allocating the sequence ID of the slave device is transmitted to the slave device through the output port, and a response transmitted from the slave device is received through the input port, the sequence ID is assigned, and the Execute the step of storing the sequence number ID, the unique ID of the slave device, and the number information of all slave devices connected to the lower level in the management table,
The plurality of slave devices,
(c) when a start signal for allocating a turn ID is input through an input port, transmitting its own ID to the master device, and receiving a turn ID from the master device;
(d) storing the sequence ID received in step (c) and outputting the start signal to the rear through an output port;
The master device recognizes the order of receiving the response transmitted from the slave device as the distance order with the master device, and assigns the order ID of the slave device according to the distance order,
The sequence ID is identification information for identifying the number of connected slave devices in the master device. The method for automatically assigning IDs to slave devices according to distance order.

삭제delete
KR1020200064937A 2020-05-29 2020-05-29 Automatic ID allocation method of slave devices according to distance order KR102268139B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020200064937A KR102268139B1 (en) 2020-05-29 2020-05-29 Automatic ID allocation method of slave devices according to distance order

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020200064937A KR102268139B1 (en) 2020-05-29 2020-05-29 Automatic ID allocation method of slave devices according to distance order

Publications (1)

Publication Number Publication Date
KR102268139B1 true KR102268139B1 (en) 2021-06-22

Family

ID=76600916

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020200064937A KR102268139B1 (en) 2020-05-29 2020-05-29 Automatic ID allocation method of slave devices according to distance order

Country Status (1)

Country Link
KR (1) KR102268139B1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20060021513A (en) * 2004-09-03 2006-03-08 주식회사 대우일렉트로닉스 Method for setting network address of slave device in home network system
KR100913263B1 (en) 2007-11-21 2009-08-21 주식회사 현대오토넷 Method of automatically issuing local interconnect network identification to slave module and slave module
KR20110107626A (en) 2010-03-25 2011-10-04 엘에스산전 주식회사 Slave apparatus and method for assigning id to slave apparatus
JP2016134879A (en) * 2015-01-22 2016-07-25 富士機械製造株式会社 Apparatus id assignment system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20060021513A (en) * 2004-09-03 2006-03-08 주식회사 대우일렉트로닉스 Method for setting network address of slave device in home network system
KR100913263B1 (en) 2007-11-21 2009-08-21 주식회사 현대오토넷 Method of automatically issuing local interconnect network identification to slave module and slave module
KR20110107626A (en) 2010-03-25 2011-10-04 엘에스산전 주식회사 Slave apparatus and method for assigning id to slave apparatus
JP2016134879A (en) * 2015-01-22 2016-07-25 富士機械製造株式会社 Apparatus id assignment system

Similar Documents

Publication Publication Date Title
US6222853B1 (en) Communication system for a line network
CN101785367B (en) Method for the start-up of a lighting system
CN110247997B (en) Method, device and storage medium for IP address allocation and topology management in DAS system
US5615106A (en) Control device
EP0787393A2 (en) Local area method arrangement
KR102268139B1 (en) Automatic ID allocation method of slave devices according to distance order
CN107734082B (en) Address allocation method and system
EP1527555A1 (en) Method for confirming connection state of a home appliance in home network system
CN101622796A (en) Communication system, communication device, communication terminal, and communication setting method
KR100633061B1 (en) Network system and method for assigning address
JP4355028B2 (en) Distributed serial control system
EP1157525A1 (en) Network addressing based on the port of a network switch
CN114039950B (en) Method for automatically distributing address of RS485 bus slave device
JP2932869B2 (en) Communication terminal adapter
CN116208551B (en) Data transmission method, device, equipment and storage medium
JP2001359150A (en) Method for assigning id to control station and base station in imt-2000 system
AU3530389A (en) Apparatus and method for mapping the connectivity of communications systems with multiple communications paths
US5999607A (en) Method and apparatus for restricting dialing authorization in communication devices
JP2983029B2 (en) Network termination device
JP3632729B2 (en) Remote monitoring system
CN116367138A (en) Distribution network method of electronic equipment, distribution network equipment and computer readable storage medium
KR0160744B1 (en) Detecting method of double fixing of communication password of manless surveillance system
CN115714936A (en) Method and device for sequential addressing of slave stations
JPH02272843A (en) Data transmission equipment
JPH07162921A (en) System for automatically allocating terminal number of terminal equipment

Legal Events

Date Code Title Description
E701 Decision to grant or registration of patent right
GRNT Written decision to grant