CN102523141A - Method for networking and cascading electronic equipment by using universal serial port technology - Google Patents

Method for networking and cascading electronic equipment by using universal serial port technology Download PDF

Info

Publication number
CN102523141A
CN102523141A CN2011103833812A CN201110383381A CN102523141A CN 102523141 A CN102523141 A CN 102523141A CN 2011103833812 A CN2011103833812 A CN 2011103833812A CN 201110383381 A CN201110383381 A CN 201110383381A CN 102523141 A CN102523141 A CN 102523141A
Authority
CN
China
Prior art keywords
port
slave unit
computer
main equipment
equipment
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.)
Granted
Application number
CN2011103833812A
Other languages
Chinese (zh)
Other versions
CN102523141B (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.)
Institute of Optics and Electronics of CAS
Original Assignee
Institute of Optics and Electronics of CAS
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 Institute of Optics and Electronics of CAS filed Critical Institute of Optics and Electronics of CAS
Priority to CN201110383381.2A priority Critical patent/CN102523141B/en
Publication of CN102523141A publication Critical patent/CN102523141A/en
Application granted granted Critical
Publication of CN102523141B publication Critical patent/CN102523141B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Small-Scale Networks (AREA)

Abstract

本发明提供一种通过使用通用串口技术使电子设备组网级联的方法,它由计算机通用串口、主设备端口A、主设备端口B、主设备电平转换单元、主设备控制单元、从设备端口A、从设备端口B、从设备电平转换单元、从设备控制单元、从设备光耦单元组成,计算机串口与主设备端口A相连,主设备端口B与从设备端口A相连,从设备端口B与下级从设备端口A相连,计算机发送数据到各设备是广播形式,各设备返回给计算机的数据是时分复用的形式,本发明不仅实现了计算机与各设备之间的数据传输,而且方法简单、成本低、开发和调试难度低、易于维护。

Figure 201110383381

The invention provides a method for cascading electronic devices in a network by using the general serial port technology, which consists of a computer general serial port, a master device port A, a master device port B, a master device level conversion unit, a master device control unit, a slave device Port A, slave device port B, slave device level conversion unit, slave device control unit, slave device optocoupler unit, the computer serial port is connected to the master device port A, the master device port B is connected to the slave device port A, and the slave device port B is connected to port A of the lower-level slave device. The computer sends data to each device in the form of broadcast, and the data returned by each device to the computer is in the form of time division multiplexing. The invention not only realizes the data transmission between the computer and each device, but also the method Simple, low cost, low development and debugging difficulty, easy maintenance.

Figure 201110383381

Description

一种通过使用通用串口技术使电子设备组网级联的方法A method for cascading electronic device networking by using general serial port technology

技术领域 technical field

本发明涉及电子设备组网级联的技术领域,特别涉及一种通过使用通用串口技术使电子设备组网级联的方法。The invention relates to the technical field of network cascading of electronic equipment, in particular to a method for cascading the network of electronic equipment by using the universal serial port technology.

背景技术 Background technique

目前很多电子设备的组网及级联采用的方法是通过以太网、USB总线、I2C总线、CAN总线、USB等方法,这些方法虽然能够实现电子设备的级联,但是存在技术复杂、成本高、通信距离短、需要中继设备等限制。在计算机与电子设备组网通信的时候,如果通过以太网级联,虽然很方便,也不受级联设备数量的限制,但是需要设备具有网络接口,同时设备上需要带有具有网络处理能力的CPU以及相关的嵌入式应用程序的支持,而且在多台设备组网时,还需要有网络交换机的支持。而采用I2C总线、CAN总线方式组网时,面临着通用计算机没有这两种类型的接口,要采用这两种类型的总线组网,必须增加第三方设备使这两种总线接口转为计算机已有的接口,同时在设备组网时面临设备数量和通信距离的限制。而USB总线组网的方式虽然也很方便,但是同样受级联数量、通信距离、以及对设备的CPU和嵌入式程序设计有较高的要求。同时采用上述这些方式时,在计算机端的应用软件开发和调试上具有较大的难度。At present, the methods of networking and cascading of many electronic devices are through Ethernet, USB bus, I2C bus, CAN bus, USB and other methods. Although these methods can realize the cascading of electronic devices, they are complicated in technology, high in cost, The communication distance is short, and relay equipment is required. When computers communicate with electronic devices in a network, if they are cascaded through Ethernet, it is convenient and not limited by the number of cascaded devices. The support of CPU and related embedded applications, and the support of network switches is also required when multiple devices are networked. When using the I2C bus and CAN bus to form a network, the general-purpose computer does not have these two types of interfaces. To adopt these two types of bus networks, it is necessary to add third-party equipment to convert these two types of bus interfaces into computers. Some interfaces are limited by the number of devices and the communication distance when networking devices. Although the USB bus networking method is also very convenient, it also has higher requirements for the number of cascades, communication distance, and CPU and embedded programming of the device. When the above-mentioned methods are adopted at the same time, it is more difficult to develop and debug the application software on the computer side.

发明内容 Contents of the invention

本发明要解决的技术问题是:提供一种通过使用通用串口技术使电子设备组网级联的方法克服以太网、USB总线、I2C总线、CAN总线等在组网时对设备要求高、开发和调试难度大、需要第三方设备支持等不足,本发明采用通用串口作为设备的级联接口,拓扑结构为菊花链方式。这种级联方法不需要第三方设备的支持,尤对设备的CPU以及软件支持方面要求很低,在计算机端进行软件开发和调试的难度低。The technical problem to be solved by the present invention is to provide a method for cascading electronic equipment by using universal serial port technology to overcome the high requirements for equipment such as Ethernet, USB bus, I2C bus, CAN bus, etc. Due to the difficulty of debugging and the need for third-party equipment support, the present invention uses a general-purpose serial port as the cascading interface of the equipment, and the topological structure is a daisy chain mode. This cascading method does not require the support of third-party equipment, especially the CPU and software support requirements of the equipment are very low, and the difficulty of software development and debugging on the computer side is low.

本发明解决上述技术问题的技术方案是:一种通过使用通用串口技术使电子设备组网级联的方法,其中,电子设备包括:计算机、一个主设备、若干从设备,主设备及从设备各有两个通用串口端口,分别为端口A和端口B;其特征在于:计算机的通用串口连接到主设备的端口A上,主设备的端口B连接到第一个从设备的端口A上,第一个从设备的端口B连接到第二个从设备的端口A上,依次类推,以菊花链的形式连接所有设备;在每个设备中都有一个CPU或者FPGA作为收发数据的控制单元,同时通过光电耦合器件使得所有从设备发送的数据可以连接到一起,由于光电耦合器件具有光电隔离的作用,因此所有从设备发送给计算机的数据连接到一点得以实现;在主设备以及每个从设备中都有电平转换电路单元,用于将信号电平转换为主设备、从设备能够接收的电平标准;The technical solution of the present invention to solve the above-mentioned technical problems is: a method for cascading electronic devices in a network by using the universal serial port technology, wherein the electronic devices include: a computer, a master device, several slave devices, each of the master device and the slave devices There are two general-purpose serial ports, namely port A and port B; the characteristic is that: the general-purpose serial port of the computer is connected to the port A of the master device, and the port B of the master device is connected to the port A of the first slave device. Port B of one slave device is connected to port A of the second slave device, and so on, all devices are connected in the form of daisy chain; each device has a CPU or FPGA as the control unit for sending and receiving data, and at the same time The data sent by all the slave devices can be connected together through the photocoupler device. Since the photocoupler device has the function of photoelectric isolation, all the data sent from the slave device to the computer can be connected to one point; in the master device and each slave device All have a level conversion circuit unit, which is used to convert the signal level to the level standard that the master device and the slave device can receive;

该方法中计算机的通用串口通过菊花链这种级联方式使得计算机通用串口的发送端通过主设备同时连接到所有设备的接收端上,具体的计算机上通用串口的发送端首先进入到主设备端口A,然后在主设备内部,将计算机通用串口的发送端连接到主设备端口B上,因此计算机通用串口的发送端从主设备端口B输出,然后再连接到从设备1端口A上,在从设备端口A内部再将此线连接到从设备1端口B上,之后再从从设备1端口B输出,连接到从设备2端口A上,依次类推,从而形成菊花链的连接形式;计算机发送到各个设备的数据是以广播形式发送;In this method, the universal serial port of the computer is cascaded through the daisy chain so that the sending end of the universal serial port of the computer is connected to the receiving ends of all devices through the master device at the same time, and the sending end of the universal serial port on the specific computer first enters the port of the master device A, and then inside the master device, connect the sending end of the computer’s universal serial port to port B of the master device, so the sending end of the computer’s universal serial port is output from the port B of the master device, and then connected to port A of the slave device 1, in the slave device Inside the port A of the device, connect this line to the port B of the slave device 1, then output from the port B of the slave device 1, connect to the port A of the slave device 2, and so on, thus forming a daisy chain connection form; the computer sends to The data of each device is sent in the form of broadcast;

该方法中计算机的通用串口的接收端连接到主设备端口A,所有从设备发送给计算机的数据都由主设备转发给计算机;所有从设备发送给计算机的数据通过光电耦合器件输出,然后通过菊花链方式统一连接到主设备上;所有的设备不能同时向计算机发送数据,而是采用时分复用的方式向计算机发送数据;主设备以及每个从设备何时向计算机发送数据有以下两种方式之一实现:一种方式为主设备发送的选通指令决定;另一种方式为由计算机发送选通指令,此选通指令的发送为广播方式,各设备根据接收到的选通指令来确定是否向计算机发送数据。In this method, the receiving end of the general-purpose serial port of the computer is connected to port A of the master device, and all the data sent from the slave device to the computer are forwarded to the computer by the master device; The chain mode is connected to the master device in a unified way; all devices cannot send data to the computer at the same time, but use time division multiplexing to send data to the computer; the master device and each slave device have the following two ways to send data to the computer One implementation: one way is determined by the gating command sent by the master device; the other way is to send the gating command by the computer, the sending of the gating command is in broadcast mode, and each device determines according to the received gating command Whether to send data to the computer.

其中,主设备和从设备之间的电平转换单元可以增加光电转换模块,使主设备和从设备之间使用光纤连接。Wherein, the level conversion unit between the master device and the slave device can add a photoelectric conversion module, so that the master device and the slave device are connected by optical fiber.

其中,主设备以及每个从设备何时向计算机发送数据的方式为主设备发送的选通指令决定时,此选通指令是以串口数据格式、通过RS232电平来传输,此选通指令等间隔时间发送。Among them, when the master device and each slave device send data to the computer, when the strobe command sent by the master device is determined, the strobe command is transmitted in the serial data format and through the RS232 level. sent at intervals.

其中,具体实现方法可如下:计算机通用串口与主设备端口A相连,主设备端口A与主设备端口B、主设备电平转换、主设备控制单元之间的信号传递是将信号电平转换为计算机和主设备都可以接收的电平标准,同时一些信号连接到主设备端口B是为了设备级联的需要;主设备端口B与从设备1端口A相连,从设备1端口A与从设备1端口B、从设备1电平转换、从设备1控制单元之间的信号传递是将信号电平转换为主设备、从设备1、从设备2、计算机都可以接收的电平标准,同时一些信号连接到从设备1端口B是为了设备级联的需要;从设备1端口B与从设备2端口A相连,从设备2端口A与从设备2端口B、从设备2电平转换、从设备2控制单元之间的信号传递是将信号电平转换为主设备、从设备1、从设备2、计算机都可以接收的电平标准,同时一些信号连接到从设备2端口B是为了设备级联的需要;从设备1控制单元与从设备1光电耦合器件相连,从设备1光电耦合器件输出连接到从设备1端口B和从设备1端口A;从设备2控制单元与从设备2光电耦合器件相连,从设备2光电耦合器件连接到从设备2端口B和从设备2端口A;通过主设备端口B与从设备1端口B、从设备2端口A的连接,实现了将从设备1光电耦合器件输出、从设备2光电耦合器件输出同时连接到主设备控制单元上;在整个链路上,有4路数据流信号;第1路数据流信号是从计算机通用串口发送出的信号通过各设备间的级联以广播形式传输到主设备和各从设备,然后经过各自的电平转换进入到各设备的控制单元;第2路数据流信号是从主设备控制单元发送出的信号经过主设备电平转换、主设备端口B级联到各从设备,以广播的形式传输到各从设备,然后经过各从设备的电平转换进入到各从设备的控制单元;第3路数据流信号是从各从设备的控制单元发出经过光耦作用之后,再由各设备的级联后进入主设备控制单元;第4路数据流信号是从主设备控制单元发送出,经过主设备电平转换进入主设备端口B、主设备端口A后,连接到计算机通用串口上;经过这4路数据流信号的传输,就能够实现计算机与各设备进行数据交换,实现了使用通用串口技术使电子设备组网级联。Among them, the specific implementation method can be as follows: the general-purpose serial port of the computer is connected to the main equipment port A, the signal transmission between the main equipment port A and the main equipment port B, the main equipment level conversion, and the main equipment control unit is to convert the signal level to The level standard that both the computer and the master device can receive, and some signals are connected to the port B of the master device for the needs of device cascading; the port B of the master device is connected to the port A of the slave device 1, and the port A of the slave device 1 is connected to the port A of the slave device 1 Port B, the level conversion of slave device 1, and the signal transmission between the control unit of slave device 1 is to convert the signal level into a level standard that can be received by the master device, slave device 1, slave device 2, and computer. At the same time, some signals Connecting to port B of slave device 1 is for device cascading; port B of slave device 1 is connected to port A of slave device 2, port A of slave device 2 is connected to port B of slave device 2, level conversion of slave device 2, and port A of slave device 2 The signal transmission between the control units is to convert the signal level into a level standard that can be received by the master device, slave device 1, slave device 2, and computer. At the same time, some signals are connected to slave device 2 port B for device cascading Required; the control unit of slave device 1 is connected to the optocoupler device of slave device 1, and the output of the photocoupler device of slave device 1 is connected to port B of slave device 1 and port A of slave device 1; the control unit of slave device 2 is connected to the photocoupler device of slave device 2 , the optocoupler device of slave device 2 is connected to port B of slave device 2 and port A of slave device 2; through the connection of port B of master device, port B of slave device 1 and port A of slave device 2, the optocoupler device of slave device 1 is realized The output and output of the slave device 2 photocoupler are simultaneously connected to the control unit of the master device; on the entire link, there are 4 data flow signals; the first data flow signal is a signal sent from the general serial port of the computer through the The cascade connection is transmitted to the master device and each slave device in the form of broadcast, and then enters the control unit of each device through their own level conversion; the second data flow signal is the signal sent from the master device control unit through the master device circuit Level conversion, master device port B cascades to each slave device, transmits to each slave device in the form of broadcast, and then enters the control unit of each slave device through the level conversion of each slave device; the third data flow signal is the slave device After the control unit of each slave device passes through the action of the optocoupler, it enters the control unit of the master device after the cascading of each device; the fourth data flow signal is sent from the control unit of the master device, and enters the master device through the level conversion of the master device. After the device port B and the main device port A, connect to the general-purpose serial port of the computer; through the transmission of these 4-way data stream signals, the data exchange between the computer and each device can be realized, and the use of general-purpose serial port technology to make the electronic equipment network-level couplet.

其中,在上述方法实现3个设备级联的基础上可以根据需要进行多个设备级联。Wherein, on the basis of realizing the cascading of three devices in the above method, multiple devices can be cascaded as required.

本发明与现有技术相比的优点如下:The advantages of the present invention compared with prior art are as follows:

1、本发明采用的接口技术简单,对于电路设计以及软件开发都难度不大,同时由于电路简单,因此实现成本低、可靠性高;1. The interface technology adopted in the present invention is simple, and it is not difficult for circuit design and software development. At the same time, because the circuit is simple, the implementation cost is low and the reliability is high;

2、本发明计算机都具有通用串口,即使没有标准串口也可以通过USB转串口方式实现,不需要花费昂贵的第三方设备;2. The computers of the present invention all have a general-purpose serial port, even if there is no standard serial port, it can be realized through the USB-to-serial port mode, and no expensive third-party equipment is needed;

3、本发明应用灵活,可以根据实际需要灵活设计传输协议。3. The application of the present invention is flexible, and the transmission protocol can be flexibly designed according to actual needs.

附图说明 Description of drawings

图1是本发明的功能框图。Fig. 1 is a functional block diagram of the present invention.

图2是本发明的一个实施实例的电原理图。Fig. 2 is an electrical schematic diagram of an implementation example of the present invention.

图中,1为计算机通用串口;2为主设备端口A;3为主设备端口B;4为主设备电平转换;5为主设备控制单元;6为从设备1端口A;7为从设备1端口B;8为从设备1电平转换;9为从设备1控制单元;10为从设备1光电耦合器件;11为从设备2端口A;12为从设备2端口B;13为从设备2电平转换;14为从设备2控制单元;15为从设备2光电耦合器件。In the figure, 1 is the general serial port of the computer; 2 is the port A of the master device; 3 is the port B of the master device; 4 is the level conversion of the master device; 5 is the control unit of the master device; 6 is port A of the slave device 1; 7 is the slave device 1 port B; 8 is the level conversion of slave device 1; 9 is the control unit of slave device 1; 10 is the photocoupler device of slave device 1; 11 is port A of slave device 2; 12 is port B of slave device 2; 13 is the slave device 2 level conversion; 14 is the control unit of the slave device 2; 15 is the photocoupling device of the slave device 2.

具体实施方式 Detailed ways

现结合附图说明本发明的实施例。但以下的实施例仅限于解释本发明,本发明的保护范围应包括权利要求的全部内容,而且通过以下实施例对该领域的技术人员即可以实现本发明权利要求的全部内容。Embodiments of the present invention are now described in conjunction with the accompanying drawings. But following embodiment only limits to explain the present invention, and protection scope of the present invention should comprise the whole content of claim, and promptly can realize the whole content of claim of the present invention to those skilled in the art through following embodiment.

在图1中,电子设备包括:计算机、一个主设备、若干从设备,主设备及从设备各有两个通用串口端口,分别为端口A和端口B;计算机通用串口1与主设备端口A 2相连,主设备端口A 2与主设备端口B 3、主设备电平转换4、主设备控制单元5之间的信号传递是将信号电平转换为计算机和主设备都可以接收的电平标准,同时一些信号连接到主设备端口B3是为了设备级联的需要。主设备端口B 3与从设备1端口A 6相连,从设备1端口A 6与从设备1端口B 7、从设备1电平转换8、从设备1控制单元9之间的信号传递是将信号电平转换为主设备、从设备、计算机都可以接收的电平标准,同时一些信号连接到从设备1端口B 7是为了设备级联的需要。从设备1端口B 7与从设备2端口A 11相连,从设备2端口A 11与从设备2端口B 12、从设备2电平转换13、从设备2控制单元14之间的信号传递是将信号电平转换为主设备、从设备、计算机都可以接收的电平标准,同时一些信号连接到从设备2端口B 12是为了设备级联的需要。从设备1控制单元9与从设备1光电耦合器件10相连,从设备1光电耦合器件10输出连接到从设备1端口B 7和从设备1端口A 6。从设备2控制单元14与从设备2光电耦合器件15相连,从设备2光电耦合器件15连接到从设备2端口B 12和从设备2端口A 11。通过主设备端口B 3与从设备1端口B 7、从设备2端口A11的连接,实现了将从设备1光电耦合器件10输出、从设备2光电耦合器件15输出同时连接到主设备控制单元5上。在整个链路上,有4路数据流信号。第1路数据流信号是从计算机通用串口1发送出的信号通过各设备间的级联以广播形式传输到主设备和各从设备,然后经过各自的电平转换进入到各设备的控制单元;第2路数据流信号是从主设备控制单元5发送出的信号经过主设备电平转换4、主设备端口B 3级联到各从设备,以广播的形式传输到各从设备,然后经过各从设备的电平转换进入到各从设备的控制单元;第3路数据流信号是从各从设备的控制单元发出经过光耦作用之后,再由各设备的级联后进入主设备控制单元5;第4路数据流信号是从主设备控制单元5发送出,经过主设备电平转换4进入主设备端口B3、主设备端口A 2后,连接到计算机通用串口1上。经过这4路数据流信号的传输,就能够实现计算机与各设备进行数据交换。图1中只画出3个设备级联的形式,实际可以根据需要进行多个设备级联。In Figure 1, the electronic equipment includes: a computer, a master device, and several slave devices. The master device and the slave device each have two general-purpose serial ports, respectively port A and port B; computer general-purpose serial port 1 and master device port A 2 Connected, the signal transmission between the main equipment port A 2 and the main equipment port B 3, the main equipment level conversion 4, and the main equipment control unit 5 is to convert the signal level into a level standard that both the computer and the main equipment can receive. At the same time, some signals are connected to the main device port B3 for the needs of device cascading. The master device port B 3 is connected to the slave device 1 port A 6, the signal transfer between the slave device 1 port A 6 and the slave device 1 port B 7, the slave device 1 level conversion 8, and the slave device 1 control unit 9 is to transfer the signal The level is converted to a level standard that can be received by the master device, the slave device, and the computer. At the same time, some signals are connected to the slave device 1 port B 7 for the needs of device cascading. From equipment 1 port B 7 is connected with equipment 2 port A 11, from equipment 2 port A 11 and from equipment 2 port B 12, from equipment 2 level conversion 13, from equipment 2 control unit 14, the signal transfer is to be The signal level is converted to a level standard that can be received by the master device, the slave device, and the computer. At the same time, some signals are connected to the slave device 2 port B 12 for the needs of device cascading. The slave device 1 control unit 9 is connected with the slave device 1 photocoupler 10, and the output from the device 1 photocoupler 10 is connected to the slave device 1 port B 7 and the slave device 1 port A 6. From equipment 2 control unit 14 is connected with equipment 2 optocoupler 15, from equipment 2 optocoupler 15 is connected to equipment 2 port B 12 and from equipment 2 port A 11. Through the connection of the master device port B 3 with the slave device 1 port B 7 and the slave device 2 port A11, the slave device 1 photocoupler 10 output and the slave device 2 photocoupler 15 output are simultaneously connected to the master device control unit 5 superior. Throughout the link, there are 4 data flow signals. The first data flow signal is the signal sent from the general-purpose serial port 1 of the computer, which is transmitted to the master device and each slave device in the form of broadcast through the cascade connection between each device, and then enters the control unit of each device through their own level conversion; The 2nd road data flow signal is that the signal that sends out from master equipment control unit 5 passes through master equipment level conversion 4, master equipment port B 3 cascades to each slave equipment, transmits to each slave equipment with the form of broadcasting, then passes through each slave equipment The level conversion of the slave device enters the control unit of each slave device; the third data flow signal is sent from the control unit of each slave device after the action of the optocoupler, and then cascaded by each device and then enters the master device control unit 5 The 4th road data stream signal is sent out from the main equipment control unit 5, after entering the main equipment port B3 and the main equipment port A2 through the main equipment level conversion 4, it is connected to the general serial port 1 of the computer. Through the transmission of these four data stream signals, data exchange between the computer and each device can be realized. Figure 1 only shows the form of cascading three devices, but actually multiple devices can be cascaded as required.

图2中的电原理图是一个设备的电原理图,在图中通过一些跳线的设置,可以将设备设为主设备或者从设备。在图2实施实例中,通过J2、J4、J5、J6的跳线设置以及SW1的模式设置,实现了使用同样的电路就能够使设备既可以作为主设备又可以作为从设备,达到了应用上的灵活性。The electrical schematic diagram in Figure 2 is an electrical schematic diagram of a device. In the figure, the device can be set as a master device or a slave device by setting some jumpers. In the implementation example in Figure 2, through the jumper settings of J2, J4, J5, J6 and the mode setting of SW1, the same circuit can be used to make the device both as a master device and as a slave device, which achieves the application flexibility.

本实施例的两个主要操作如下:The two main operations of this embodiment are as follows:

(1)计算机发送数据到各设备(1) The computer sends data to each device

在计算机向各设备发送数据时,数据是经过上述的第1路数据流信号。结合图2来看,对各设备来说,计算机向各设备发送的信号首先经过J1然后进入到IC1,经过IC1的电平转换,进入到IC3。在IC3中根据数据中包含的信息确定此接收到的数据是否为自己所用。When the computer sends data to each device, the data passes through the above-mentioned first data flow signal. Combining with Figure 2, for each device, the signal sent by the computer to each device first passes through J1 and then enters IC1, and then enters IC3 after the level conversion of IC1. In IC3, it is determined whether the received data is for its own use according to the information contained in the data.

(2)各设备返回数据到计算机(2) Each device returns data to the computer

各设备返回数据到计算机的过程中,要经过上述3路数据流信号来完成。首先主设备经过第2路数据流信号向各从设备发送选通信号。当各从设备接收选通信号后,从设备的控制单元确定自己此时是否应当返回数据到计算机。若需要返回数据到计算机,则返回的数据经过第3路数据流信号传输到主设备控制单元5,主设备控制单元5通过第4路数据流信号将接收到的从设备数据返回给计算机。The process of returning data from each device to the computer must be completed through the above-mentioned 3-way data stream signals. First, the master device sends a strobe signal to each slave device through the second data flow signal. After each slave device receives the strobe signal, the control unit of the slave device determines whether it should return data to the computer at this time. If it is necessary to return data to the computer, the returned data is transmitted to the master device control unit 5 through the third data stream signal, and the master device control unit 5 returns the received slave device data to the computer through the fourth data stream signal.

如图2所示,J1为RJ45插座,作为设备的端口A;J3为RJ45插座,作为设备的端口B;IC1为美信(Maxim)公司的MAX3250,作为设备的电平转换模块;IC2为TLP421-1,作为从设备的光耦单元;IC3采用Xilinx公司的Spartan III系列的XC3S1000-4FT256,作为各设备的控制单元。当图2所示电路设备作为主设备使用时,首先通过SW1的拨码开关模式设置功能,使IC3切换到主设备工作模式状态。J1的2脚连接到计算机通用串口的2脚上,即计算机通用串口的接收端,J1的3脚连接到计算机通用串口的3脚上,即计算机通用串口的发送端。J1的2脚和3脚同时连接到IC1的17、19连个引脚上;IC3两个IO引脚连接到IC1的4、2引脚上,这样就通过IC1实现了J1侧的RS232电平和IC3侧的TTL电平的转换,从而实现了IC3和计算机之间的数据通信,即主设备和计算机通用串口的数据通信。因为当前设备为主设备,因此IC3的1个IO引脚与IC1的5脚相连,这样IC1将IC3输出的TTL信号转换成RS232信号后通过IC1的16脚输出,同时将J2的2和3引脚用短路帽短接,这样此信号就连接到了J3上,此信号可以作为从设备的返回数据的选通信号。将J4、J5、J6分别用短路帽短接,这样实现了所有从设备光耦输出信号在主设备端的连接,别且连接到了IC3的一个IO引脚上,从而使主设备能够接收所有从设备返回的数据。J1和J3上的信号都互相连通,这样才可以实现多个设备的菊花链的级联。当图2所示电路设备作为从设备使用时,首先通过SW1的模式设置功能,使IC3切换到从设备工作模式状态。J1在设备外部与主设备的J3相连,这样首先实现从设备能够接收计算机发送的数据。RS232信号与TTL信号的转换与主设备相同。从设备要接收主设备发送过来的选通信号,因此需要将J2的1和2引脚用短路帽短接,由于在主设备上,J2的2和3引脚是短接的,因此当主设备和从设备级联之后,在主设备上从IC1的16脚发送出来的选通信号,就连接到了从设备的IC1的18引脚上,然后IC1将此RS232电平信号转换为TTL信号后,从IC1的3脚输出,并连接到IC3的一个IO引脚上,从而实现从设备接收主设备发送过来的选通信号。从设备要发送数据到主设备,除要根据接收到的选通信号适时发送外,还需要将J4、J5、J6保持在开路状态,从设备发送的数据通过IC3的一个IO引脚输出到IC2上。由于在主设备端J4、J5、J6是在短接状态,因此所有从设备输出的信号通过IC2隔离之后,在主备端连接到一起,并且能够被主设备所接收。当多个从设备级联时,需要在设备外部,将前一个从设备的J3连接到下一个从设备的J1上。As shown in Figure 2, J1 is an RJ45 socket, which is used as port A of the device; J3 is an RJ45 socket, which is used as port B of the device; IC1 is Maxim's MAX3250, which is used as a level conversion module of the device; IC2 is TLP421- 1. As the optocoupler unit of the slave device; IC3 uses Xilinx’s Spartan III series XC3S1000-4FT256 as the control unit of each device. When the circuit device shown in Figure 2 is used as the master device, firstly, through the mode setting function of the DIP switch of SW1, IC3 is switched to the master device working mode. Pin 2 of J1 is connected to pin 2 of the general-purpose serial port of the computer, which is the receiving end of the general-purpose serial port of the computer, and pin 3 of J1 is connected to pin 3 of the general-purpose serial port of the computer, which is the sending end of the general-purpose serial port of the computer. Pins 2 and 3 of J1 are connected to pins 17 and 19 of IC1 at the same time; two IO pins of IC3 are connected to pins 4 and 2 of IC1, so that the RS232 level and the level of J1 are realized through IC1. The conversion of the TTL level on the IC3 side realizes the data communication between IC3 and the computer, that is, the data communication between the master device and the general serial port of the computer. Because the current device is the main device, one IO pin of IC3 is connected to pin 5 of IC1, so that IC1 converts the TTL signal output by IC3 into an RS232 signal and outputs it through pin 16 of IC1, and at the same time connects pins 2 and 3 of J2 The pins are short-circuited with a short-circuit cap, so that this signal is connected to J3, and this signal can be used as a strobe signal for the return data of the slave device. Short-circuit J4, J5, and J6 with short-circuit caps, so as to realize the connection of all slave device optocoupler output signals at the master device end, and connect them to an IO pin of IC3, so that the master device can receive all slave devices returned data. The signals on J1 and J3 are connected to each other, so that the daisy chain cascade of multiple devices can be realized. When the circuit device shown in Figure 2 is used as a slave device, IC3 is switched to the slave device working mode through the mode setting function of SW1 first. J1 is connected to J3 of the master device outside the device, so that the slave device can receive the data sent by the computer at first. The conversion of RS232 signal and TTL signal is the same as that of the master device. The slave device needs to receive the strobe signal sent by the master device, so it is necessary to short-circuit the 1 and 2 pins of J2 with a short-circuit cap, because on the master device, the 2 and 3 pins of J2 are short-circuited, so when the master device After cascading with the slave device, the strobe signal sent from pin 16 of IC1 on the master device is connected to pin 18 of IC1 of the slave device, and then IC1 converts the RS232 level signal into a TTL signal, It is output from pin 3 of IC1 and connected to an IO pin of IC3, so that the slave device receives the strobe signal sent by the master device. To send data from the slave device to the master device, in addition to timely sending according to the received strobe signal, it is also necessary to keep J4, J5, and J6 in an open state, and the data sent by the slave device is output to IC2 through an IO pin of IC3 superior. Since J4, J5, and J6 at the master device end are in a short-circuit state, all the signals output from the slave device are isolated by IC2, connected together at the master and backup ends, and can be received by the master device. When multiple slave devices are cascaded, it is necessary to connect J3 of the previous slave device to J1 of the next slave device outside the device.

以上所述,仅为本发明较佳的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到的变化或替换,都应涵盖在本发明的保护范围之内。The above is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed in the present invention can easily think of changes or Replacement should be covered within the protection scope of the present invention.

Claims (5)

1. one kind through using the universal serial port technology to make the method for electronic equipment networking cascade, and wherein, electronic equipment comprises: computer, main equipment, some slave units, and main equipment and slave unit respectively have two universal serial port ports, are respectively port A and port B; It is characterized in that: the universal serial port of computer is connected on the port A of main equipment; The port B of main equipment is connected on the port A of first slave unit; The port B of first slave unit is connected on the port A of second slave unit, and the like, with the form connection all devices of daisy chain; A CPU or the FPGA control unit as transceive data is all arranged in each equipment; The data that make all slave units send through photoelectric coupled device simultaneously can connect together; Because photoelectric coupled device has the effect that photoelectricity is isolated, so all slave units data of sending to computer are connected to any and are achieved; In main equipment and each slave unit, the level shifting circuit unit is arranged all, be used for converting signal level into level standard that main equipment, slave unit can receive;
The universal serial port of computer makes the transmitting terminal of computer general-purpose serial ports be connected on the receiving terminal of all devices simultaneously through main equipment through this cascade system of daisy chain in this method; The transmitting terminal of universal serial port at first enters into main equipment port A on the concrete computer; Inner at main equipment then, the transmitting terminal of computer general-purpose serial ports is connected on the main equipment port B, so the transmitting terminal of computer general-purpose serial ports is exported from main equipment port B; And then be connected on the slave unit 1 port A; Again this line is connected on the slave unit 1 port B in slave unit port A inside, again from slave unit 1 port B output, is connected on the slave unit 2 port A afterwards; And the like, thereby the type of attachment of formation daisy chain; The data that computer sends to each equipment are to send with the forms of broadcasting;
The receiving terminal of the universal serial port of computer is connected to main equipment port A in this method, and the data that all slave units send to computer all are transmitted to computer by main equipment; All slave units send to the data of computer through photoelectric coupled device output, are connected on the main equipment through the daisy chaining unification then; All equipment can not send data to computer simultaneously, but adopts time-multiplexed mode to send data to computer; When main equipment and each slave unit send data to computer has one of following dual mode to realize: a kind of mode is the gating instruction decision that main equipment sends; Another kind of mode be to send the gating instruction by computer, this gating instruction be sent as broadcast mode, each equipment instructs according to the gating that receives and determines whether to computer transmission data.
2. according to claim 1 a kind of through using the universal serial port technology to make the method for electronic equipment networking cascade; It is characterized in that: the level conversion unit between main equipment and the slave unit can increase photoelectric conversion module, makes to use optical fiber to connect between main equipment and the slave unit.
3. according to claim 1 a kind of through using the universal serial port technology to make the method for electronic equipment networking cascade; It is characterized in that: the mode when main equipment and each slave unit send data to computer be main equipment send gating instruction decision the time; The instruction of this gating is with the serial data form, transmits through the RS232 level, and this gating instructs that uniformly-spaced the time sends.
4. according to claim 1 a kind of through using the universal serial port technology to make the method for electronic equipment networking cascade; It is characterized in that: concrete implementation method can be following: computer general-purpose serial ports (1) links to each other with main equipment port A (2); Signal transmission between main equipment port A (2) and main equipment port B (3), main equipment level conversion (4), the main equipment control unit (5) is to convert signal level into level standard that computer and main equipment can receive, and to be connected to main equipment port B (3) be the needs for equipment cascading to some signals simultaneously; Main equipment port B (3) links to each other with slave unit 1 port A (6); Signal transmission between slave unit 1 port A (6) and slave unit 1 port B (7), slave unit 1 level conversion (8), slave unit 1 control unit (9) is to convert signal level into level standard that main equipment, slave unit 1, slave unit 2, computer can receive, and to be connected to slave unit 1 port B (7) be the needs for equipment cascading to some signals simultaneously; Slave unit 1 port B (7) links to each other with slave unit 2 port A (11); Signal transmission between slave unit 2 port A (11) and slave unit 2 port B (12), slave unit 2 level conversion (13), slave unit 2 control units (14) is to convert signal level into level standard that main equipment, slave unit 1, slave unit 2, computer can receive, and to be connected to slave unit 2 port B (12) be the needs for equipment cascading to some signals simultaneously; Slave unit 1 control unit (9) links to each other with slave unit 1 photoelectric coupled device (10), and slave unit 1 photoelectric coupled device (10) output is connected to slave unit 1 port B (7) and slave unit 1 port A (6); Slave unit 2 control units (14) link to each other with slave unit 2 photoelectric coupled devices (15), and slave unit 2 photoelectric coupled devices (15) are connected to slave unit 2 port B (12) and slave unit 2 port A (11); Through being connected of main equipment port B (3) and slave unit 1 port B (7), slave unit 2 port A (11), realized slave unit 1 photoelectric coupled device (10) output, slave unit 2 photoelectric coupled devices (15) output are connected on the main equipment control unit (5) simultaneously; On whole link, 4 circuit-switched data stream signal is arranged; The cascade that the 1st circuit-switched data stream signal is the signal that sends out from computer general-purpose serial ports (1) through each equipment room is transferred to main equipment and each slave unit with the forms of broadcasting, enters into the control unit of each equipment then through level conversion separately; The 2nd circuit-switched data stream signal is to be cascaded to each slave unit from the signal that main equipment control unit (5) sends out through main equipment level conversion (4), main equipment port B (3); Form with broadcasting is transferred to each slave unit, enters into the control unit of each slave unit then through the level conversion of each slave unit; The 3rd circuit-switched data stream signal is that the control unit from each slave unit sends through after the optocoupler effect, again by the laggard device control cell (5) of becoming owner of of the cascade of each equipment; The 4th circuit-switched data stream signal is to send out from main equipment control unit (5), behind main equipment level conversion (4) entering main equipment port B (3), main equipment port A (2), is connected on the computer general-purpose serial ports (1); Transmission through this 4 circuit-switched data stream signal just can realize that computer and each equipment carry out exchanges data, has realized that use universal serial port technology makes electronic equipment networking cascade.
5. according to claim 4 a kind of through using the universal serial port technology to make the method for electronic equipment networking cascade, it is characterized in that: on the basis of 3 equipment cascadings of the said method realization of claim 4, can carry out a plurality of equipment cascadings as required.
CN201110383381.2A 2011-11-25 2011-11-25 Method for networking and cascading electronic equipment by using universal serial port technology Expired - Fee Related CN102523141B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110383381.2A CN102523141B (en) 2011-11-25 2011-11-25 Method for networking and cascading electronic equipment by using universal serial port technology

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110383381.2A CN102523141B (en) 2011-11-25 2011-11-25 Method for networking and cascading electronic equipment by using universal serial port technology

Publications (2)

Publication Number Publication Date
CN102523141A true CN102523141A (en) 2012-06-27
CN102523141B CN102523141B (en) 2014-05-14

Family

ID=46293940

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110383381.2A Expired - Fee Related CN102523141B (en) 2011-11-25 2011-11-25 Method for networking and cascading electronic equipment by using universal serial port technology

Country Status (1)

Country Link
CN (1) CN102523141B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103414617A (en) * 2013-08-09 2013-11-27 深圳市富斯遥控模型技术有限公司 Serial I-BUS structure applied to remote control model and communication method thereof
CN103927148A (en) * 2013-01-10 2014-07-16 智邦科技股份有限公司 Execution device, stacking method thereof and stacking system
CN108133585A (en) * 2016-12-01 2018-06-08 深圳市三诺数字科技有限公司 A kind of equipment even controls device, method and system
CN109656849A (en) * 2018-12-25 2019-04-19 深圳市慎勇科技有限公司 A kind of bus address distribution system and communication means based on cascade father node gating

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN2574116Y (en) * 2002-10-17 2003-09-17 北京安控科技发展有限公司 Serial port extension circuit
US6675224B1 (en) * 1999-03-01 2004-01-06 Hitachi, Ltd. Information processing apparatus
CN1529491A (en) * 2003-10-20 2004-09-15 中兴通讯股份有限公司 Signal conversion device for master-slave network
CN1992750A (en) * 2005-11-16 2007-07-04 三星电子株式会社 Interface device, interface cable apparatus and communication system compriging the same
CN102185748A (en) * 2011-03-15 2011-09-14 国家无线电监测中心检测中心 Temperature and humidity sensing networking system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6675224B1 (en) * 1999-03-01 2004-01-06 Hitachi, Ltd. Information processing apparatus
CN2574116Y (en) * 2002-10-17 2003-09-17 北京安控科技发展有限公司 Serial port extension circuit
CN1529491A (en) * 2003-10-20 2004-09-15 中兴通讯股份有限公司 Signal conversion device for master-slave network
CN1992750A (en) * 2005-11-16 2007-07-04 三星电子株式会社 Interface device, interface cable apparatus and communication system compriging the same
CN102185748A (en) * 2011-03-15 2011-09-14 国家无线电监测中心检测中心 Temperature and humidity sensing networking system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
付余民 等: "配网自动化串口通信组网方法", 《2003中国电机工程学会电力系统自动化专委会供用电管理自动化分专业委员会成立暨第一届学术交流会议论文集》 *

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103927148A (en) * 2013-01-10 2014-07-16 智邦科技股份有限公司 Execution device, stacking method thereof and stacking system
US9367506B2 (en) 2013-01-10 2016-06-14 Accton Technology Corporation Executive device and control method and electronic system thereof
CN103927148B (en) * 2013-01-10 2016-09-14 智邦科技股份有限公司 Execution device, stacking method thereof and stacking system
CN103414617A (en) * 2013-08-09 2013-11-27 深圳市富斯遥控模型技术有限公司 Serial I-BUS structure applied to remote control model and communication method thereof
CN103414617B (en) * 2013-08-09 2017-02-01 深圳市富斯遥控模型技术有限公司 Serial I-BUS structure applied to remote control model and communication method thereof
CN108133585A (en) * 2016-12-01 2018-06-08 深圳市三诺数字科技有限公司 A kind of equipment even controls device, method and system
CN108133585B (en) * 2016-12-01 2020-02-07 深圳市三诺数字科技有限公司 Equipment continuous control device, method and system
CN109656849A (en) * 2018-12-25 2019-04-19 深圳市慎勇科技有限公司 A kind of bus address distribution system and communication means based on cascade father node gating
CN109656849B (en) * 2018-12-25 2022-02-08 深圳市慎勇科技有限公司 Bus address distribution system based on cascade father node gating and communication method

Also Published As

Publication number Publication date
CN102523141B (en) 2014-05-14

Similar Documents

Publication Publication Date Title
CN210469324U (en) Optical fiber ring network industrial control system
CN206433003U (en) Ethernet link switching device
CN112395233A (en) Software definition switching system and method based on CPU and SDI chip
CN102523141B (en) Method for networking and cascading electronic equipment by using universal serial port technology
CN107204992B (en) A kind of multifunctional serial server and data transmission method
CN101873262A (en) Industrial Fiber Ethernet Switches
CN110045709A (en) Industrial-grade remote IO module based on EtherCAT
WO2018234101A1 (en) POE NETWORK REINFORCED WITH OPTICAL FIBERS
CN104579696A (en) Optical fiber switch system and optical fiber switch
CN202602694U (en) Physical-isolation Ethernet switch
CN102026050A (en) Optical fiber CAN bus hub and networking method thereof
CN103116567B (en) Selection circuit of multiple serial ports
CN104618026A (en) Design method of optical fiber interconnection system
CN105471752B (en) Device, method and system for rack stacking based on switching network
CN105162514A (en) Optical fiber ring network communication system and method
CN110062303B (en) Mesh network-based self-adaptive high-capacity cross optical communication equipment architecture
CN109361461A (en) A RapidIO Protocol Transmission System Based on Fiber Channel
CN101807950A (en) Method for realizing loop self-healing function of repeater system
CN207504890U (en) bus system
CN104539560B (en) Optical fiber switch system and its data processing method, channel resolver
CN104135411A (en) Device and method of implementing multi-node communication based on RS232 interface
CN111416750A (en) A fault monitoring system and monitoring method for single-wire Ethernet ring network
CN104572556A (en) Multistage serial port expansion circuit
CN117082110A (en) Fan controller network architecture based on switched Ethernet and high-speed parallel network
CN204334305U (en) A kind of converter valve level control device for flexible AC transmission

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: 20140514

CF01 Termination of patent right due to non-payment of annual fee