A non-standard ModBus communication protocol custom development driver design method and system
By analyzing the key information in the non-standard ModBus communication protocol and designing custom driver configuration files, the compatibility problem between the non-standard ModBus protocol protection device and intelligent system in coal mines is solved, data interaction and multi-manufacturer communication are realized, and coal mines are improved. Safety and production efficiency.
Patent Information
- Application Number
- CN202211609833.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-12
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2042-12-12
AI Technical Summary
There are a large number of non-standard ModBus communication protocol protection devices in coal mines that cause data interaction problems and cannot be compatible with the intelligent auxiliary machinery system, affecting the implementation of safe production and reduced staff and efficiency improvement.
By obtaining the communication address, function code, starting address, data domain and verification code information in the non-standard ModBus communication protocol, design custom driver configuration files to achieve compatibility with the standard ModBus communication protocol, and ensure smooth data interaction.
It solves the compatibility problem between the non-standard ModBus protocol protection device and the intelligent system, realizes data interaction, reduces the cost of equipment replacement, and supports data interaction between communication main stations of multiple manufacturers.
Smart Images

Figure CN116132544B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of driver design, and in particular to a non-standard ModBus communication protocol custom development driver design method and system. Background Art
[0002] The development of comprehensive mechanization in coal mines in my country started in the late 1970s and early 1980s, and it was in the mid-1980s that comprehensive mechanization began to develop. Based on the continuous upgrading of comprehensive mechanization in coal mines, the concept of intelligent coal mines was proposed.
[0003] In the early stage of intelligence, the penetration rate of intelligent systems for auxiliary machinery in coal mines was low, and there was no relevant demand. People engaged in coal mining had no concept of intelligent systems for auxiliary machinery. When purchasing protection devices, they did not consider the need to access the intelligent system of auxiliary machinery for communication in the future. They only considered the use on the on-site switches, so the purchased protection devices would have many non-standard ModBus communication protocols. In this way, when the auxiliary machinery intelligent system needs to be accessed for communication in the future, there will be problems with access. In recent years, as the country attaches importance to the development trend of coal mine safety production, it requires coal mines to build intelligent systems for auxiliary machinery to achieve the effect of reducing staff and increasing efficiency. Relevant documents and subsidies have begun to be issued, and coal mines have begun to bid for the construction of intelligent systems for auxiliary machinery. Summary of the invention
[0004] The purpose of this section is to summarize some aspects of embodiments of the present invention and briefly introduce some preferred embodiments. Some simplifications or omissions may be made in this section and the specification abstract and the invention title of this application to avoid blurring the purpose of this section, the specification abstract and the invention title, and such simplifications or omissions cannot be used to limit the scope of the present invention.
[0005] In view of the above existing problems, the present invention is proposed.
[0006] Therefore, the present invention provides a non-standard ModBus communication protocol custom development driver design method and system, which can solve the problem that the existing protection devices in coal mines come from different manufacturers, and the protection devices use the non-standard MosBus communication protocol, which will cause mismatch in the communication protocol, resulting in the inability to realize data interaction and other problems.
[0007] In order to solve the above technical problems, the present invention provides the following technical solutions, a method for designing a custom development driver for a non-standard ModBus communication protocol, comprising:
[0008] Obtain a non-standard ModBus communication protocol of a coal mine protection device, and analyze the communication address, function code, start address, data field, and check code information in the communication protocol as a configuration file;
[0009] According to the configuration file combined with the non-standard protocol template, the return data of the non-standard ModBus communication protocol protection device is obtained;
[0010] After receiving the returned data, the non-standard ModBus custom driver transmits the data to the communication master station according to the rules, thereby realizing data interaction with the communication master station.
[0011] As a preferred solution of the non-standard ModBus communication protocol custom development driver design method described in the present invention, wherein: the configuration file includes:
[0012] The first transmission byte is used as a communication address storage byte, and the communication address is the device address of the protection device itself;
[0013] The second transmission byte is used as a function code storage byte, and the function code is an internal function code used by the non-standard ModBus communication protocol;
[0014] The third transmission byte and the fourth transmission byte are used as starting address storage bytes, and the starting address is the starting address of the data register of the non-standard ModBus communication protocol protection device;
[0015] The fifth transmission byte and the sixth transmission byte are used as data field storage bytes, and the data field is the number of data of the non-standard ModBus communication protocol protection device;
[0016] The seventh transmission byte and the eighth transmission byte are used as check code storage bytes, and the check code is used to verify whether the non-standard ModBus communication protocol protection device detects whether the data communication is correct.
[0017] As a preferred solution of the non-standard ModBus communication protocol custom development driver design method described in the present invention, it also includes:
[0018] Obtain non-standard communication protocols;
[0019] Design configuration files to communicate with protection devices;
[0020] The protection device receives a non-standard protocol template data request command;
[0021] After receiving the data request command, the protection device responds and pushes the protection device register values to the non-standard ModBus custom driver in sequence;
[0022] The non-standard ModBus custom driver passes the received values to the standard ModBus communication protocol channel through different channels in sequence.
[0023] As a preferred solution of the non-standard ModBus communication protocol custom development driver design method described in the present invention, wherein: the data request command includes:
[0024] The non-standard protocol template sends a data request command to the protection device, and obtains the value in the corresponding data register in the protection device according to different request commands;
[0025] When the non-standard protocol template issues the first data request, the protection device transmits the value of the first data register to the non-standard ModBus custom driver and occupies the first data position in the driver;
[0026] When the non-standard protocol template issues the Nth data request, the protection device passes the value of the Nth data register to the non-standard ModBus custom driver and occupies the Nth data position in the driver, where N is an integer greater than 1, and the value of N is determined by the number of requests initiated by the non-standard protocol template.
[0027] As a preferred solution of the non-standard ModBus communication protocol custom development driver design method described in the present invention, wherein: the different channels include:
[0028] After the non-standard ModBus custom driver receives the data pushed by the protection device, it transmits the data to the channel of the communication master station according to the data required by the communication master station;
[0029] Channel 1 is used to transmit the value of the first data register pushed by the protection device received by the non-standard ModBus custom driver to the communication master station, and the communication master station reads the value of channel 1 of the non-standard ModBus custom driver at the same time;
[0030] Channel N is used to transmit the value of the Nth data register pushed by the protection device received by the non-standard ModBus custom driver to the communication master station, and the communication master station reads the value of the non-standard ModBus custom driver channel N at the same time.
[0031] As a preferred solution of the non-standard ModBus communication protocol custom development driver design method described in the present invention, it also includes:
[0032] Before the design configuration file communicates with the protection device, the non-standard ModBus communication protocol performs format and data detection on the configuration file;
[0033] When the configuration file format satisfies the requirement of simultaneously including the communication address, function code, start address, data field and check code related data, and the corresponding byte values are all empty, the non-standard ModBus communication protocol connects the configuration file and the protection device; when the configuration file format does not meet the requirement, the configuration file is reconfigured.
[0034] As a preferred solution of the non-standard ModBus communication protocol custom development driver design method described in the present invention, it also includes:
[0035] When the protection device responds to return data, the non-standard ModBus communication protocol performs format and data detection on the returned data. When the configuration file format satisfies the requirement of simultaneously including the communication address, function code, start address, data field and check code related data, and the corresponding byte value meets the preset range, the non-standard ModBus communication protocol connects the configuration file with the protection device;
[0036] When the configuration file contains the communication address, function code, start address, data field and checksum related data at the same time, and the corresponding byte value does not meet the preset range, the non-standard protocol template is wrong. Reset the configuration file and reconnect the new non-standard protocol template through the non-standard ModBus custom driver;
[0037] When the corresponding byte value of the configuration file meets the preset range and does not contain the communication address, function code, start address, data field and check code related data at the same time, the protection device is restarted to re-acquire the corresponding data.
[0038] A non-standard ModBus communication protocol custom development driver design system, characterized in that: it includes an information acquisition module, an information processing module and an information transmission module,
[0039] An information acquisition module, wherein the information acquisition module acquires a non-standard ModBus communication protocol of a coal mine protection device, and analyzes the communication address, function code, start address, data field, and check code information in the communication protocol as a configuration file;
[0040] An information processing module, wherein the configuration file processing module obtains the return data of the non-standard ModBus communication protocol protection device according to the information combined with the non-standard protocol template;
[0041] The information transmission module, after receiving the returned data, the non-standard ModBus custom driver of the information transmission module transmits the data to the communication master station according to the rules to realize data interaction with the communication master station.
[0042] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and wherein the processor implements the steps of the above method when executing the computer program.
[0043] A computer-readable storage medium stores a computer program thereon, wherein the computer program implements the steps of the method described above when executed by a processor.
[0044] The beneficial effects of the present invention are as follows: the present invention proposes a method and system for designing a custom development driver for a non-standard ModBus communication protocol, and a non-standard ModBus communication protocol custom development driver configuration file. Compared with the existing standard ModBus driver, the user can configure it by himself according to the actual situation such as the internal function code of the non-standard ModBus communication protocol on site, so as to adapt to various non-standard ModBus communication protection devices on site. This solves the problem that data interaction cannot be achieved when the coal mine is integrating an auxiliary intelligent system because the protection device protocol adopts the non-standard ModBus communication protocol. Data interaction can be achieved by adopting a non-standard ModBus custom driver, which reduces the cost of replacing equipment and has good compatibility, and can interact with communication master stations of multiple manufacturers. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. Among them:
[0046] Figure 1 A method flow chart of a non-standard ModBus communication protocol custom development driver design method and system provided by an embodiment of the present invention;
[0047] Figure 2 An overall processing flow chart of the present invention for a non-standard ModBus communication protocol custom development driver design method and system provided by one embodiment of the present invention;
[0048] Figure 3 A format diagram of a configuration file of a non-standard ModBus communication protocol custom development driver design method and system provided by an embodiment of the present invention;
[0049] Figure 4 A non-standard ModBus communication protocol custom development drive design method and system for a protection device receiving a non-standard protocol template data request command diagram provided by an embodiment of the present invention;
[0050] Figure 5 A communication connection diagram between a non-standard ModBus custom driver and a standard ModBus communication protocol channel of a non-standard ModBus communication protocol custom development driver design method and system provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0051] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.
[0052] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0053] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive with other embodiments.
[0054] The present invention is described in detail with reference to schematic diagrams. When describing the embodiments of the present invention, for the sake of convenience, the cross-sectional diagrams showing the device structure will not be partially enlarged according to the general scale, and the schematic diagrams are only examples, which should not limit the scope of protection of the present invention. In addition, in actual production, the three-dimensional dimensions of length, width and depth should be included.
[0055] At the same time, in the description of the present invention, it should be noted that the directions or positional relationships indicated by the terms "upper, lower, inner and outer" are based on the directions or positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore cannot be understood as limiting the present invention. In addition, the terms "first, second or third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.
[0056] In the present invention, unless otherwise clearly specified and limited, the terms "install, connect, connect" should be understood in a broad sense, for example: it can be a fixed connection, a detachable connection or an integral connection; it can also be a mechanical connection, an electrical connection or a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0057] Example 1
[0058] Reference Figure 1-5, which is the first embodiment of the present invention, and provides a non-standard ModBus communication protocol custom development driver design method and system, including:
[0059] Step 102, obtaining a non-standard ModBus communication protocol of the coal mine protection device, analyzing the communication address, function code, start address, data field and check code information in the communication protocol as a configuration file;
[0060] The configuration file includes: a first transmission byte as a communication address storage byte, and the communication address is the device address of the protection device itself;
[0061] The second transmission byte is used as a function code storage byte, and the function code is an internal function code used by the non-standard ModBus communication protocol;
[0062] The third transmission byte and the fourth transmission byte are used as starting address storage bytes, and the starting address is the starting address of the data register of the non-standard ModBus communication protocol protection device;
[0063] The fifth transmission byte and the sixth transmission byte are used as data field storage bytes, and the data field is the number of data of the non-standard ModBus communication protocol protection device;
[0064] The seventh transmission byte and the eighth transmission byte are used as check code storage bytes, and the check code is used to verify whether the non-standard ModBus communication protocol protection device detects whether the data communication is correct.
[0065] It should be noted that the function code byte can be modified according to the internal function code used by the non-standard ModBus communication protocol of the protector. Different function codes call for different data types, including switch quantity, analog quantity, and control coil function codes.
[0066] Step 104, obtaining the return data of the non-standard ModBus communication protocol protection device according to the configuration file combined with the non-standard protocol template;
[0067] Specifically, obtain non-standard communication protocols;
[0068] Furthermore, the configuration file is designed to communicate with the protection device;
[0069] Furthermore, the protection device receives a non-standard protocol template data request command;
[0070] Furthermore, after receiving the data request command, the protection device responds and pushes the protection device register values to the non-standard ModBus custom driver in sequence;
[0071] Furthermore, the non-standard ModBus custom driver passes the received values to the standard ModBus communication protocol channel through different channels in sequence.
[0072] It should be noted that the data request command includes a non-standard protocol template sending a data request command to the protection device, and obtaining a value in a corresponding data register in the protection device according to different request commands;
[0073] Furthermore, when the non-standard protocol template issues a first data request, the protection device transmits the value of the first data register to the non-standard ModBus custom driver and occupies the first data position in the driver;
[0074] Furthermore, when the non-standard protocol template issues the Nth data request, the protection device passes the value of the Nth data register to the non-standard ModBus custom driver and occupies the Nth data position in the driver, where N is an integer greater than 1, and the value of N is determined by the number of requests initiated by the non-standard protocol template.
[0075] It should be noted that the different channels include the channel where the non-standard ModBus custom driver receives the data pushed by the protection device and transmits the data to the communication master station according to the data required by the communication master station;
[0076] Furthermore, channel 1 is used to transmit the value of the first data register pushed by the protection device received by the non-standard ModBus custom driver to the communication master station, and the communication master station reads the value of channel 1 of the non-standard ModBus custom driver at the same time;
[0077] Furthermore, channel N is used to transmit the value of the Nth data register pushed by the protection device received by the non-standard ModBus custom driver to the communication master station, and the communication master station reads the value of channel N of the non-standard ModBus custom driver.
[0078] Furthermore, before the design configuration file communicates with the protection device, the non-standard ModBus communication protocol performs format and data detection on the configuration file;
[0079] Furthermore, when the configuration file format satisfies the requirement of simultaneously including the communication address, function code, starting address, data field and check code related data, and the corresponding byte values are all empty, the non-standard ModBus communication protocol connects the configuration file and the protection device; when the configuration file format does not meet the requirement, the configuration file is reconfigured.
[0080] It should be noted that when the protection device responds to return data, the non-standard ModBus communication protocol performs format and data detection on the returned data. When the configuration file format satisfies the requirement of simultaneously including the communication address, function code, start address, data field and check code related data, and the corresponding byte value meets the preset range, the non-standard ModBus communication protocol connects the configuration file with the protection device.
[0081] It should be noted that when the configuration file contains the communication address, function code, start address, data field and checksum related data at the same time, and the corresponding byte value does not meet the preset range, the non-standard protocol template is wrong. Reset the configuration file and reconnect the new non-standard protocol template through the non-standard ModBus custom driver;
[0082] It should be noted that when the corresponding byte value of the configuration file meets the preset range and does not contain the communication address, function code, start address, data field and check code related data at the same time, the protection device is restarted at this time to re-acquire the corresponding data.
[0083] Step 106, after receiving the return data, the non-standard ModBus custom driver transmits the data to the communication master station according to the rules to realize data interaction with the communication master station.
[0084] A non-standard ModBus communication protocol custom development driver design system, characterized in that: it includes an information acquisition module, an information processing module and an information transmission module,
[0085] An information acquisition module, wherein the information acquisition module acquires a non-standard ModBus communication protocol of a coal mine protection device, and analyzes the communication address, function code, start address, data field, and check code information in the communication protocol as a configuration file;
[0086] An information processing module, wherein the information processing module obtains the return data of the non-standard ModBus communication protocol protection device according to the information combined with the non-standard protocol template;
[0087] The information transmission module, after receiving the returned data, the non-standard ModBus custom driver of the information transmission module transmits the data to the communication master station according to the rules to realize data interaction with the communication master station.
[0088] The above-mentioned unit modules may be embedded in or independent of a processor in a computer device in the form of hardware, or may be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to the above-mentioned modules.
[0089] In one embodiment, a computer device is provided, which may be a terminal. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, an operator network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a non-standard ModBus communication protocol custom development driver design method is implemented. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device may be a touch layer covered on the display screen, or a key, trackball or touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse, etc.
[0090] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0091] Obtain a non-standard ModBus communication protocol of a coal mine protection device, and analyze the communication address, function code, start address, data field, and check code information in the communication protocol as a configuration file;
[0092] According to the configuration file combined with the non-standard protocol template, the return data of the non-standard ModBus communication protocol protection device is obtained;
[0093] After receiving the returned data, the non-standard ModBus custom driver transmits the data to the communication master station according to the rules, thereby realizing data interaction with the communication master station.
[0094] Example 2
[0095] Reference Figure 1-5 , which is an embodiment of the present invention, provides a non-standard ModBus communication protocol custom development driver design method and system. In order to verify the beneficial effects of the present invention, scientific demonstration is carried out through comparative experiments.
[0096] Table 1 Distinguishing features between traditional technical means and the present invention application
[0097]
[0098]
[0099] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should be included in the scope of the claims of the present invention.
[0100] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of complete hardware embodiments, complete software embodiments, or embodiments in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code. The scheme in the embodiments of the present application can be implemented in various computer languages, for example, object-oriented programming language Java and literal scripting language JavaScript, etc.
[0101] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0102] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0103] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1A step that specifies a function in one or more boxes.
[0104] Although the preferred embodiments of the present application have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.
[0105] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A non-standard ModBus communication protocol custom development driver design method, characterized by: include, Obtain a non-standard ModBus communication protocol of a coal mine protection device, and analyze the communication address, function code, start address, data field, and check code information in the communication protocol as a configuration file; According to the configuration file and the non-standard ModBus communication protocol template, the return data of the non-standard ModBus communication protocol protection device is obtained; After receiving the returned data, the non-standard ModBus custom driver transmits the data to the communication master station according to the rules, thereby realizing data interaction with the communication master station; Obtain non-standard ModBus communication protocol; Design configuration files to communicate with protection devices; The protection device receives a non-standard ModBus communication protocol template data request command; After receiving the data request command, the protection device responds and pushes the protection device register values to the non-standard ModBus custom driver in sequence; The non-standard ModBus custom driver passes the received values to the standard ModBus communication protocol channel through different channels in sequence; The data request command includes: The non-standard ModBus communication protocol template sends a data request command to the protection device, and obtains the value in the corresponding data register in the protection device according to different request commands; When the non-standard ModBus communication protocol template issues the first data request, the protection device transmits the value of the first data register to the non-standard ModBus custom driver and occupies the first data position in the driver; When the non-standard ModBus communication protocol template issues the Nth data request, the protection device passes the value of the Nth data register to the non-standard ModBus custom driver and occupies the Nth data position in the driver, where N is an integer greater than 1, and the value of N is determined by the number of requests initiated by the non-standard ModBus communication protocol template.
2. The non-standard ModBus communication protocol custom development driver design method according to claim 1, characterized in that: The configuration file includes: The first transmission byte is used as a communication address storage byte, and the communication address is the device address of the protection device itself; The second transmission byte is used as a function code storage byte, and the function code is an internal function code used by the non-standard ModBus communication protocol; The third transmission byte and the fourth transmission byte are used as starting address storage bytes, and the starting address is the starting address of the data register of the non-standard ModBus communication protocol protection device; The fifth transmission byte and the sixth transmission byte are used as data field storage bytes, and the data field is the number of data of the non-standard ModBus communication protocol protection device; The seventh transmission byte and the eighth transmission byte are used as check code storage bytes, and the check code is used to verify whether the non-standard ModBus communication protocol protection device detects whether the data communication is correct.
3. The non-standard ModBus communication protocol custom development driver design method according to claim 1, characterized in that: The different channels include, After the non-standard ModBus custom driver receives the data pushed by the protection device, it transmits the data to the channel of the communication master station according to the data required by the communication master station; Channel 1 is used to transmit the value of the first data register pushed by the protection device received by the non-standard ModBus custom driver to the communication master station, and the communication master station reads the value of channel 1 of the non-standard ModBus custom driver at the same time; Channel N is used to transmit the value of the Nth data register pushed by the protection device received by the non-standard ModBus custom driver to the communication master station, and the communication master station reads the value of the non-standard ModBus custom driver channel N at the same time.
4. The non-standard ModBus communication protocol custom development driver design method as claimed in claim 3, characterized in that: Also includes, Before the design configuration file communicates with the protection device, the non-standard ModBus communication protocol performs format and data detection on the configuration file; When the configuration file format satisfies the requirement of simultaneously including the communication address, function code, start address, data field and check code related data, and the corresponding byte values are all empty, the non-standard ModBus communication protocol connects the configuration file and the protection device; when the configuration file format does not meet the requirement, the configuration file is reconfigured.
5. The non-standard ModBus communication protocol custom development driver design method as claimed in claim 4, characterized in that: Also includes, When the protection device responds to return data, the non-standard ModBus communication protocol performs format and data detection on the returned data. When the configuration file format satisfies the requirement of simultaneously including the communication address, function code, start address, data field and check code related data, and the corresponding byte value meets the preset range, the non-standard ModBus communication protocol connects the configuration file with the protection device; When the configuration file contains the communication address, function code, start address, data field and checksum related data at the same time, and the corresponding byte value does not meet the preset range, the non-standard ModBus communication protocol template is wrong. Reset the configuration file and reconnect the new non-standard ModBus communication protocol template through the non-standard ModBus custom driver; When the corresponding byte value of the configuration file meets the preset range and does not contain the communication address, function code, start address, data field and check code related data at the same time, the protection device is restarted to re-acquire the corresponding data.
6. A non-standard ModBus communication protocol custom development driver design system using the non-standard ModBus communication protocol custom development driver design method as claimed in claim 1, characterized in that: It includes information acquisition module, information processing module and information transmission module. An information acquisition module, wherein the information acquisition module acquires a non-standard ModBus communication protocol of a coal mine protection device, and analyzes the communication address, function code, start address, data field, and check code information in the communication protocol as a configuration file; An information processing module, wherein the information processing module obtains the return data of the non-standard ModBus communication protocol protection device according to the configuration file and the non-standard ModBus communication protocol template; The information transmission module, after receiving the returned data, the non-standard ModBus custom driver of the information transmission module transmits the data to the communication master station according to the rules to realize data interaction with the communication master station.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Industrial communication multi-protocol conversion system
CN114222009A
