Modbus multi-slave data acquisition and control method and system based on address mapping
By using an address mapping strategy, data acquisition and control of multiple slave devices in the Modbus protocol are realized, solving the problem of centralized acquisition and control of multiple devices in the existing technology and improving the efficiency of data acquisition and control.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUAN HUADIAN TIANREN CONTROL EQUIP CO LTD
- Filing Date
- 2023-11-09
- Publication Date
- 2026-07-10
AI Technical Summary
The Modbus protocol has limitations in multi-device data acquisition and control operations, and cannot meet the needs of upper-level monitoring systems for centralized acquisition and simultaneous control of multiple devices.
A Modbus multi-slave data acquisition and control method based on address mapping is adopted. By mapping the register addresses of slave devices, data acquisition and control operations of multiple devices can be realized, including acquisition address mapping and control address mapping, and bidirectional communication is supported.
It enables efficient data acquisition and control of multiple Modbus protocol devices, breaking through the limitation that a single message can only target a single device, and meeting the needs of centralized acquisition and control of multiple devices.
Smart Images

Figure CN117544442B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of data acquisition and control of Modbus protocol devices, and relates to a Modbus multi-slave data acquisition and control method and system based on address mapping. Background Technology
[0002] As industrial control shifts from stand-alone control to distributed control, the need for centralized data acquisition and control of remote terminal devices is becoming increasingly urgent, and new requirements are being placed on industrial controllers and various remote terminal devices connecting to the industrial control network.
[0003] Modbus's frame format is simple, compact, and easy to understand, and it supports a variety of electrical interfaces. As one of the most commonly used network protocols for modern industrial controllers, Modbus has gradually become a mainstream communication protocol for communication between industrial controllers and peripheral devices. To meet data acquisition and control needs, various data acquisition devices with different functions have been launched on the market, providing data acquisition and control services for Modbus protocol devices.
[0004] Due to the inherent characteristics of the Modbus protocol, a single Modbus message can only perform reading and control operations on one device, and the control operations must be performed on consecutive addresses. These characteristics limit the use of the Modbus protocol for multi-device data acquisition and control functions, and it cannot meet the needs of upper-level monitoring systems for centralized data acquisition and simultaneous control operations on multiple devices.
[0005] Prior art document 1 (CN 104407983 A, application publication date 2015.03.11) discloses a Modbus address remapping method for a power module. Prior art document 1 only involves data acquisition and is a one-way mapping. It can only read data from non-contiguous addresses but cannot perform write operations on non-contiguous address data. In contrast, the present invention relates to bidirectional address mapping for acquisition and control. It can both read and control non-contiguous address data, and meets the requirement of centralized control of multiple slave devices with a single message under certain operating conditions. Summary of the Invention
[0006] To address the shortcomings of existing technologies, this invention provides a Modbus multi-slave data acquisition and control method based on an address mapping strategy, applicable to communication between multiple Modbus protocol devices and a host computer device. Furthermore, through address mapping, the host computer device can perform data acquisition and control operations on multiple slave devices, and meets the requirement of centralized control of multiple slave devices using a single message under certain operating conditions.
[0007] The present invention adopts the following technical solution.
[0008] This invention provides a Modbus multi-slave data acquisition and control method based on address mapping. The method is used for communication between multiple Modbus protocol devices and a host computer device. The communication is bidirectional and includes acquisition and control operations.
[0009] The data acquisition operation includes: First, the acquisition address mapping is performed. The group register addresses of each slave device are mapped sequentially to the central register address on the central register side according to the device number order. The host computer issues acquisition instructions to the central register device. The acquisition instructions include the acquisition function code and the acquisition central register address. The host computer reads the data of the group registers of each slave device in the central register address. Each slave device register includes four registers numbered 1, 2, 3, and 4.
[0010] The control operation includes: first, mapping the control address; then, the host computer sends control instructions to the centralized register device. The control instructions include the control function code, the control centralized register address, and the control value. The centralized register decomposes the control instructions and maps them to the specific slave device number and slave control address according to the control centralized register address. Finally, the control instructions of each slave are decomposed and the control operation is completed.
[0011] Furthermore, multiple Modbus protocol devices are arranged sequentially by device number. Each Modbus protocol device is configured with a unique device number, and the information of the first configured device station number will be placed in the device numbered 1.
[0012] Furthermore, during two-way communication, the priority of the control command is higher than that of the acquisition command.
[0013] Furthermore, address mapping refers to the mapping from the slave device register address to the central register address. Address mapping strategies include acquisition address mapping and lower control address mapping.
[0014] Furthermore, the acquisition address mapping is accomplished by four centralized registers numbered 1, 2, 3, and 4 respectively;
[0015] The lower control address mapping is accomplished by two centralized registers numbered 1 and 3.
[0016] Furthermore, the function code is used to indicate the purpose of a Modbus information frame. When the master device sends information to the slave device, the function code will tell the slave device what actions need to be performed.
[0017] Furthermore, the centralized registers 1 and 3 corresponding to the acquisition address mapping are the same as those corresponding to the downstream control address mapping. However, the centralized register address ranges used by the acquisition address mapping and the downstream control address mapping are different.
[0018] Furthermore, slave device register 1 stores slave device coil variable data, slave device register 2 stores slave discrete variable data, slave device register 3 stores holding register variable data, and slave device register 4 stores input register variable data.
[0019] Furthermore, during address mapping, the data in the slave device registers is grouped according to data type and the user's grouping request, and then mapped to the corresponding central register.
[0020] Furthermore, during address mapping, the starting address and the number of requests for each group in the slave device register determine the address range of the slave device's data mapping to the central register. On the central register side, the address following the end address of each group is the starting address of the next group, and the address mapping is performed one by one according to the device number order.
[0021] Furthermore, the lower control address mapping process includes mapping two-dimensional information, namely the slave device station number and the slave lower control register address, to three-dimensional information, namely the central register lower control address, the slave device station number, and the slave lower control register address.
[0022] Furthermore, the lower control address in the centralized register during the lower control address mapping process is a continuous address segment, occupying a certain address range of centralized registers 1 and 3 respectively. This address range cannot be reused with the address range of the acquisition address mapping.
[0023] Furthermore, during the lower control address mapping process, each lower control address in the centralized register corresponds to a set of slave device information, and the slave device information includes the slave device station number and the slave lower control address.
[0024] Furthermore, the requirements for controlling the address differ between controlling a single slave device individually and controlling multiple slave devices simultaneously in a centralized manner.
[0025] Furthermore, the difference lies in the following: if only a single slave device needs to be controlled, the slave device information can be placed at any position in the control address of the centralized register; if multiple slave devices need to be controlled simultaneously, the information of the multiple slave devices must be placed in consecutive positions in the control address of the centralized register.
[0026] This invention also provides a Modbus multi-slave data acquisition and control system based on address mapping, which is the system used in the aforementioned Modbus multi-slave data acquisition and control method based on address mapping.
[0027] The system includes Modbus slave station equipment, acquisition parameter configuration module, acquisition module, Modbus master station, lower control module and lower control parameter configuration module;
[0028] Modbus slave devices are used to receive data acquisition and control commands, and the acquired data is stored in the Modbus slave devices.
[0029] The parameter acquisition configuration module includes information such as register address, address mapping, and centralized register address, which is used to complete the address mapping from register to centralized register;
[0030] The acquisition module includes acquisition instructions, which are used to perform acquisition operations according to the acquisition function code and the address of the acquisition set register;
[0031] The Modbus master station is used to collect data from the slave stations and to control the slave stations.
[0032] The lower control module includes lower control instructions, which are used to perform lower control operations according to the lower control function code and the lower control centralized register address;
[0033] The down-control parameter configuration module includes the central register address, address mapping, slave device station number, and slave device register address information, which are used for down-control instruction decomposition and mapping the down-control central register address to the specific slave device station number and slave down-control address.
[0034] The beneficial effects of this invention are that, compared with the prior art,
[0035] 1. Provide a Modbus multi-slave data acquisition and control method and system based on address mapping. This method can be extended to all industrial scenarios involving Modbus protocol acquisition and control.
[0036] 2. By using an address mapping strategy, the limitation of the Modbus protocol itself, where a single message is only for a single device and the downstream control message is only for continuous address operations of a single device, is overcome.
[0037] 3. This method can improve the efficiency of Modbus protocol master station in data acquisition and control of multiple slave devices, and meet the needs of protocol master station to perform centralized acquisition and simultaneous control operations on multiple devices. Attached Figure Description
[0038] Figure 1 This is a schematic flowchart of the Modbus multi-slave data acquisition and control method and system based on address mapping, as described in this application.
[0039] Figure 2 This application presents a flowchart of the Modbus multi-slave data acquisition and control method and system based on address mapping.
[0040] Figure 3 This is a flowchart of the acquisition and control strategy of the Modbus multi-slave data acquisition and control method and system based on address mapping in this application. Detailed Implementation
[0041] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of this invention. The embodiments described in this application are merely some embodiments of this invention, and not all embodiments. Based on the spirit of this invention, other embodiments obtained by those skilled in the art without creative effort are all within the protection scope of this invention.
[0042] A Modbus multi-slave data acquisition and control method and system based on address mapping is described. The method is applicable to communication between multiple Modbus protocol devices and a host computer. The communication is bidirectional, including the host computer acquiring data from multiple slave devices and sending control commands from the host computer to the multiple slave devices. The control commands include those that can control a single slave device individually, and those that can control multiple slave devices simultaneously in a centralized manner. The communication is implemented based on an address mapping strategy.
[0043] The present invention further includes the following:
[0044] A Modbus multi-slave data acquisition and control method and system based on address mapping, characterized in that the method is used for communication between multiple Modbus protocol devices and a host computer device, the communication being bidirectional and including acquisition operations and control operations.
[0045] The data acquisition operation includes: first, mapping the acquisition address, where the register addresses of each slave device group are mapped sequentially to the centralized register address on the centralized register side according to the device number order; the host computer sends acquisition instructions to each slave device, which include the acquisition function code and the centralized register address; and finally, the host computer reads the data from the registers of each slave device by reading the centralized register address, thereby realizing the centralized acquisition of data from multiple slave devices.
[0046] like Figure 2 As shown, the control operation includes: first, mapping the control address; then, the host computer sends the control instruction, which includes the control function code, the control central register address, and the control value. The control instruction is decomposed, and the control address is mapped to the specific slave device station number and slave control address. Finally, the control instruction decomposition and control operation of each slave station are completed, thereby realizing centralized control of multiple slave devices.
[0047] Preferably, during bidirectional communication, the priority of the control command is higher than that of the acquisition command.
[0048] Preferably, the Modbus slave station arrangement method is as follows: multiple Modbus protocol devices are arranged sequentially by device number, and the information of the device station number configured first is placed in the device numbered 1. Each Modbus protocol device is configured with a unique device number.
[0049] Preferably, the function code is used to indicate the purpose of a Modbus information frame, such as function code 01 for reading coil status, 02 for reading input status, etc. When the master device sends information to the slave device, the function code will tell the slave device what actions need to be performed. For example, reading the input switch status, reading the data content of a set of registers, etc.
[0050] Preferably, the address mapping refers to the mapping from the slave device register address to the central register address, and the address mapping strategy includes acquisition address mapping and lower control address mapping.
[0051] Preferred, such as Figure 3 As shown, the address mapping strategy includes: the acquisition address mapping is completed by four centralized registers numbered 1, 2, 3, and 4. The downstream control address mapping is completed by two centralized registers numbered 1 and 3. The centralized registers 1 and 3 corresponding to the acquisition address mapping are the same as the centralized registers 1 and 3 corresponding to the downstream control address mapping.
[0052] The centralized register address ranges used for acquisition address mapping and lower control address mapping are different.
[0053] The slave device registers store the following data: Slave device register 1 stores slave device coil variable data, slave device register 2 stores slave discrete variable data, slave device register 3 stores holding register variable data, and slave device register 4 stores input register variable data. The data types stored in the lumped registers are the same as those stored in the slave device registers.
[0054] During address mapping, the data in the slave device registers is grouped and mapped to the corresponding centralized registers according to the data type and the user's grouping request.
[0055] The starting address and the number of requests for each group in the slave device register determine the address range of the slave device's data mapping to the central register. On the central register side, the address following the end address of each group is the starting address of the next group, and the address mapping is done one by one according to the device number order.
[0056] Preferably, the control command includes: performing a control operation on a single slave device individually, or performing a centralized control operation on multiple slave devices simultaneously.
[0057] The difference is:
[0058] If only a single slave device needs to be controlled, the slave device information can be placed at any location in the control address of the centralized register; if multiple slave devices need to be controlled simultaneously, the information of the multiple slave devices must be placed in consecutive locations in the address of the centralized register.
[0059] Preferably, the lower control address mapping includes mapping two-dimensional information of slave device station number and slave lower control register address to three-dimensional information including central register lower control address, slave device station number and slave lower control register address.
[0060] The lower control address of the centralized register is a continuous address range, which occupies a certain address range of centralized registers 1 and 3 respectively. This address range cannot be reused with the address range mapped to the acquisition address.
[0061] Each centralized register's lower control address corresponds to a set of slave device information, and the slave device information includes the slave device station number and the slave lower control address.
[0062] like Figure 1 As shown, this application discloses a Modbus multi-slave data acquisition and control method and system based on address mapping. The method is applicable to communication between multiple Modbus protocol devices and a host computer device. The communication is bidirectional, including the host computer acquiring data from multiple slave devices and sending control commands to the multiple slave devices. The control commands include those that can control a single slave device individually, and those that can control multiple slave devices simultaneously in a centralized manner. The communication is implemented based on an address mapping strategy.
[0063] A Modbus multi-slave data acquisition and control method and system based on address mapping, wherein the method is implemented by the following technical solutions:
[0064] 1. Multiple Modbus protocol devices are arranged sequentially by device number.
[0065] In this embodiment, the device arrangement method for content 1 is as follows:
[0066] During data acquisition and control, the information of the first configured device station number is placed in the device numbered 1. Each Modbus protocol device is configured with a unique device number. This embodiment uses two slave devices as an example: slave device 1 has a device station number of 8, and slave device 2 has a device station number of 3. The configuration information shown in Table 1 is generated according to the configuration order.
[0067] Table 1 Configuration Information
[0068] Equipment Name Equipment Number Equipment station number Slave device 1 1 8 Slave device 2 2 3
[0069] 2. During two-way communication, the priority of the control command is higher than that of the acquisition command.
[0070] In this embodiment, a control flag is used to determine whether the control command has been completed. If the control flag is true, it indicates that the control is currently in a control state and data collection is not possible. If the control flag is false, it indicates that the control has been completed and data collection can proceed. The initial value of the control flag is false.
[0071] 3. Address mapping refers to the mapping from the slave device register address to the central register address. Address mapping includes acquisition address mapping and lower control address mapping.
[0072] In the embodiments, such as Figure 3 As shown, the specific process of address mapping is as follows:
[0073] (1) Each slave device has four registers to store different types of data variables. Slave device register 1 stores slave device coil variable data, slave device register 2 stores slave discrete variable data, slave device register 3 stores holding register variable data, and slave device register 4 stores input register variable data.
[0074] In this embodiment, register 3 of the slave device is used as an example to illustrate the address mapping for data acquisition. The address mapping method for the other registers is similar. Specifically, data is acquired from registers 1, 2, 3, and 4 of the slave device using function codes 16#01, 16#02, 16#03, and 16#04, respectively.
[0075] (2) During address mapping, the data in the slave device registers is grouped and mapped to the corresponding centralized registers according to the data type and the user's grouping requests. In this embodiment, slave device 1 has 3 groups of data in register 3, and slave device 2 has 2 groups of data in register 3, as shown in Table 2. The starting address and the number of requests for each group in the slave device registers determine the address range of the slave device's data mapped to the centralized register. On the centralized register side, the address following the end address of each group is the starting address of the next group. The address mapping is performed one by one according to the device number order.
[0076] Table 2. Data Acquisition Mapping Information from Slave Station Equipment
[0077]
[0078] In this embodiment, the specific process of lower-control address mapping is as follows:
[0079] (1) The lower control address mapping process includes mapping two-dimensional information of slave device station number and slave lower control register address to three-dimensional information including central register lower control address, slave device station number and slave lower control register address.
[0080] The lower control address in the centralized register during the lower control address mapping process is a continuous address, occupying a certain address range of centralized registers 1 and 3 respectively. This address range cannot be reused with the address range of the acquisition address mapping.
[0081] In this embodiment, register 3 of the slave device is used as an example to illustrate the lower control address mapping. The method for mapping the lower control addresses of the other registers is similar. Specifically, to control register 1 of the slave device, function codes 16#05 and 16#0F can be used, and to control register 3 of the slave device, function codes 16#06 and 16#10 can be used.
[0082] In this embodiment, the centralized register 3 collects a continuous address from 0 to 30000, and the lower control address is a continuous address starting from 30010.
[0083] Each set of centralized register lower control addresses corresponds to a set of slave device information, and the slave device information includes the slave device station number and the slave lower control address. For example, the lower control address 30010 of centralized register 3 corresponds to slave device 1, and the slave device information with slave station number 8 and lower control address 60 is slave device information.
[0084] Table 3 Lower Control Address Mapping Information Table
[0085]
[0086] (2) When mapping the lower control address, the requirements for mapping the lower control address differ between performing a lower control operation on a single slave device and performing a centralized lower control operation on multiple slave devices simultaneously.
[0087] The difference is as follows: if only a single slave device needs to be controlled, the slave device information can be placed at any location in the control address of the centralized register; if multiple slave devices need to be controlled simultaneously, the information of the multiple slave devices must be placed in consecutive locations in the control address of the centralized register.
[0088] In the embodiment, as shown in Table 3, 16#10 is used to perform centralized control operations on multiple slave device registers 3, using the five consecutive addresses of centralized registers 30010, 30011, 30012, 30013, and 30014.
[0089] The process of controlling slave devices includes: the control instruction includes the control function code, the control central register address, and the control value. The control address is mapped to the specific slave device station number and slave control address, and finally the control instruction of each slave station is decomposed.
[0090] In this embodiment, function code 16#10 is used for down-control, with the down-control starting address being 30010 and the number of down-control commands being 5 (i.e., down-control centralized register addresses are 30010, 30011, 30012, 30013, and 30014), and the 5 down-control values being 100, 200, 300, 400, and 500. The address of the centralized register and the down-control value can be obtained from the down-control instructions. Using the address mapping relationship in Table 3, the down-control instructions are decomposed and formed into down-control instructions for each slave device, thus enabling unified down-control operations on discontinuous addresses between device 1 and device 2 using a single message. The down-control instructions are shown in Table 4.
[0091] Table 4 Lower Control Command Table
[0092]
[0093] This invention also provides a Modbus multi-slave data acquisition and control system based on address mapping, which is the system used in the aforementioned Modbus multi-slave data acquisition and control method based on address mapping.
[0094] The system includes Modbus slave station equipment, acquisition parameter configuration module, acquisition module, Modbus master station, lower control module and lower control parameter configuration module;
[0095] Modbus slave devices are used to receive data acquisition and control commands, and the acquired data is stored in the Modbus slave devices.
[0096] The parameter acquisition configuration module includes information such as register address, address mapping, and centralized register address, which is used to complete the address mapping from register to centralized register;
[0097] The acquisition module includes acquisition instructions, which are used to perform acquisition operations according to the acquisition function code and the address of the acquisition set register;
[0098] The Modbus master station is used to collect data from the slave stations and to control the slave stations.
[0099] The lower control module includes lower control instructions, which are used to perform lower control operations according to the lower control function code and the lower control centralized register address;
[0100] The down-control parameter configuration module includes the central register address, address mapping, slave device station number, and slave device register address information, which are used for down-control instruction decomposition and mapping the down-control central register address to the specific slave device station number and slave down-control address.
[0101] The beneficial effects of this invention are that, compared with the prior art,
[0102] 1. Provide a Modbus multi-slave data acquisition and control method and system based on address mapping. This method and system can be extended to all industrial scenarios involving Modbus protocol acquisition and control.
[0103] 2. By address mapping, the limitation of the Modbus protocol itself, where a single message is only for a single device and the downstream control message is only for continuous address operations of a single device, is overcome.
[0104] 3. By adopting this method and system, the efficiency of Modbus protocol master station in data acquisition and control of multiple slave devices can be improved, meeting the needs of protocol master station to perform centralized acquisition and simultaneous control operations on multiple devices.
[0105] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the protection scope of the claims of the present invention.
Claims
1. A Modbus multi-slave data acquisition and control method based on address mapping, wherein the method is used for communication between multiple Modbus protocol devices and a host computer device, the communication is bidirectional, including acquisition operations and control operations, characterized in that... The data acquisition operation includes: First, data acquisition address mapping is performed. The group register addresses of each slave device are mapped sequentially to the centralized register address on the centralized register side according to the device number order. The host computer issues acquisition commands to the centralized register device. The acquisition command includes the acquisition function code and the acquisition centralized register address. The host computer reads the data from the group registers of each slave device in the centralized register address. Each slave device register includes four registers numbered 1, 2, 3, and 4. The data acquisition address mapping is completed by the four centralized registers numbered 1, 2, 3, and 4. The control operation includes: first, controlling address mapping is performed; then, the host computer sends control instructions to the centralized register device. The control instructions include the control function code, the control centralized register address, and the control value. The centralized register decomposes the control instructions and maps them to the specific slave device number and slave control address according to the control centralized register address, thus completing the control instruction decomposition and control operation for each slave. The control address mapping is completed by two centralized registers numbered 1 and 3. The centralized registers 1 and 3 corresponding to the acquisition address mapping are the same as those corresponding to the control address mapping, but the centralized register address ranges used for acquisition address mapping and control address mapping are different.
2. The Modbus multi-slave data acquisition and control method based on address mapping according to claim 1, characterized in that: Multiple Modbus protocol devices are arranged sequentially by device number. Each Modbus protocol device is configured with a unique device number, and the information of the first configured device station number will be placed in the device numbered 1.
3. The Modbus multi-slave data acquisition and control method based on address mapping according to claim 1, characterized in that: During two-way communication, the priority of the control command is higher than that of the acquisition command.
4. The Modbus multi-slave data acquisition and control method based on address mapping according to claim 1, characterized in that: Address mapping refers to the mapping from the address of a slave device register to the address of a central register. Address mapping strategies include acquisition address mapping and lower control address mapping.
5. The Modbus multi-slave data acquisition and control method based on address mapping according to claim 1, characterized in that: The function code is used to indicate the purpose of a Modbus information frame. When the master device sends information to the slave device, the function code indicates the action that the slave device needs to perform.
6. The Modbus multi-slave data acquisition and control method based on address mapping according to claim 4, characterized in that: Slave device register 1 stores slave device coil variable data, slave device register 2 stores slave discrete variable data, slave device register 3 stores hold register variable data, and slave device register 4 stores input register variable data.
7. The Modbus multi-slave data acquisition and control method based on address mapping according to claim 6, characterized in that: During address mapping, the data in the slave device registers is grouped according to the data type and the user's grouping request, and then mapped to the corresponding central register.
8. The Modbus multi-slave data acquisition and control method based on address mapping according to claim 7, characterized in that: During address mapping, the starting address and the number of requests for each group in the slave device register determine the address range of the slave device's data to be mapped to the central register. On the central register side, the address following the end address of each group is the starting address of the next group, and the address mapping is performed one by one according to the device number order.
9. The Modbus multi-slave data acquisition and control method based on address mapping according to claim 4, characterized in that: The lower control address mapping process involves mapping two-dimensional information, namely the slave device station number and the slave lower control register address, to three-dimensional information, namely the central register lower control address, the slave device station number, and the slave lower control register address.
10. The Modbus multi-slave data acquisition and control method based on address mapping according to claim 1, characterized in that: The lower control address in the centralized register during the lower control address mapping process is a continuous address, occupying a certain address range of centralized registers 1 and 3 respectively. This address range cannot be reused with the address range of the acquisition address mapping.
11. The Modbus multi-slave data acquisition and control method based on address mapping according to claim 10, characterized in that: During the lower control address mapping process, each lower control address in the centralized register corresponds to a set of slave device information, and the slave device information includes the slave device station number and the slave lower control address.
12. The Modbus multi-slave data acquisition and control method based on address mapping according to claim 11, characterized in that: The requirements for controlling the address differ between controlling a single slave device individually and controlling multiple slave devices simultaneously.
13. The Modbus multi-slave data acquisition and control method based on address mapping according to claim 12, characterized in that: The difference is that if only a single slave device needs to be controlled, the slave device information can be placed at any position in the control address of the centralized register; if multiple slave devices need to be controlled simultaneously, the information of the multiple slave devices must be placed in consecutive positions in the control address of the centralized register.
14. A Modbus multi-slave data acquisition and control system based on address mapping, wherein the system is the system used in the Modbus multi-slave data acquisition and control method based on address mapping described in claims 1-13, characterized in that: The system includes Modbus slave station equipment, acquisition parameter configuration module, acquisition module, Modbus master station, lower control module and lower control parameter configuration module; Modbus slave devices are used to receive data acquisition and control commands, and the acquired data is stored in the Modbus slave devices. The parameter acquisition configuration module includes register address, address mapping, and centralized register address information, which is used to complete the address mapping from register to centralized register; The acquisition module includes acquisition instructions, which are used to perform acquisition operations according to the acquisition function code and the address of the acquisition set register; The Modbus master station is used to collect data from the slave stations and to control the slave stations. The lower control module includes lower control instructions, which are used to perform lower control operations according to the lower control function code and the lower control centralized register address; The down-control parameter configuration module includes the central register address, address mapping, slave device station number, and slave device register address information, which are used for down-control instruction decomposition and mapping the down-control central register address to the specific slave device station number and slave down-control address.