CN101232425B - A peer-to-peer control method for master-slave stations in a bus-type distributed control system - Google Patents

A peer-to-peer control method for master-slave stations in a bus-type distributed control system Download PDF

Info

Publication number
CN101232425B
CN101232425B CN2007100265731A CN200710026573A CN101232425B CN 101232425 B CN101232425 B CN 101232425B CN 2007100265731 A CN2007100265731 A CN 2007100265731A CN 200710026573 A CN200710026573 A CN 200710026573A CN 101232425 B CN101232425 B CN 101232425B
Authority
CN
China
Prior art keywords
station
command
master
master station
slave station
Prior art date
Legal status (The legal status 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 status listed.)
Expired - Fee Related
Application number
CN2007100265731A
Other languages
Chinese (zh)
Other versions
CN101232425A (en
Inventor
欧晓明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Comba Network Systems Co Ltd
Original Assignee
Comba Telecom Systems China Ltd
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 Comba Telecom Systems China Ltd filed Critical Comba Telecom Systems China Ltd
Priority to CN2007100265731A priority Critical patent/CN101232425B/en
Publication of CN101232425A publication Critical patent/CN101232425A/en
Application granted granted Critical
Publication of CN101232425B publication Critical patent/CN101232425B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Small-Scale Networks (AREA)

Abstract

本发明提供一种总线式分布控制系统主从站对端控制方法,本方法与目前通常采用的令牌控制方法、标准数据通信控制规程方法相比,具有实现简单、效率高、占用资源小等特点,该方法尤其适合于硬件上为半双工的总线式分布控制系统,如RS-485总线等,在控制方法上通过独特控制标志和配合控制流程,实现简单高效的对端控制功能。

Figure 200710026573

The invention provides a master-slave station-to-end control method of a bus-type distributed control system. Compared with the token control method and the standard data communication control procedure method commonly used at present, the method has the advantages of simple implementation, high efficiency, and small resource occupation. Features, this method is especially suitable for half-duplex bus-type distributed control systems in hardware, such as RS-485 bus, etc. In terms of control methods, simple and efficient peer-to-peer control functions are realized through unique control signs and cooperative control processes.

Figure 200710026573

Description

一种总线式分布控制系统主从站对端控制方法A peer-to-peer control method for master-slave stations in a bus-type distributed control system

技术领域technical field

本发明涉及总线式分布控制系统主从站通信技术,具体是指一种总线式分布控制系统主从站对端控制方法。The invention relates to a master-slave station communication technology of a bus-type distributed control system, in particular to a master-slave station-to-end control method of a bus-type distributed control system.

背景技术Background technique

随着控制系统的复杂程度不断提高,大量的控制系统已由过去的单机控制转变为多机集散式控制,通常也称作分布式控制。在嵌入式领域,分布式控制系统由一个主处理器协调和控制多个从处理器共同完成控制功能,通常我们称主处理器组成的控制模块为“主站”,每个从处理器组成的控制模块为“从站”。集散控制要求主站和从站间必须能相互通信,目前通常采用的主从站通信连接方式有RS-485、RS-422、CAN、Ethernet等,在众多的方式中RS-485方式具有简单可靠、传输距离远、成本低等优势,被广泛用于小到板级间通信,大到楼宇间通信等领域。With the increasing complexity of control systems, a large number of control systems have changed from single-machine control to multi-machine centralized control, which is also called distributed control. In the embedded field, a distributed control system coordinates and controls multiple slave processors to complete the control function by a master processor. Usually we call the control module composed of the master processor a "master station", and each slave processor consists of The control module is a "slave". Distributed control requires that the master station and the slave station must be able to communicate with each other. Currently, the master-slave station communication connection methods commonly used include RS-485, RS-422, CAN, Ethernet, etc. Among many methods, the RS-485 method is simple and reliable. , long transmission distance, low cost and other advantages, it is widely used in fields ranging from board-level communication to building-to-building communication.

由于RS-485链路是半双工的通信链路,即每一时刻总线链路上只允许一个站点发送数据,否则就会出现数据冲突而破坏数据。因此基于RS-485方式的控制系统中,通常会设定一个站点为主站,其他站点为从站,由主站来协调各从站的通信。主站协调从站的传统方法是采用令牌方法,控制特点简要描述如下:Since the RS-485 link is a half-duplex communication link, that is, only one station is allowed to send data on the bus link at each moment, otherwise data conflicts will occur and the data will be destroyed. Therefore, in the control system based on RS-485 mode, one station is usually set as the master station, and the other stations are slave stations, and the master station coordinates the communication of each slave station. The traditional method for the master station to coordinate the slave station is to use the token method, and the control characteristics are briefly described as follows:

(1)主站对从站的控制通常分查询帧、设置帧和轮询帧,当从站收到查询帧或设置帧时是被动对帧中的内容作响应,而收到轮询帧时从站可以主动向主站发数据,以从主站获得自己需要的数据。通常主站会定时且较高密度的发出轮询帧,而查询帧和设置帧通常在需要的时候才发送。(1) The control of the master station to the slave station is usually divided into query frame, setting frame and polling frame. When the slave station receives the query frame or setting frame, it passively responds to the content in the frame, and when The slave station can actively send data to the master station to obtain the data it needs from the master station. Usually the master station will send out polling frames at regular intervals and with high density, while query frames and setting frames are usually sent only when needed.

(2)从站需获得主站发出的允许从站发送令牌后,才能主动发起从站对主站的命令请求,主站在响应从站对主站命令请求时不能同时查询得到从站的实时数据。(2) The slave station needs to obtain the permission from the master station to send the token before it can actively initiate the command request from the slave station to the master station. When the master station responds to the command request from the slave station to the master station, it cannot simultaneously query the Real-time data.

(3)主站在处理完的从站对主站的命令请求后,需要另外进行主站查询从站数据的操作,才可获得从站实时数据。(3) After the master station has processed the command request from the slave station to the master station, the master station needs to perform the operation of querying the data of the slave station in addition to obtain the real-time data of the slave station.

当然,主从站通信还可采用一些标准数据通信控制规程,如ADCCP、SDLC/HDLC等,但无论是采用前面描述的令牌方式还是标准数据通信控制规程,其缺点都是实现较复杂、耗费处理器资源比较多。Of course, some standard data communication control procedures can also be used for master-slave communication, such as ADCCP, SDLC/HDLC, etc., but whether the token method described above or the standard data communication control procedures are used, the disadvantages are that the implementation is more complicated and costly. More processor resources.

发明内容Contents of the invention

本发明的目的在于克服上述现有技术的缺点和不足,提供简单高效的一种总线式分布控制系统主从站对端控制方法。The object of the present invention is to overcome the shortcomings and deficiencies of the above-mentioned prior art, and provide a simple and efficient master-slave station-to-end control method of a bus-type distributed control system.

本发明的目的通过下述技术方案实现:本一种总线式分布控制系统主从站对端控制方法,其包括以下步骤:The purpose of the present invention is achieved through the following technical solutions: a master-slave station-to-end control method of a bus type distributed control system, which comprises the following steps:

(1)各从站都处在接收状态,主站通过总线发送对从站1的命令,发送完成后等待接收从站返回;(1) Each slave station is in the receiving state, the master station sends a command to slave station 1 through the bus, and waits for the receiving slave station to return after sending;

(2)因为每个从站都有一个独立的地址,主站发出的命令中会指定从站地址,因此所有的从站都能接收到主站命令,但只有符合主站命令中地址的从站1才会响应,从站1识别该命令并处理完形成主站命令返回数据包“A”,同时检查本站是否有操作主站的命令请求,如果没有则将主站命令返回数据包“A”直接返回给主站;如果从站1有对主站的操作命令请求,则将主站命令返回数据包“A”连同从站1对主站操作命令包“B”一起返回给主站,此时,所述主站命令返回数据包“A”和从站1对主站操作命令包“B”之间采用反向命令特殊标识符“F”分隔,然后从站1进入等待主站返回状态;(2) Because each slave station has an independent address, the slave station address will be specified in the command issued by the master station, so all slave stations can receive the master station command, but only the slave station that matches the address in the master station command Station 1 will respond. Slave station 1 recognizes the command and completes processing to form a master station command to return a data packet "A". At the same time, check whether this station has a command request to operate the master station. A" directly returns to the master station; if slave station 1 has an operation command request to the master station, the master station command return data packet "A" will be returned to the master station together with slave station 1's operation command packet "B" to the master station , at this time, the master station command return data packet "A" and the slave station 1 to the master station operation command packet "B" are separated by the reverse command special identifier "F", and then the slave station 1 enters the waiting master station return status;

(3)当主站收到了从站1返回的数据后,则主站先识别返回数据中是否有反向命令特殊标识符“F”,如果有则对返回数据进行两次处理:首先处理主站命令返回数据包“A”,然后处理从站1对主站操作命令包“B”,得到返回数据包“B1”,在得到“B1”后,相应再次生成主站对从站1的命令,该命令连同“B1”一同返回给从站1,该命令和返回数据包“B1”之间采用反向命令特殊标识符“F”分隔;(3) When the master station receives the data returned from slave station 1, the master station will first identify whether there is a reverse command special identifier "F" in the returned data, and if there is, it will process the returned data twice: first process the master The station command returns the data packet "A", and then processes the operation command packet "B" from the slave station 1 to the master station, and obtains the returned data packet "B1". After obtaining "B1", the corresponding command from the master station to the slave station 1 is generated again , the command is returned to slave station 1 together with "B1", and the command and the returned data packet "B1" are separated by the reverse command special identifier "F";

(4)从站1在收到主站命令后,则先识别返回数据中是否有反向命令特殊标识符“F”,如果有则对返回数据进行两次处理,首先处理主站对从站1的命令,形成主站命令返回数据包“A”,然后处理从站1对主站操作命令包“B”的返回数据包“B1”,完成上述处理后,从站1需判断是否还有对主站的操作命令请求,如果有,则将主站命令返回数据包“A”和从站1对主站的操作命令包“B”一同返回给主站,所述主站命令返回数据包“A”和从站1对主站操作命令包“B”之间采用反向命令特殊标识符“F”分隔,然后从站1进入等待主站返回状态,重新回到步骤(3);(4) After the slave station 1 receives the command from the master station, it will first identify whether there is a reverse command special identifier "F" in the returned data, and if there is, it will process the returned data twice. 1 command to form the master station command return data packet "A", and then process the return data packet "B1" from slave station 1 to the master station operation command packet "B". After the above processing is completed, slave station 1 needs to judge whether there is any For the operation command request of the master station, if there is, the master station command return data packet "A" and the operation command packet "B" of the slave station 1 to the master station are returned to the master station together, and the master station command returns the data packet "A" and the operation command packet "B" of slave station 1 to the master station are separated by the special identifier "F" of the reverse command, and then slave station 1 enters the state of waiting for the master station to return, and returns to step (3);

(5)当从站1再没有对主站的操作命令请求时,从站1只将主站命令返回数据包“A”直接返回给主站,然后从站1进入接收状态;(5) When the slave station 1 has no operation command request to the master station, the slave station 1 only returns the master station command return data packet "A" directly to the master station, and then the slave station 1 enters the receiving state;

(6)主站在收到并处理从站1返回的主站命令返回数据包“A”后,形成对下一从站(如从站2)的命令。(6) After the master station receives and processes the master station command return data packet "A" returned by slave station 1, it forms a command to the next slave station (such as slave station 2).

为了更好得实现本发明,所述总线式分布控制系统为半双工总线式分布控制系统。In order to better realize the present invention, the bus-type distributed control system is a half-duplex bus-type distributed control system.

所述半双工总线式分布控制系统为RS-485方式的总线式分布控制系统;主站发送数据时,先置位RS-485芯片发送使能引脚“TX_EN”;发送完成后关闭RS-485芯片发送使能引脚“TX_EN”,使其进入接收状态;从站1发送数据时也是置位RS-485芯片发送使能引脚“TX_EN”,然后向总线发送数据,发送完成后关闭RS-485芯片发送使能引脚“TX_EN”,使其进入接收状态。The half-duplex bus-type distributed control system is a bus-type distributed control system in RS-485 mode; when the master station sends data, it first sets the RS-485 chip to send the enabling pin "TX_EN"; after the transmission is completed, close the RS- The 485 chip transmits the enable pin "TX_EN" to make it enter the receiving state; when the slave station 1 sends data, it also sets the RS-485 chip transmit enable pin "TX_EN", and then sends data to the bus, and closes the RS after the transmission is completed. The -485 chip transmits the enable pin "TX_EN" to make it enter the receiving state.

所述命令包括轮询命令“L”,或查询命令“Q”,或设置命令“C”。The commands include a poll command "L", or a query command "Q", or a set command "C".

本发明与现有技术相比,具有如下优点和有益效果:实现方法简单,通信效率提高,缩短了轮询周期,当从站数量比较多时,轮询速度提高尤为明显,该方法尤其适合于硬件上为半双工的总线式分布控制系统,如RS-485总线等,在控制方法上通过独特控制标志和配合控制流程,实现简单高效的主从站系统对端控制功能。Compared with the prior art, the present invention has the following advantages and beneficial effects: the implementation method is simple, the communication efficiency is improved, and the polling cycle is shortened. When the number of slave stations is relatively large, the polling speed is particularly improved. The above is a half-duplex bus-type distributed control system, such as RS-485 bus, etc. In terms of control methods, through unique control signs and cooperative control processes, simple and efficient master-slave system peer control functions are realized.

(1)主机的每次轮询命令或查询命令、设置命令,都可同时获得最新的从站实时数据和从站对主站命令请求。(1) Each polling command, query command, and setting command of the host can simultaneously obtain the latest real-time data of the slave station and the command request from the slave station to the master station.

(2)本端命令和对端命令执行结果一同返发送给对端,效率高,两者命令之间依赖反向命令标识符分隔。(2) The local command and the execution result of the peer command are sent back to the peer together, which is highly efficient, and the two commands are separated by the reverse command identifier.

(3)主站或从站方收到返回数据后先识别是否存在反向命令标识符,以分别处理命令返回和命令请求。(3) After receiving the returned data, the master station or the slave station first recognizes whether there is a reverse command identifier, so as to process the command return and command request respectively.

附图说明Description of drawings

图1为现有的总线式分布控制系统结构原理图;Fig. 1 is the structural principle diagram of existing bus type distributed control system;

图2为RS-485方式的总线式分布控制系统结构原理图;Fig. 2 is the structural schematic diagram of the bus type distributed control system of RS-485 mode;

图3为本发明一种总线式分布控制系统主从站对端控制方法的控制流程图。Fig. 3 is a control flowchart of a master-slave station-to-end control method of a bus-type distributed control system according to the present invention.

具体实施方式Detailed ways

下面结合实施例及附图,对本发明作进一步地详细说明,但本发明的实施方式不限于此。The present invention will be described in further detail below in conjunction with the embodiments and the accompanying drawings, but the embodiments of the present invention are not limited thereto.

实施例一Embodiment one

图1为现有的总线式分布控制系统结构原理图,主站通过总线驱动器与各从站相连接。Figure 1 is a schematic diagram of the structure of the existing bus-type distributed control system. The master station is connected to each slave station through a bus driver.

如图2所示,本发明所述的总线式分布控制系统为RS-485方式的总线式分布控制系统,主站的MCU(微控制器)通过RS-485驱动芯片与各从站的MCU相连接,通常RS-485驱动芯片处在接收状态,当要发数据时使其工作在发送状态,发送完数据后马上使其工作在接收状态。As shown in Figure 2, the bus type distributed control system of the present invention is the bus type distributed control system of RS-485 mode, and the MCU (microcontroller) of master station communicates with the MCU of each slave station by RS-485 driver chip Connection, usually the RS-485 driver chip is in the receiving state. When sending data, make it work in the sending state, and immediately make it work in the receiving state after sending the data.

如图3所示,本发明一种总线式分布控制系统主从站对端控制的步骤是这样的:As shown in Figure 3, the steps of the master-slave station-to-end control of a bus-type distributed control system of the present invention are as follows:

(1)各从站都处在接收状态,主站通过总线发送对从站1的命令,发送完成后等待接收从站返回;(1) Each slave station is in the receiving state, the master station sends a command to slave station 1 through the bus, and waits for the receiving slave station to return after sending;

(2)因为每个从站都有一个独立的地址,主站发出的命令中会指定从站地址,因此所有的从站都能接收到主站命令,但只有符合主站命令中地址的从站1才会响应,从站1识别该命令并处理完形成主站命令返回数据包“A”,同时检查本站是否有操作主站的命令请求,如果没有则将主站命令返回数据包“A”直接返回给主站;如果从站1有对主站的操作命令请求,则将主站命令返回数据包“A”连同从站1对主站操作命令包“B”一起返回给主站,此时,所述主站命令返回数据包“A”和从站1对主站操作命令包“B”之间采用反向命令特殊标识符“F”分隔,然后从站1进入等待主站返回状态;(2) Because each slave station has an independent address, the slave station address will be specified in the command issued by the master station, so all slave stations can receive the master station command, but only the slave station that matches the address in the master station command Station 1 will respond. Slave station 1 recognizes the command and completes processing to form a master station command to return a data packet "A". At the same time, check whether this station has a command request to operate the master station. A" directly returns to the master station; if slave station 1 has an operation command request to the master station, the master station command return data packet "A" will be returned to the master station together with slave station 1's operation command packet "B" to the master station , at this time, the master station command return data packet "A" and the slave station 1 to the master station operation command packet "B" are separated by the reverse command special identifier "F", and then the slave station 1 enters the waiting master station return status;

(3)当主站收到了从站1返回的数据后,则主站先识别返回数据中是否有反向命令特殊标识符“F”,如果有则对返回数据进行两次处理:首先处理主站命令返回数据包“A”,然后处理从站1对主站操作命令包“B”,得到返回数据包“B1”,在得到“B1”后,相应再次生成主站对从站1的命令,该命令连同“B1”一同返回给从站1,该命令和返回数据包“B1”之间采用反向命令特殊标识符“F”分隔;(3) When the master station receives the data returned from slave station 1, the master station will first identify whether there is a reverse command special identifier "F" in the returned data, and if there is, it will process the returned data twice: first process the master The station command returns the data packet "A", and then processes the operation command packet "B" from the slave station 1 to the master station, and obtains the returned data packet "B1". After obtaining "B1", the corresponding command from the master station to the slave station 1 is generated again , the command is returned to slave station 1 together with "B1", and the command and the returned data packet "B1" are separated by the reverse command special identifier "F";

(4)从站1在收到主站命令后,则先识别返回数据中是否有反向命令特殊标识符“F”,如果有则对返回数据进行两次处理,首先处理主站对从站1的命令,形成主站命令返回数据包“A”,然后处理从站1对主站操作命令包“B”的返回数据包“B1”,完成上述处理后,从站1需判断是否还有对主站的操作命令请求,如果有,则将主站命令返回数据包“A”和从站1对主站的操作命令包“B”一同返回给主站,所述主站命令返回数据包“A”和从站1对主站操作命令包“B”之间采用反向命令特殊标识符“F”分隔,然后从站1进入等待主站返回状态,重新回到步骤(3);(4) After the slave station 1 receives the command from the master station, it will first identify whether there is a reverse command special identifier "F" in the returned data, and if there is, it will process the returned data twice. 1 command to form the master station command return data packet "A", and then process the return data packet "B1" from slave station 1 to the master station operation command packet "B". After the above processing is completed, slave station 1 needs to judge whether there is any For the operation command request of the master station, if there is, the master station command return data packet "A" and the operation command packet "B" of the slave station 1 to the master station are returned to the master station together, and the master station command returns the data packet "A" and the operation command packet "B" of slave station 1 to the master station are separated by the special identifier "F" of the reverse command, and then slave station 1 enters the state of waiting for the master station to return, and returns to step (3);

(5)当从站1再没有对主站的操作命令请求时,从站1只将主站命令返回数据包“A”直接返回给主站,然后从站1进入接收状态;(5) When the slave station 1 has no operation command request to the master station, the slave station 1 only returns the master station command return data packet "A" directly to the master station, and then the slave station 1 enters the receiving state;

(6)主站在收到并处理从站1返回的主站命令返回数据包“A”后,形成对下一从站(如从站2)的命令。(6) After the master station receives and processes the master station command return data packet "A" returned by slave station 1, it forms a command to the next slave station (such as slave station 2).

主站发送数据时,先置位RS-485芯片发送使能引脚“TX_EN”;发送完成后关闭RS-485芯片发送使能引脚“TX_EN”,使其进入接收状态;从站1发送数据时也是置位RS-485芯片发送使能引脚“TX_EN”,然后向总线发送数据,发送完成后关闭RS-485芯片发送使能引脚“TX_EN”,使其进入接收状态。When the master station sends data, first set the RS-485 chip transmission enable pin "TX_EN"; after the transmission is completed, turn off the RS-485 chip transmission enable pin "TX_EN" to enter the receiving state; slave station 1 sends data At the same time, set the RS-485 chip transmission enable pin "TX_EN", and then send data to the bus. After the transmission is completed, turn off the RS-485 chip transmission enable pin "TX_EN", so that it enters the receiving state.

上述控制步骤也可以适用于主站对从站发送查询命令“Q”或设置命令“C”时的控制过程。The above control steps can also be applied to the control process when the master station sends a query command "Q" or a setting command "C" to the slave station.

如上所述,便可较好地实现本发明。As described above, the present invention can be preferably carried out.

Claims (4)

1.一种总线式分布控制系统主从站对端控制方法,其特征在于包括以下步骤:1. A master-slave station-to-end control method of a bus type distributed control system, is characterized in that comprising the following steps: (1)各从站都处在接收状态,主站通过总线发送对从站1的命令,发送完成后等待接收从站返回;(1) Each slave station is in the receiving state, the master station sends a command to slave station 1 through the bus, and waits for the receiving slave station to return after sending; (2)因为每个从站都有一个独立的地址,主站发出的命令中会指定从站地址,因此所有的从站都能接收到主站命令,但只有符合主站命令中地址的从站1才会响应,从站1识别该命令并处理完形成主站命令返回数据包“A”,同时检查本站是否有操作主站的命令请求,如果没有则将主站命令返回数据包“A”直接返回给主站;如果从站1有对主站的操作命令请求,则将主站命令返回数据包“A”连同从站1对主站操作命令包“B”一起返回给主站,此时,所述主站命令返回数据包“A”和从站1对主站操作命令包“B”之间采用反向命令特殊标识符“F”分隔,然后从站1进入等待主站返回状态;(2) Because each slave station has an independent address, the slave station address will be specified in the command issued by the master station, so all slave stations can receive the master station command, but only the slave station that matches the address in the master station command Station 1 will respond. Slave station 1 recognizes the command and completes processing to form a master station command to return a data packet "A". At the same time, check whether this station has a command request to operate the master station. A" directly returns to the master station; if slave station 1 has an operation command request to the master station, the master station command return data packet "A" will be returned to the master station together with slave station 1's operation command packet "B" to the master station , at this time, the master station command return data packet "A" and the slave station 1 to the master station operation command packet "B" are separated by the reverse command special identifier "F", and then the slave station 1 enters the waiting master station return status; (3)当主站收到了从站1返回的数据后,则主站先识别返回数据中是否有反向命令特殊标识符“F”,如果有则对返回数据进行两次处理:首先处理主站命令返回数据包“A”,然后处理从站1对主站操作命令包“B”,得到返回数据包“B1”,在得到“B1”后,相应再次生成主站对从站1的命令,该命令连同“B1”一同返回给从站1,该命令和返回数据包“B1”之间采用反向命令特殊标识符“F”分隔;(3) When the master station receives the data returned from slave station 1, the master station will first identify whether there is a reverse command special identifier "F" in the returned data, and if there is, it will process the returned data twice: first process the master The station command returns the data packet "A", and then processes the operation command packet "B" from the slave station 1 to the master station, and obtains the returned data packet "B1". After obtaining "B1", the corresponding command from the master station to the slave station 1 is generated again , the command is returned to slave station 1 together with "B1", and the command and the returned data packet "B1" are separated by the reverse command special identifier "F"; (4)从站1在收到主站命令后,则先识别返回数据中是否有反向命令特殊标识符“F”,如果有则对返回数据进行两次处理,首先处理主站对从站1的命令,形成主站命令返回数据包“A”,然后处理从站1对主站操作命令包“B”的返回数据包“B1”,完成上述处理后,从站1需判断是否还有对主站的操作命令请求,如果有,则将主站命令返回数据包“A”和从站1对主站的操作命令包“B”一同返回给主站,所述主站命令返回数据包“A”和从站1对主站操作命令包“B”之间采用反向命令特殊标识符“F”分隔,然后从站1进入等待主站返回状态,重新回到步骤(3);(4) After the slave station 1 receives the command from the master station, it will first identify whether there is a reverse command special identifier "F" in the returned data, and if there is, it will process the returned data twice. 1 command to form the master station command return data packet "A", and then process the return data packet "B1" from slave station 1 to the master station operation command packet "B". After the above processing is completed, slave station 1 needs to judge whether there is any For the operation command request of the master station, if there is, the master station command return data packet "A" and the operation command packet "B" of the slave station 1 to the master station are returned to the master station together, and the master station command returns the data packet "A" and the operation command packet "B" of slave station 1 to the master station are separated by the special identifier "F" of the reverse command, and then slave station 1 enters the state of waiting for the master station to return, and returns to step (3); (5)当从站1再没有对主站的操作命令请求时,从站1只将主站命令返回数据包“A”直接返回给主站,然后从站1进入接收状态;(5) When the slave station 1 has no operation command request to the master station, the slave station 1 only returns the master station command return data packet "A" directly to the master station, and then the slave station 1 enters the receiving state; (6)主站在收到并处理从站1返回的主站命令返回数据包“A”后,形成对下一从站的命令。(6) After the master station receives and processes the master station command return data packet "A" returned by slave station 1, it forms a command to the next slave station. 2.根据权利要求1所述一种总线式分布控制系统主从站对端控制方法,其特征在于:所述总线式分布控制系统为半双工总线式分布控制系统。2. A peer-to-peer control method for a master-slave station in a bus-type distributed control system according to claim 1, characterized in that: the bus-type distributed control system is a half-duplex bus-type distributed control system. 3.根据权利要求2所述一种总线式分布控制系统主从站对端控制方法,其特征在于:所述半双工总线式分布控制系统为RS-485方式的总线式分布控制系统;主站发送数据时,先置位RS-485芯片发送使能引脚“TX_EN”;发送完成后关闭RS-485芯片发送使能引脚“TX_EN”,使其进入接收状态;从站1发送数据时也是置位RS-485芯片发送使能引脚“TX_EN”,然后向总线发送数据,发送完成后关闭RS-485芯片发送使能引脚“TX_EN”,使其进入接收状态。3. according to claim 2 said a kind of bus type distributed control system master-slave station opposite control method, it is characterized in that: said half-duplex bus type distributed control system is the bus type distributed control system of RS-485 mode; When the station sends data, first set the RS-485 chip transmission enable pin "TX_EN"; after the transmission is completed, turn off the RS-485 chip transmission enable pin "TX_EN" to enter the receiving state; when the slave station 1 sends data Also set the RS-485 chip transmission enable pin "TX_EN", and then send data to the bus. After the transmission is completed, turn off the RS-485 chip transmission enable pin "TX_EN", so that it enters the receiving state. 4.根据权利要求1所述一种总线式分布控制系统主从站对端控制方法,其特征在于:所述命令包括轮询命令“L”,或查询命令“Q”,或设置命令“C”。4. A master-slave station-to-end control method of a bus-type distributed control system according to claim 1, characterized in that: the command includes polling command "L", or query command "Q", or setting command "C ".
CN2007100265731A 2007-01-26 2007-01-26 A peer-to-peer control method for master-slave stations in a bus-type distributed control system Expired - Fee Related CN101232425B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2007100265731A CN101232425B (en) 2007-01-26 2007-01-26 A peer-to-peer control method for master-slave stations in a bus-type distributed control system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2007100265731A CN101232425B (en) 2007-01-26 2007-01-26 A peer-to-peer control method for master-slave stations in a bus-type distributed control system

Publications (2)

Publication Number Publication Date
CN101232425A CN101232425A (en) 2008-07-30
CN101232425B true CN101232425B (en) 2010-04-21

Family

ID=39898616

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2007100265731A Expired - Fee Related CN101232425B (en) 2007-01-26 2007-01-26 A peer-to-peer control method for master-slave stations in a bus-type distributed control system

Country Status (1)

Country Link
CN (1) CN101232425B (en)

Families Citing this family (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101483646B (en) * 2009-01-22 2013-06-05 浙江大学 Method and interface for high-speed communication on bus
CN101799680B (en) * 2010-02-09 2012-01-11 张文中 Distributed loop-opening automatic control system and method using utilizing electronic communication equipment
CN102123007A (en) * 2011-03-01 2011-07-13 上海奈凯电子科技有限公司 Communication method for realizing data transmission in numerical control system
CN102841554A (en) * 2011-06-24 2012-12-26 镇江华扬信息科技有限公司 Intelligent remote control method for system
CN103763167B (en) 2013-12-25 2016-06-01 京东方科技集团股份有限公司 Communication system and communication method thereof
CN103716420A (en) * 2014-01-03 2014-04-09 西南大学 Automatic station address obtaining method of Modbus ASCII slave station and slave station
CN103684938B (en) * 2014-01-26 2017-03-08 华中科技大学 A kind of industrial bluetooth network system and network-building method
CN104503390B (en) * 2014-11-30 2017-05-24 天津理工大学 Method for achieving automatic recognition of main station through industrial Ethernet integrated slave station
CN104410557A (en) * 2014-12-25 2015-03-11 深圳中科讯联科技有限公司 Dynamic networking method and communication method based on RS-485
CN104683194A (en) * 2015-02-14 2015-06-03 河南辉瑞生物医电技术有限公司 PWM-based one-way master-slave one-to-many multi-computer communication method
CN104683068A (en) * 2015-02-14 2015-06-03 河南辉瑞生物医电技术有限公司 PWM-based one-way master-slave multi-computer communication method
CN105700335A (en) * 2016-03-22 2016-06-22 飞亚达(集团)股份有限公司 State collection and judgment method and state collection and judgment system for terminal clock of time synchronization system
CN106125711B (en) * 2016-09-05 2018-10-16 广州途道信息科技有限公司 A kind of control method based on bus communication
CN107682247B (en) * 2017-09-15 2020-10-23 广东芬尼克兹节能设备有限公司 Efficient communication method for host and multiple slaves
CN107942769B (en) * 2017-10-09 2021-04-06 深圳市瑞凌实业股份有限公司 Communication system and method for digital power supply and various digital welding devices
CN109639366B (en) * 2019-01-31 2022-01-28 华夏世昌(北京)科技有限公司 Signal pulse width modulation and demodulation method based on two-wire bus communication
CN109587022B (en) * 2019-01-31 2021-11-23 华夏世昌(北京)科技有限公司 Communication method of ignition drive bus IDBUS
CN112702248A (en) * 2020-12-28 2021-04-23 苏州和欣致远节能科技有限公司 High-efficiency communication method realized by low-speed field bus
CN115914121A (en) * 2022-12-29 2023-04-04 欧普照明股份有限公司 Communication method, electronic device, storage medium, power supply, lamp, lighting system
CN119945828B (en) * 2025-02-12 2025-10-17 合肥千轴万点科技有限公司 Communication method and device of self-anti-interference real-time bus

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1232217A (en) * 1998-01-23 1999-10-20 索尼公司 Transmitting system, transmitting method, and transmitting/receiving system
CN1301364A (en) * 1997-09-05 2001-06-27 索尼克斯公司 Fully pipelined fixed-latency communication system with real-time dynamic bandwidth allocation

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1301364A (en) * 1997-09-05 2001-06-27 索尼克斯公司 Fully pipelined fixed-latency communication system with real-time dynamic bandwidth allocation
CN1232217A (en) * 1998-01-23 1999-10-20 索尼公司 Transmitting system, transmitting method, and transmitting/receiving system

Also Published As

Publication number Publication date
CN101232425A (en) 2008-07-30

Similar Documents

Publication Publication Date Title
CN101232425B (en) A peer-to-peer control method for master-slave stations in a bus-type distributed control system
CN111580995B (en) Synchronous communication method and system of distributed cloud platform and Internet of things intelligent terminal based on MQTT asynchronous communication scene
WO2021082301A1 (en) Sleep and wakeup method for in-vehicle hybrid network comprising in-vehicle ethernet
CN103188122B (en) Communication system and communication method based on CAN (Controller Area Network)
CN107580085B (en) A networking method for the Internet of Things
CN101957808B (en) Communication method among various CPUs (Central Processing Units), system and CPU
CN105389278B (en) Master-slave machine serial communication method based on CAN bus
CN110955626A (en) Method and system for realizing Modbus communication on serial link
CN102932224A (en) CAN network-based data communication system and data communication method based on same
CN104009976B (en) A kind of real-time communication method being used between more main station systems and its equipment
CN111614618A (en) A method and system for cross-regional data transmission for physical isolation devices
CN108848199A (en) A kind of peer-to-peer network automatic seeking main system and method
CN102104522B (en) Real-time communication optimizing method and equipment orienting to cyber-physical system
CN116956557A (en) Collaborative simulation method and collaborative simulation system for heterogeneous system
CN108449246A (en) A kind of intelligent domestic system based on instant message applications Yu Internet of Things Network Communication
CN101014050A (en) Connection-based communication protocol of CAN bus applied for a great deal of data
KR101958477B1 (en) Lin communication system for vehicle and method for driving slave module in the system
CN102710622A (en) Protocol conversion device based on DeviceNet-Modbus
CN112399211B (en) Operation method and fusion gateway
WO2018153127A1 (en) Device resource collection method based on 485 time-sharing communication
CN102681969B (en) Based on the long frame data transmission method of CAN
CN110752909A (en) A software processing method for 485 bus half-duplex communication
CN112995095B (en) Data processing method, device and computer-readable storage medium
CN202513948U (en) Master-slave protocol conversion gateway from Ethernet to PROFIBUS-DP
CN108200177A (en) A kind of method and system of Non-blocking Synchronization pattern database middleware network communication

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20100421

Termination date: 20150126

EXPY Termination of patent right or utility model
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20100421

Termination date: 20150126

EXPY Termination of patent right or utility model