Mixing communication method based on RS485, data collector and system
By managing the serial port configuration parameters of devices in groups on the RS485 bus, efficient data acquisition from multiple devices was achieved, solving the problems of low bus utilization and complex communication, simplifying the wiring structure and improving acquisition efficiency.
Patent Information
- Application Number
- CN202110969167.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-23
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2041-08-23
AI Technical Summary
Existing RS485 bus data acquisition devices require multiple buses and complex engineering wiring to connect different power devices, resulting in low bus utilization and unstable communication.
The serial port configuration parameters and communication protocol of each device are obtained by a data acquisition device, a bus interface configuration file is generated, the devices are divided into different groups, and the serial port communication parameters are adjusted sequentially through an RS485 bus to collect data, thus avoiding communication interference between devices.
The wiring structure was simplified, the bus utilization and acquisition efficiency were improved, the number of buses and the complexity of engineering wiring were reduced, and the normal operation of communication was ensured.
Smart Images

Figure CN115905089B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of power electronics and electromotion, in particular to a mixed connection communication method based on RS485, a data collector adopting the method and a system comprising the data collector. BACKGROUND
[0002] RS485 is a standard defining the electrical characteristics of drivers and receivers in balanced digital multipoint systems, which is defined by the Telecommunications Industry Association and the Electronic Industries Alliance. Digital communication networks using the standard can effectively transmit signals under long-distance conditions and in environments with high electronic noise. Currently, existing RS485 bus collectors must have the same Serial Port configuration parameters and the same data communication protocol on each RS485 bus. If various different power devices need to be connected, multiple buses are required, which results in a large number of buses, low bus utilization, and complex engineering wiring. If various different power devices are connected to one bus, different baud rates, parity bits, stop bits, etc. are required, which can easily cause communication failure.
[0003] The present application can connect products with different Serial Port configuration parameters and data communication protocols to the same bus, improve bus utilization, reduce the number of buses and the complexity of engineering wiring, and ensure normal communication. SUMMARY
[0004] The present application aims to overcome the defects of the prior art and provide a mixed connection communication method based on RS485, a data collector adopting the mixed connection communication method based on RS485, and a mixed connection communication system based on RS485.
[0005] To achieve the above-mentioned purpose, the present application adopts the following technical solutions:
[0006] The present application provides a mixed connection communication method based on RS485, wherein the serial port of a data collector is connected to multiple devices through one RS485 bus, and the mixed connection communication method comprises the following steps:
[0007] Step 1: The data collector obtains the serial port configuration parameters and the communication protocol of each device and generates a bus interface configuration file.
[0008] Step 2: The data collector divides the multiple devices into n groups according to the serial port configuration parameters, wherein n is an integer greater than or equal to 1, the devices in the same group have the same serial port configuration parameters, and the serial port configuration parameters of the devices in different groups are different.
[0009] Step 3, the data collector calls the serial port configuration parameters of the group of devices from the bus interface configuration file, and adjusts the serial port communication parameters of the data collector according to the serial port configuration parameters of the group of devices;
[0010] Step 4, the data collector opens the serial port, and completes the collection operation of each device in the group according to the communication protocol of each device in the group, sends the collection command to each device in turn, and waits to receive information;
[0011] Step 5, the data collector closes the serial port after completing the collection operation of the group of devices;
[0012] Step 6, the data collector repeats the operations of steps 3-5 until the collection operation of all groups of devices is completed, and then the data collector completes a sampling period.
[0013] Further, the serial port configuration parameters include baud rate, data bits, check bits and stop bits.
[0014] Further, the data collector obtains the serial port configuration parameters and the communication protocol of each device by automatic identification or manual input.
[0015] Further, when a new device is connected, the data collector terminates the ongoing collection operation and starts the collection operation from step 1 again.
[0016] Further, in step 4, after the data collector sends the collection command to the device, the data collector performs a timeout operation after waiting to receive information for a timeout period.
[0017] Further, the data collector stores at least the grouping information of the last two times, and the latest grouping information automatically replaces the earliest grouping information each time the data collector performs grouping again; the data collector compares the latest grouping information with the previous grouping information, identifies the groups that have not changed and have been collected, and after the data collector updates the bus interface configuration file, the data collector continues to complete the interrupted collection period, and only collects data of the devices in the groups that have not been completed and the groups whose grouping information has changed.
[0018] Further, if the data collector performs a timeout operation on the same device for m consecutive times, m≥1 and is an integer, an alarm information is sent.
[0019] Further, in step 4, for the serial port that successfully collects device information, the time length for collecting the device data is recorded; for the serial port that collects information for a timeout period, the device that times out and the number of times of timeout are recorded;
[0020] The data collector adjusts the data collection sequence of each group according to the average length of collecting the device data of the group and whether the group has a timeout device, collects the group without timeout device first, and collects the group with timeout device last.
[0021] The application further provides a data collector which executes the RS485-based mixed connection communication method.
[0022] Further, the data collector comprises a processor and a Flash memory, a RAM memory and an RS485 interface connected to the processor respectively; the Flash memory is internally provided with a grouping algorithm, a collection program and a database, and is further used for storing a bus interface configuration file and storing the data collected by the data collector in the database; the processor groups multiple devices according to the serial port configuration parameters of the devices through the grouping algorithm, and adjusts the serial port communication parameters and opens / closes the serial port through the collection program; the RAM memory is used for data exchange with the processor; and the RS485 interface is connected to the multiple devices through an RS485 bus.
[0023] Further, the data collector further comprises an HMI device connected to the processor; the Flash memory is internally provided with a Web server, and the data collector is connected to the Internet through the RS485 interface.
[0024] Further, the data collector further comprises an RJ45 interface, and the data collector is connected to an upper computer through the RJ45 interface.
[0025] The application further provides an RS485-based mixed connection communication system which comprises the data collector and an upper computer connected to the data collector.
[0026] The RS485-based mixed connection communication method of the application realizes the data collection of multiple devices with different serial port configuration parameters and / or communication protocols through one RS485 bus, saves the number of RS485 buses and simplifies the wiring structure compared with the prior art; the data collector groups multiple devices according to the serial port configuration parameters, and collects the devices with different serial port configuration parameters in different time periods through the opening / closing of the serial port, avoids the communication interference between the devices with different serial port configuration parameters and the data collector, reduces the number of times of adjusting the serial port communication parameters and opening / closing the serial port of the data collector, improves the working efficiency of the processor, and thus improves the collection efficiency.
[0027] The data collector of the application executes the RS485-based mixed connection communication method, and realizes the communication of multiple devices with different serial port configuration parameters and / or communication protocols through one RS485 bus.
[0028] The RS485-based hybrid communication system of the present invention includes the data acquisition unit, which executes the RS485-based hybrid communication method. It can realize data acquisition from multiple devices with different serial port configuration parameters and / or communication protocols through a single RS485 bus. Compared with the prior art, it saves the number of RS485 buses used and simplifies the wiring structure. Attached Figure Description
[0029] Figure 1 This is a schematic diagram of an embodiment of the RS485-based hybrid communication method of the present invention;
[0030] Figure 2 This is a schematic diagram of another embodiment of the hybrid communication method based on RS485 of the present invention;
[0031] Figure 3 This is a schematic diagram of the module structure of the data acquisition device of the present invention;
[0032] Figure 4 This is a schematic diagram of an embodiment of the RS485-based hybrid communication method of the present invention;
[0033] Figure 5 This is a schematic diagram of another embodiment of the RS485-based hybrid communication system of the present invention. Detailed Implementation
[0034] The following is in conjunction with the appendix Figures 1-5 The given embodiments further illustrate specific implementations of the RS485-based hybrid communication method of the present invention. The RS485-based hybrid communication method of the present invention is not limited to the descriptions in the following embodiments.
[0035] A hybrid communication method based on RS485, wherein the serial port of a data acquisition unit is connected to multiple devices via an RS485 bus, the hybrid communication method includes the following steps:
[0036] Step 1: The data acquisition unit obtains the serial port configuration parameters and communication protocol of each device and generates a bus interface configuration file.
[0037] Step 2: The data acquisition device divides multiple devices into n groups according to the serial port configuration parameters, where n ≥ 1 and is an integer. Devices in the same group have the same serial port configuration parameters, while devices in different groups have different serial port configuration parameters.
[0038] Step 3: The data acquisition unit retrieves the serial port configuration parameters of one group of devices from the bus interface configuration file, and adjusts the serial port communication parameters of the data acquisition unit according to the serial port configuration parameters of that group of devices.
[0039] Step 4, the data collector opens the serial port, and sequentially completes the acquisition operation of each device in the group according to the communication protocol of each device in the group, sequentially sends an acquisition command to each device, and waits to receive information;
[0040] Step 5, after the data collector completes the acquisition operation of the group of devices, the serial port is closed;
[0041] Step 6, the data collector repeats the operations of steps 3-5 until the acquisition operation of all groups of devices is completed, and then the data collector completes a sampling period.
[0042] The mixed connection communication method based on RS485 of the application realizes the data acquisition of multiple devices with different serial port configuration parameters and / or communication protocols through only one RS485 bus, compared with the prior art, the use number of RS485 buses is saved, and the wiring structure is simplified; moreover, the data collector groups multiple devices according to serial port configuration parameters, and sequentially acquires devices with different serial port configuration parameters in different time periods through the opening / closing of the serial port, so that the communication interference between devices with different serial port configuration parameters and the data collector is avoided, the number of times of adjusting the serial port communication parameters and opening / closing the serial port of the data collector is reduced, the working efficiency of the processor is improved, and thus the acquisition efficiency is improved.
[0043] Preferably, the serial port configuration parameters include baud rate, data bits, check bits and stop bits.
[0044] Preferably, the data collector obtains the serial port configuration parameters and the communication protocol of the device through automatic identification or manual input.
[0045] Preferably, when a new device is connected, the data acquisition device terminates the ongoing acquisition operation, records the groups that have been acquired and the devices that have been acquired, and starts the acquisition operation from step 1 again. Further, the data collector stores at least the grouping information of the last two times, the latest grouping information automatically covers the earliest grouping information every time the data collector re-groups, the data collector compares the latest grouping information and the previous grouping information, identifies the groups that have not changed and have been acquired, and after the data collector updates the bus interface configuration file, the data collector continues to complete the interrupted acquisition period, and only acquires the data of the devices in the groups that have not been completed and the groups whose grouping information has changed, which is beneficial to avoid or significantly reduce the repeated acquisition operation of the data collector, and is helpful to improve the efficiency of the data acquisition operation.
[0046] Preferably, in step 4, after the data collector sends the collection command to the device, if the data collector does not receive the information from the device within a waiting time, the data collector performs a timeout operation. Further, the timeout operation refers to that the data collector sends the collection command to the device and waits for a time t, where t>0s, and does not receive the information returned by the device, then the data collector skips the device and performs data collection on other devices, and waits for the next collection period to perform data collection on the device again. Further, if the data collector performs the timeout operation on the same device for m times, where m≥1 and is an integer, an alarm information is sent out, indicating that the device has a fault or the communication between the data collector and the device is interrupted, reminding timely maintenance. Preferably, m is 1 or 2 or 3 or 4 or 5. The timeout operation of the data collector avoids the situation that the data collector waits for a long time due to the non-response of an individual device, which affects the data collection of other devices, and is beneficial to improve the collection efficiency.
[0047] Specifically, after the data collector sends the collection command to a device and waits for a time, if the data collector does not receive the information from the device, the data collector gives up the collection of the information of the device, clears the waiting-receiving identifier of the device, and increases the timeout counter corresponding to the device by 1. If the count of the timeout counter exceeds a user-set value, the data collector determines that the device is in a connection interruption, sends a prompt to the user terminal, and then sends the collection command to the next device.
[0048] Preferably, in step 2, the communication protocols of the devices in the same group can be the same or different, or the communication protocols of some devices are the same and the communication protocols of the remaining devices are different. For example, in a group, there are five devices, and the communication protocols of the five devices can be different, or the communication protocols of the five devices are the same, or the communication protocols of three devices are the same and the communication protocols of the other two devices are different (the communication protocols of the two devices can be the same or different).
[0049] Preferably, in step 1, the bus interface configuration file is a data list including device data of each device, and the device data of each device includes a serial port configuration parameter and a data list of communication protocols; in step 2, the data collector divides the devices into n groups according to the serial port configuration parameters, that is, divides the device data having the same serial port configuration parameters into a group according to the similarities and differences of the serial port configuration parameters recorded in the bus interface configuration file.
[0050] As shown in Figure 1 , it is one embodiment of the RS485-based mixed connection communication method.
[0051] As shown in Figure 1As shown, the data collector is connected with an RS485 bus including a plurality of nodes for connecting devices, preferably the RS485 bus includes 32 nodes, and each node is connected with a device. In combination with Table 1, the serial port configuration parameters of the device connected with the node 1 are: the baud rate is 9600bps, the data bit is 8bit, the check bit is no check, and the stop bit is 1bit; the serial port configuration parameters of the 9 devices connected with the nodes 2-10 are: the baud rate is 9600bps, the data bit is 8bit, the check bit is odd check, and the stop bit is 2bit; the serial port configuration parameters of the 8 devices connected with the nodes 11-18 are: the baud rate is 19200bps, the data bit is 8bit, the check bit is even check, and the stop bit is 1.5bit; the serial port configuration parameters of the 3 devices connected with the nodes 19-21 are: the baud rate is 9600bps, the data bit is 8bit, the check bit is no check, and the stop bit is 2bit; the serial port configuration parameters of the 12 devices connected with the nodes 21-32 are: the baud rate is 4800bps, the data bit is 8bit, the check bit is even check, and the stop bit is 1bit.
[0052] Table 1:
[0053] Node number Baud rate Data bits Parity bits Stop bits Node 1 9600 bps 8 bit No parity 1 Nodes 2-10 9600 bps 8 bit Odd parity 2 Nodes 11-18 19200 bps 8 bit Even parity 1.5 Nodes 19-21 9600 bps 8 bit No parity 2 Nodes 21-32 4800 bps 8 bit Even parity 1
[0054] Preferably, the communication protocol of the 16 devices connected with the nodes 1-16 is Modbus-RTU protocol, and the communication protocol of the 16 devices connected with the nodes 17-32 is other RS485 bus protocol.
[0055] The RS485-based mixed communication method of the application includes the following steps:
[0056] Step 1, the data collector acquires the serial port configuration parameters and the communication protocol of all the devices connected with the nodes 1-32 by automatic identification or manual input, and generates a bus interface configuration file.
[0057] Step 2: The data acquisition device groups the 32 devices according to their serial port configuration parameters to generate grouped bus interface configuration files. Devices in the same group have the same serial port configuration parameters, while devices in different groups have different serial port configuration parameters. As shown in Table 1, the serial port configuration parameters of the 1 device connected to node 1, the 9 devices connected to nodes 2-10, the 9 devices connected to nodes 11-18, the 3 devices connected to nodes 19-21, and the 12 devices connected to nodes 21-32 are all different. Therefore, the data acquisition device will divide these 32 devices into 5 groups: the first group includes the 1 device connected to node 1; the second group includes the 9 devices connected to nodes 2-10; the third group includes the 8 devices connected to nodes 11-18; the fourth group includes the 3 devices connected to nodes 19-21; and the fifth group includes the 12 devices connected to nodes 21-32.
[0058] Step 3: The data acquisition device retrieves the bus interface configuration file after grouping, and first adjusts the serial communication parameters of the data acquisition device according to the serial port configuration parameters of the first group of devices.
[0059] It should be noted that the data acquisition device can automatically determine the data acquisition order based on the data list in the bus interface configuration file (preferably, the order in which the data acquisition device acquires data from each group of devices is related to the order of the serial port configuration parameters in the bus interface configuration file), or the data acquisition order can be manually set. That is, the data acquisition device can automatically acquire data from each group of devices in the order from the first to the fifth group, or in another order (e.g., from the fifth group to the first group); the data acquisition order can also be manually set and controlled (e.g., it could be the order of the first group → the second group → the third group → the fourth group → the fifth group, or the order of the first group → the third group → the second group → the fifth group → the fourth group, which the user can adjust as needed).
[0060] Furthermore, the data collector adjusts the data collection order of each group based on the average time for collecting data from the group of devices recorded in step 4, and whether any devices in the group have timed out. Groups with short average collection times and no timed-out devices are collected first, and groups with timed-out devices are collected last.
[0061] Step 4: The data acquisition device opens the serial port and completes the acquisition operation of each device in the group in sequence. According to the communication protocol of one device in the group (i.e., Modbus-RUT protocol), it sends an acquisition command to the device and waits to receive the information output by the device.
[0062] Preferably, in step 4, the data collector sends a collection command and waits for a timeout, and then the data collector performs a timeout operation. Further, in step 4, after the data collector sends a collection command to a device, the data collector waits for a time t (0 < t < 10 s) and if the device does not return information, the data collector automatically skips the device and performs data collection on the subsequent devices, and then the data collector performs data collection on the device again in the next collection cycle.
[0063] Preferably, for a serial port that successfully collects device information, the time for collecting the device data is recorded; for a timeout, the device that times out and the number of times it times out are recorded.
[0064] In step 5, after the data collector completes the collection operation of one device in the first group, the data collector closes the serial port.
[0065] In step 6, the data collector repeats the operations of steps 3-5 until the collection operation of all devices is completed. Specifically, after the data collector completes the collection operation of the devices in the first group and closes the serial port, the data collector adjusts the serial communication parameters of the data collector according to the serial port configuration parameters of the second group, then the data collector opens the serial port, and the data collector sends a collection command to each of the eight devices in the second group according to the communication protocol of the eight devices (Modbus-RUT protocol) and waits for the information or performs a timeout operation. After the data collector completes the collection operation of the eight devices in the second group, the data collector closes the serial port. In turn, the data collector completes the collection operation of the devices in the third group, the fourth group, and the fifth group, and then the data collector completes one collection cycle.
[0066] Preferably, when new devices are accessed, the data collector terminates the ongoing collection operation and starts the collection operation from step 1 again. Further, the data collector stores the latest two grouping information, and the latest grouping information automatically replaces the earliest grouping information each time the data collector re-groups. The data collector compares the latest grouping information and the previous grouping information, and identifies the groups that have not changed and have been collected completely. After the data collector updates the bus interface configuration file, the data collector continues to complete the interrupted collection cycle, and only collects data from the devices in the groups that have not been completed and the groups whose grouping information has changed. For example, when the data collector collects data from the devices in the fourth group, new devices are accessed in the fifth group. Then, the data collector interrupts the data collection operation from the devices in the fourth group, updates the bus interface configuration file, and compares the latest grouping information and the previous grouping information. Then, when the collection cycle is continued, the data collector does not collect data from the devices in the first group to the third group again, but only collects data from the devices in the fourth group again, and then collects data from the devices in the fifth group. Alternatively, when the data collector collects data from the devices in the fourth group, new devices are accessed in the first group. Then, the data collector interrupts the data collection operation from the devices in the fourth group, updates the bus interface configuration file, and compares the latest grouping information and the previous grouping information. Then, when the collection cycle is continued, the data collector does not collect data from the devices in the second group and the third group again, but only collects data from the devices in the fourth group, the fifth group, and the first group.
[0067] As shown in Figure 2 , it is a second embodiment of the RS485-based mixed connection communication method of the application.
[0068] The method of the embodiment is applied to a solar photovoltaic power generation system. The data collector is connected to a bus junction box, a direct current distribution cabinet, an inverter, and an alternating current distribution cabinet through an RS485 bus with four nodes. The bus junction box, the direct current distribution cabinet, the inverter, and the alternating current distribution cabinet have different communication protocols and serial port configuration parameters (specifically, the baud rates and check bits of the four devices are different). The data collector can accurately and timely monitor the state information of the four devices connected to the RS485 bus, including current, voltage, alarm, and fault information, through the method of the application.
[0069] As shown in Figure 3 , the application further discloses a data collector for executing the RS485-based mixed connection communication method.
[0070] The data collector comprises a processor, a Flash memory, a RAM memory and an RS485 interface connected to the processor respectively; the Flash memory is internally provided with a grouping algorithm, a collection program and a database, and is further used for storing a bus interface configuration file, the data collected by the data collector is stored in the database, the bus interface configuration file is stored in the Flash memory and can be in the form of a database, a text or data directly stored in a specific address; the processor groups the devices according to the serial port configuration parameters of the devices through the grouping algorithm, and adjusts the serial port communication parameters and opens / closes the serial port through the collection program; the RAM memory is used for data exchange with the processor; the RS485 interface is connected to multiple devices through an RS485 bus.
[0071] Preferably, the processor is an ARM chip, and the ARM chip, the Flash memory and the RAM memory are in an integrated structure.
[0072] Preferably, the data collector further comprises an HMI device connected to the processor; the Flash memory is internally provided with a Web server, and the data collector is connected to the Internet through the RS485 interface. The HMI device is a human-computer interaction interface device, which is used as a field monitoring interface of the data collector and realizes local monitoring and configuration functions; the Web server is a built-in Web server program in the Flash memory, which can be connected to the Internet through the RS485 interface, provides a Web publishing function for a user end, and facilitates users with corresponding permissions to view and set the data collector through a smart user end (such as a smart phone, a tablet computer and a PC end), so as to realize remote monitoring and configuration functions of the data collector. For example, the serial port configuration parameters of the devices connected to each port of the data collector are set.
[0073] Preferably, the data collector further comprises an RJ45 interface, and the data collector is connected to an upper computer through the RJ45 interface. The user can realize HMI configuration and Web configuration through the upper computer, and can further configure serial port configuration transmission and communication protocols of the devices connected to the RS485 bus, and can further perform network configuration and server configuration on the data collector, and can further generate a bus interface configuration file according to the devices connected to the RS485 and store the file in the Flash memory of the data collector.
[0074] It should be pointed out that the user can configure the data collector device operating parameters (such as IP address), device networking information, device list, serial port configuration parameters, communication protocol, device point table, etc. through the HMI device, intelligent user terminal (communicating with the data collector through the Web network) or host computer. The user can configure the serial port configuration parameters and communication protocol table of the devices on the RS485 bus, perform data collector network configuration and server configuration, and finally generate a configuration file stored in the Flash memory through the HMI device, intelligent user terminal (communicating with the data collector through the Web network) or host computer.
[0075] The application also provides another RS485-based mixed connection communication method. The serial port of the data collector is connected with multiple devices through an RS485 bus. The serial port configuration parameters of each device are read in sequence through the bus interface configuration file. The serial port configuration parameters of one device are read each time. The serial port communication parameters of the data collector are adjusted according to the serial port configuration parameters of the device. Data collection is performed. The collection command is sent. Information is received. The data collection of multiple devices is performed one by one. The same serial port configuration parameters are not grouped. The mixed connection communication method comprises the following steps:
[0076] Step 1: The data collector obtains the serial port configuration parameters and communication protocol of each device and generates a bus interface configuration file.
[0077] Step 2: The data collector calls the serial port configuration parameters of one device from the bus interface configuration file. The serial port communication parameters of the data collector are adjusted according to the serial port configuration parameters of the device.
[0078] Step 3: The data collector opens the serial port. The collection command is sent to the device according to the communication protocol of the device. Information is received.
[0079] Step 4: The data collector closes the serial port after completing the collection operation of the device.
[0080] Step 5: The data collector repeats the operations of steps 2-4 to complete the collection operation of all devices.
[0081] This method also realizes the data collection of multiple devices with different serial port configuration parameters and / or communication protocols through an RS485 bus. Compared with the prior art, the use of the RS485 bus is saved. The wiring structure is simplified. Of course, the efficiency is lower than that of the first grouping method.
[0082] Further, the bus interface configuration file of the method can sort serial port configuration parameters of each device, when the data collector completes data collection of one device, if serial port communication parameters of the next device are same as the serial port communication parameters of the current data collector, adjustment is not needed when reading the serial port communication parameters of the next device.
[0083] The application further discloses an RS485-based mixed connection communication system, which comprises the data collector and a host computer connected with the data collector.
[0084] As shown in Figure 4 , it is one embodiment of the RS485-based mixed connection communication system.
[0085] The RS485-based mixed connection communication system is applied to a photovoltaic system.
[0086] As shown in Figure 4 , the data collector is connected with the host computer, and is connected with multiple devices through an RS485 bus comprising 15 nodes, the host computer is pre-stored with monitoring software, nodes 1-10 of the RS485 bus are connected with 10 combiner boxes respectively, nodes 11-12 are connected with two inverters respectively, node 13 is connected with a direct current power distribution cabinet, node 14 is connected with an environment monitor, and node 15 is connected with an alternating current power distribution cabinet. In combination with Table 2, serial port configuration parameters of the 10 combiner boxes are all: 9600 bps of baud rate, 8 bit of data bit, no check of check bit, and 1 bit of stop bit, the communication protocol of the 10 combiner boxes is Modbus-RTU protocol; serial port configuration parameters of the two inverters are all: 9600 bps of baud rate, 8 bit of data bit, odd check of check bit, and 2 bit of stop bit, the communication protocol of the two inverters is Modbus-RTU protocol; serial port configuration parameters of the direct current power distribution cabinet are: 19200 bps of baud rate, 8 bit of data bit, even check of check bit, and 2 bit of stop bit, the communication protocol of the direct current power distribution cabinet is Modbus-RTU protocol; serial port configuration parameters of the environment monitor are: 9600 bps of baud rate, 8 bit of data bit, no check of check bit, and 1 bit of stop bit, the communication protocol of the environment monitor is private protocol; serial port configuration parameters of the alternating current power distribution cabinet are: 9600 bps of baud rate, 8 bit of data bit, even check of check bit, and 1 bit of stop bit, the communication protocol of the alternating current power distribution cabinet is Modbus-RTU protocol.
[0087] Table 2:
[0088] Node number Baud rate Data bits Parity bits Stop bits Communication protocol Nodes 1-10 9600 bps 8 bit No parity 1 Modbus-RTU Nodes 11-12 9600 bps 8 bit Odd parity 2 Modbus-RTU Node 13 19200 bps 8 bit Even parity 2 Modbus-RTU Node 14 9600 bps 8 bit No parity 1 Private protocol Node 15 9600 bps 8 bit Even parity 1 Modbus-RTU
[0089] The RS485-based hybrid communication system of the application works, and the RS485-based hybrid communication method is executed, specifically as follows.
[0090] (1) First, the data collector collects the state information of the devices in the first group, specifically including the following steps:
[0091] Step 11, the data collector obtains the serial port configuration parameters of all devices (including the bus box, inverter, DC power distribution cabinet, environmental monitor and AC power distribution cabinet) through automatic identification or manual input through the upper computer, and generates a bus interface configuration file.
[0092] Step 12, the data collector groups the devices according to the serial port configuration parameters, and obtains the following groups: the first group includes the bus box connected to nodes 1-10 and the environmental monitor connected to node 14; the second group includes the inverters connected to nodes 11-12; the third group includes the DC power distribution cabinet connected to node 12; and the fourth group includes the AC power distribution cabinet connected to node 15.
[0093] Step 13, the data collector executes the collection program, first loads the serial port configuration parameters of the devices in the first group (i.e. the baud rate is 9600bps, the data bit is 8bit, the check bit is no check, and the stop bit is 1bit), and adjusts the serial port communication parameters of the data collector according to the serial port configuration parameters of the devices in the first group.
[0094] Step 14, the data collector opens the serial port, and sequentially sends collection commands to each device according to the communication protocol of each device from nodes 1-10 to 14, and obtains the loop number, loop current value and total current value from the 10 bus boxes connected to nodes 1-10, and obtains the environmental temperature, irradiance, wind speed and wind direction from the environmental monitor connected to node 14.
[0095] Step 5, the data collector closes the serial port after completing the collection operation of the first group.
[0096] (2) Then, the data collector collects the state information of the devices in the second group, specifically including the following steps:
[0097] Step 21, the data collector executes the collection program, loads the serial port configuration parameters of the devices in the second group (i.e. the baud rate is 9600bps, the data bit is 8bit, the check bit is odd check, and the stop bit is 2bit), and adjusts the serial port communication parameters of the data collector according to the serial port configuration parameters of the devices in the second group.
[0098] Step 22, the data collector opens the serial port, sends the collection command to each device according to the communication protocol of each device in turn, and obtains the data of DC voltage, DC current, AC voltage, AC current, power, frequency, etc. from the two inverters connected to the nodes 11-12 respectively.
[0099] Step 23, the data collector closes the serial port after completing the collection operation of the second group.
[0100] (3) Then, the data collector collects the state information of the third group of devices, specifically including the following steps:
[0101] Step 31, the data collector executes the collection program, loads the serial port configuration parameters of the third group of devices (i.e. the baud rate is 19200bps, the data bit is 8bit, the parity bit is even parity, and the stop bit is 2bit), and adjusts the serial port communication parameters of the data collector according to the serial port configuration parameters of the third group of devices.
[0102] Step 32, the data collector opens the serial port, sends the collection command to each device according to the communication protocol of the device connected to the node 13, and obtains the data of DC voltage, DC current, etc. from the DC power distribution cabinet connected to the node 13.
[0103] Step 33, the data collector closes the serial port after completing the collection operation of the third group.
[0104] (4) Then, the data collector collects the state information of the fourth group of devices, specifically including the following steps:
[0105] Step 41, the data collector executes the collection program, loads the serial port configuration parameters of the fourth group of devices (i.e. the baud rate is 9600bps, the data bit is 8bit, the parity bit is even parity, and the stop bit is 1bit), and adjusts the serial port communication parameters of the data collector according to the serial port configuration parameters of the fourth group of devices.
[0106] Step 42, the data collector opens the serial port, sends the collection command to each device according to the communication protocol of the device connected to the node 15, and obtains the data of AC voltage, AC current, frequency, etc. from the AC power distribution cabinet connected to the node 15.
[0107] Step 43, the data collector closes the serial port after completing the collection operation of the fourth group.
[0108] After the data collector completes the collection of all the combiner boxes, inverters, DC distribution cabinets, environmental monitoring instruments and AC distribution cabinets, it waits for the next collection period and repeats the above operation to complete a new round of collection. It should be noted that if no device is connected or removed before the new collection period arrives, steps 11 and 12 do not need to be repeated; if a new device is connected or removed before the new collection period arrives or during the collection period, steps 11 and 12 need to be repeated, and if it is in the collection period, the collection period is interrupted and steps 11 and 12 are repeated.
[0109] Preferably, the host computer can actively send a request to the data collector to view device data, or the data collector can send device data to the host computer at a fixed time, for example, once every one or several collection periods.
[0110] As shown in Figure 5 , another embodiment of the RS485-based mixed connection communication system of the application is shown.
[0111] The RS485-based mixed connection communication system of the embodiment is applied to a power distribution system.
[0112] As shown in Figure 5 , the data collector is connected to the host computer and is connected to multiple devices through an RS485 bus including 32 nodes. The host computer has pre-installed monitoring software. Node 1-2 of the RS485 bus is connected to two frame circuit breakers, node 3-8 is connected to six plastic shell circuit breakers, node 9-15 is connected to seven temperature rise modules, node 16 is connected to one IO module, and node 17-32 is connected to 16 miniature circuit breakers. According to Table 2, the serial port configuration parameters of the two frame circuit breakers are: baud rate is 9600bps, data bit is 8bit, parity bit is even parity, and stop bit is 1bit. The communication protocol of the two frame circuit breakers is Modbus-RTU protocol. The serial port configuration parameters of the six plastic shell circuit breakers are: baud rate is 9600bps, data bit is 8bit, parity bit is odd parity, and stop bit is 2bit. The communication protocol of the six plastic shell circuit breakers is Modbus-RTU protocol. The serial port configuration parameters of the seven temperature rise modules are: baud rate is 9600bps, data bit is 8bit, parity bit is even parity, and stop bit is 1bit. The communication protocol of the seven temperature rise modules is Modbus-RTU protocol. The serial port configuration parameters of the one IO module are: baud rate is 19200bps, data bit is 8bit, parity bit is no parity, and stop bit is 1bit. The communication protocol of the one IO module is a private protocol. The serial port configuration parameters of the 16 miniature circuit breakers are: baud rate is 19200bps, data bit is 8bit, parity bit is no parity, and stop bit is 1bit. The communication protocol of the 16 miniature circuit breakers is DLT645 protocol.
[0113] Table II:
[0114]
[0115]
[0116] When the RS485-based hybrid communication system of the present application is in operation, the RS485-based hybrid communication method is executed, specifically as follows:
[0117] (1) First, the data collector collects the status information of the devices in the first group, specifically including the following steps:
[0118] Step 11, the data collector obtains the serial port configuration parameters of all devices (including frame circuit breakers, molded case circuit breakers, temperature rise modules, IO modules, and miniature circuit breakers) through automatic identification or manual input through the upper computer, and generates a bus interface configuration file.
[0119] Step 12, the data collector groups the devices according to the serial port configuration parameters, obtaining the following groups: the first group includes the frame circuit breakers connected to nodes 1-2 and the temperature rise modules connected to nodes 9-15; the second group includes the molded case circuit breakers connected to nodes 3-8; the third group includes the IO module connected to node 16 and the miniature circuit breakers connected to nodes 17-32.
[0120] Step 13, the data collector executes the collection program, first loads the serial port configuration parameters of the devices in the first group (i.e., baud rate is 9600bps, data bits are 8bit, parity is even parity, and stop bit is 1bit), and adjusts the serial port communication parameters of the data collector according to the serial port configuration parameters of the devices in the first group.
[0121] Step 14, the data collector opens the serial port, and from nodes 1-2 to 9-15, sends collection commands to each device according to the communication protocol of each device in turn, and obtains three-phase voltage values, three-phase current values, power, power factor, and fault information data from the two frame circuit breakers connected to nodes 1-2, and obtains incoming line busbar temperature rise, outgoing line busbar temperature rise, and environmental temperature data from the temperature rise modules connected to nodes 9-15.
[0122] Step 5, after the data collector completes the collection operation of the first group, the serial port is closed.
[0123] (2) Then, the data collector collects the status information of the devices in the second group, specifically including the following steps:
[0124] Step 21, the data collector executes the collection program, loads the serial port configuration parameters of the second group of devices (i.e. baud rate is 9600bps, data bit is 8bit, check bit is odd check, stop bit is 2bit), and adjusts the serial port communication parameters of the data collector according to the serial port configuration parameters of the second group of devices.
[0125] Step 22, the data collector opens the serial port, and sends the collection command to each device according to the communication protocol of each device in turn from node 3-8, and obtains the three-phase voltage, three-phase current and power data from the six plastic shell circuit breakers connected to node 3-8 respectively.
[0126] Step 23, the data collector closes the serial port after completing the collection operation of the second group.
[0127] (3) Then, the data collector collects the status information of the third group of devices, including the following steps:
[0128] Step 31, the data collector executes the collection program, loads the serial port configuration parameters of the third group of devices (i.e. baud rate is 19200bps, data bit is 8bit, check bit is no check, stop bit is 1bit), and adjusts the serial port communication parameters of the data collector according to the serial port configuration parameters of the third group of devices.
[0129] Step 32, the data collector opens the serial port, sends the collection command to each device according to the communication protocol of the device connected to node 16 and node 17-32 respectively, and obtains the switch quantity information and access control information from the IO module connected to node 16, and obtains the switch opening and closing state and real-time current and voltage from the miniature circuit breaker connected to node 17-32.
[0130] Step 33, the data collector closes the serial port after completing the collection operation of the third group.
[0131] After the data collector completes the collection of all bus boxes, inverters, DC power distribution cabinets, environmental monitors and AC power distribution cabinets, it waits for the next collection period and repeats the above operations to complete a new round of collection. It should be noted that if no device is connected or removed before the new collection period arrives, steps 11 and 12 do not need to be repeated; if a new device is connected or removed before the new collection period arrives or during the collection period, steps 11 and 12 need to be repeated, and if it is in the collection period, the collection period is interrupted and steps 11 and 12 are repeated.
[0132] Preferably, the upper computer can actively send a request to the data collector to view device data, or the data collector can send device data to the upper computer at regular intervals, for example, the data collector sends device data to the upper computer once every one or several collection periods.
[0133] The above description is further detailed in connection with specific preferred embodiments of the present application, and it is not to be construed that the specific implementation of the present application is limited to these descriptions. For those skilled in the art to which the present application belongs, without departing from the concept of the present application, a number of simple deductions or substitutions can be made, and all of them should be considered as falling within the protection scope of the present application.
Claims
1. A hybrid communication method based on RS485, characterized in that, The serial port of the data collector is connected with multiple devices through an RS485 bus, and the mixed connection communication method comprises the following steps: Step 1: the data collector acquires the serial port configuration parameters and communication protocols of each device, and generates a bus interface configuration file; Step 2: the data collector divides the multiple devices into n groups according to the serial port configuration parameters, wherein n is an integer greater than or equal to 1, the devices in the same group have the same serial port configuration parameters, and the serial port configuration parameters of the devices in different groups are different; Step 3: the data collector adjusts the serial port communication parameters of the data collector according to the serial port configuration parameters of one group of devices in the bus interface configuration file; Step 4: the data collector opens the serial port, and sequentially completes the acquisition operation of each device in the group according to the communication protocols of the devices in the group, sequentially sends an acquisition command to each device, and waits for receiving information; After the data collector sends the acquisition command to the device, if the waiting time for receiving information is exceeded, the data collector performs a timeout operation; For the serial port of a successfully acquired device, the time length for acquiring the device data is recorded; for the serial port of a device whose acquisition waiting time is exceeded, the device and the number of times of timeout are recorded; The data collector adjusts the data acquisition sequence of each group according to the average time length for acquiring the data of the devices in the group and whether there is a device whose acquisition waiting time is exceeded, and acquires the group with the shortest average time length and no timeout device first, and acquires the group with a timeout device last; Step 5: the data collector closes the serial port after completing the acquisition operation of the devices in the group; Step 6: the data collector repeats steps 3-5 until the acquisition operation of all groups of devices is completed.
2. The RS485-based hybrid communication method according to claim 1, characterized in that: The serial port configuration parameters comprise baud rate, data bits, check bits and stop bits.
3. The RS485-based hybrid communication method according to claim 1, characterized in that: The data collector acquires the serial port configuration parameters and communication protocols of each device through automatic identification or manual input.
4. The RS485-based hybrid communication method according to claim 1, characterized in that: When a new device is connected, the data collector terminates the ongoing acquisition operation, and starts the acquisition operation from step 1 again.
5. The RS485-based hybrid communication method according to claim 4, characterized in that: The data collector stores at least the grouping information of the last two times, and the latest grouping information automatically replaces the earliest grouping information each time the data collector performs grouping again; the data collector compares the latest grouping information with the previous grouping information, identifies the groups that have not changed and have been acquired, and after the data collector updates the bus interface configuration file, the data collector continues the acquisition cycle that is interrupted, and only acquires the data of the devices in the groups that have not been completed and the groups whose grouping information has changed.
6. The RS485-based hybrid communication method according to claim 1, characterized in that: If the data collector performs a timeout operation on the same device for m times, wherein m is an integer greater than or equal to 1, an alarm information is sent.
7. A data collector characterized by comprising: The data collector executes the RS485-based mixed connection communication method according to any one of claims 1-6.
8. The data collector of claim 7, wherein, It includes a processor and a Flash memory, a RAM memory and a RS485 interface connected with the processor respectively; the Flash memory is built-in with a grouping algorithm, a collection program and a database, and is also used for storing a bus interface configuration file, and data collected by the data collector is stored in the database; the processor groups multiple devices according to serial port configuration parameters of the devices through the grouping algorithm, and adjusts serial port communication parameters and opens / closes the serial port through the collection program; the RAM memory is used for data exchange with the processor; the RS485 interface is connected with the multiple devices through an RS485 bus.
9. The data collector of claim 8, wherein: It also includes an HMI device connected with the processor; the Flash memory is built-in with a Web server, and the data collector is connected with the Internet through the RS485 interface.
10. The data collector of claim 9, wherein: It also includes an RJ45 interface, and the data collector is connected with an upper computer through the RJ45 interface.
11. A hybrid communication system based on RS485, characterized in that, It includes the data collector of any one of claims 7-10, and also includes an upper computer connected with the data collector.
Citation Information
Patent Citations
Communication method for serial port and multiple running agreement stipulations
CN104283887A
Communication method, device and system
CN112491505A