Modbus TCP master and slave station configuration method and system based on BLVDS bus

By generating and transmitting configuration data between the host computer and the PLC controller, the problem of incompatibility between the BLVDS bus and the ModbusTCP master and slave communication is solved, and flexible configuration and access to the ModbusTCP device is achieved, improving the compatibility and reliability of the system.

CN120050342AActive Publication Date: 2025-05-27ZHEJIANG UNIV +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510141809.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-08
Publication Date
2025-05-27
Estimated Expiration
2045-02-08

AI Technical Summary

Technical Problem

In the prior art, communication between the BLVDS bus and the ModbusTCP master and slave station is incompatible, resulting in the inability to directly realize the connection between the BLVDS bus and the ModbusTCP device, and thus it is difficult to access and control the ModbusTCP slave station equipment.

Method used

By generating configuration data in the upper computer, transmitting it to the PLC controller, and transmitting it to the ModbusTCP communication device through the BLVDS bus, updating the master-slave mode configuration and network parameters and communication parameters of the internal ModbusTCP device is realized.

Benefits of technology

It realizes communication compatibility between the BLVDS bus and the ModbusTCP master and slave station, allowing users to flexibly configure and access ModbusTCP devices through the BLVDS bus, improving the flexibility and reliability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120050342A_ABST
    Figure CN120050342A_ABST
Patent Text Reader

Abstract

The invention provides a Modbus TCP master-slave station configuration method and system based on a BLVDS bus, and the method comprises the steps: S1, generating configuration data for internal Modbus TCP equipment in an upper computer, and transmitting the configuration data to a PLC controller through an Ethernet communication link; s2, the PLC transmits the configuration data to a Modbus TCP communication device through a BLVDS bus, and the Modbus TCP communication device configures internal Modbus TCP equipment to be in a master station mode or a slave station mode; s3, in the master station mode, the upper computer sends a control instruction to the external Modbus TCP slave station equipment by using the internal Modbus TCP master station equipment, and receives response data returned by the external Modbus TCP slave station equipment; and in the slave station mode, the PLC drives the internal Modbus TCP slave station device to work based on a control instruction sent by the external Modbus TCP master station device and received by the internal Modbus TCP slave station device, and returns response data to the external Modbus TCP master station device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of industrial control, and particularly relates to a Modbus TCP master-slave configuration method and system based on a BLVDS bus. Background Art

[0002] BLVDS (Bus Low-Voltage Differential Signaling) is a low-voltage differential signaling technology. In the field of industrial control, the BLVDS bus can be used to connect various control devices, such as sensors, actuators, controllers, etc., to achieve reliable data communication. Moreover, it allows multiple devices to share the same pair of differential lines, thereby reducing the required wiring quantity and system complexity. At the same time, due to its differential signal characteristics, BLVDS provides high noise immunity and low electromagnetic interference.

[0003] The Modbus TCP protocol is an extended version of the Modbus protocol, designed specifically for TCP / IP networks, aiming to achieve communication between programmable logic controllers (PLCs), and further to achieve communication with a host computer through a standard Ethernet infrastructure. In a Modbus TCP network, a master station and several slave stations can be set. The master station can implement the access control function for several slave stations.

[0004] However, in the prior art, due to the compatibility problem between the BLVDS bus and the Modbus TCP master-slave stations, the two cannot directly communicate, that is, the connection between the BLVDS bus and Modbus TCP devices cannot be directly achieved. Therefore, it is difficult to access and control various Modbus TCP slave devices through the BLVDS bus, resulting in limited development of the fieldbus control system. Summary of the Invention

[0005] The present invention aims to provide a Modbus TCP master-slave configuration method and system based on a BLVDS bus to solve the technical problems that in the prior art, the communication between the BLVDS bus and the Modbus TCP master-slave stations is incompatible, and the function configuration operation of the Modbus TCP master-slave stations is inconvenient.

[0006] To solve the above problems, the technical solution of the present invention is: A Modbus TCP master-slave configuration method based on a BLVDS bus, comprising the following steps: S1: Generate configuration data for internal Modbus TCP devices in a host computer, and transmit the configuration data to a PLC controller through an Ethernet communication link; S2: The PLC controller transmits the configuration data to the Modbus TCP communication device via the BLVDS bus. The Modbus TCP communication device configures the internal Modbus TCP device as the master mode or the slave mode based on the configuration data. S3: In the master mode, the host computer uses the internal Modbus TCP master device to send control instructions to the external Modbus TCP slave device and receives the response data sent back by the external Modbus TCP slave device. In the slave mode, the PLC controller drives the internal Modbus TCP slave device to operate based on the control instructions sent by the external Modbus TCP master device received by the internal Modbus TCP slave device, and sends the response data back to the external Modbus TCP master.

[0007] Preferably, in S2, the Modbus TCP communication device receives the configuration data sent by the host computer via the PLC controller, which specifically includes the following steps: S21: The Modbus TCP communication device receives and stores the configuration data, parses the configuration data, converts the configuration data format of the BLVDS protocol standard into the Modbus TCP protocol standard, and updates and adjusts the master-slave mode of the internal Modbus TCP device and the network configuration parameters and communication configuration parameters of the internal and external Modbus TCP devices according to the parsed and converted configuration data.

[0008] Preferably, in the master mode of S3, the host computer uses the internal Modbus TCP master device to send control instructions to the external Modbus TCP slave device and receives the response data sent back by the external Modbus TCP slave device, which specifically includes the following steps: S31: The host computer generates control instructions, transmits them to the Modbus TCP communication device via the PLC controller. The Modbus TCP communication device parses the control instructions, converts the control instruction format of the BLVDS protocol standard into the Modbus TCP protocol standard, and sends the parsed and converted control instructions to the internal Modbus TCP master device, and the internal Modbus TCP master device sends control instructions to several external Modbus TCP slave devices. S32: The internal Modbus TCP master device receives the response data sent back by several external Modbus TCP slave devices and transmits it to the Modbus TCP communication device. The Modbus TCP communication device parses the response data, converts the response data format of the Modbus TCP protocol standard into the BLVDS protocol standard, and sends the parsed and converted response data to the PLC controller and the host computer.

[0009] Preferably, in the slave mode of S3, the PLC controller uses the internal ModbusTCP slave device to receive the control instructions sent by the external ModbusTCP master device and send back response data to the external ModbusTCP master. Specifically, it includes the following steps: S33: A number of internal ModbusTCP slave devices receive the control instructions sent by the external ModbusTCP master device and transmit them to the ModbusTCP communication device. The ModbusTCP communication device parses the control instructions, converts the control instruction format of the ModbusTCP protocol standard into the BLVDS protocol standard, and sends the parsed and converted control instructions to the PLC controller. The PLC controller generates secondary control instructions based on the external control instructions to control the operation of the internal ModbusTCP slave devices; S34: The PLC controller generates response data based on the operation actions of the internal ModbusTCP slave devices and transmits it to the ModbusTCP communication device. The ModbusTCP communication device parses the response data, converts the control instruction format of the BLVDS protocol standard into the ModbusTCP protocol standard, and sends the parsed and converted response data to the internal ModbusTCP slave devices, and the internal ModbusTCP slave devices send the response data to the external ModbusTCP master device.

[0010] Preferably, in the master mode, the control instructions output by the internal ModbusTCP master device are associated and mapped with the output register area of the PLC controller, and the response data received by the internal ModbusTCP master device is associated and mapped with the input register area of the PLC controller; In the slave mode, the secondary control instructions received by the internal ModbusTCP slave device are associated and mapped with the output register area of the PLC controller, and the response data output by the internal ModbusTCP slave device is associated and mapped with the input register area of the PLC controller.

[0011] Preferably, in the master mode, the configuration data generated by the host computer includes register partition configuration data for a number of external ModbusTCP slave devices, and the control instructions sent by the internal ModbusTCP master device to the external ModbusTCP slave devices are used to access the registers in specific partitions of the external ModbusTCP slave devices; In the slave mode, the configuration data generated by the host computer includes register custom partition configuration data for several internal Modbus TCP slave devices, and control instructions sent by an external Modbus TCP master device to the internal Modbus TCP slave device for accessing registers in a specific partition of the internal Modbus TCP slave device.

[0012] Preferably, in the master mode, the internal Modbus TCP master device sends control instructions to the external Modbus TCP slave device. If the time for waiting to receive response data sent back by the external Modbus TCP slave device times out, the internal Modbus TCP master device and the external Modbus TCP slave device attempt to reconnect. When the number of single reconnection attempts reaches the maximum limit, the internal Modbus TCP master device feeds back a disconnection alarm to the host computer.

[0013] Preferably, in S2, the PLC controller transmits the configuration data to the Modbus TCP communication device, and further includes the following steps: S22: The Modbus TCP communication device stores the configuration data in the Flash storage module. When no new configuration data for the internal Modbus TCP device is generated in the host computer, the Modbus TCP communication device can automatically configure the operation mode and parameters of the internal Modbus TCP device based on the original configuration data after power-on and power-off.

[0014] Based on the same concept, the present invention also provides a Modbus TCP master-slave configuration system based on the BLVDS bus for executing the Modbus TCP master-slave configuration method based on the BLVDS bus as described in any one of the above, including: A host computer for setting and monitoring the operation status of the internal Modbus TCP device; A Modbus TCP communication device for configuring the operation mode and parameters of the internal Modbus TCP device; A PLC controller for realizing data exchange between the host computer and the Modbus TCP communication device; An internal Modbus TCP device having a master mode and a slave mode. The internal Modbus TCP master device is used to communicate with several external Modbus TCP slave devices, and several internal Modbus TCP slave devices are used to communicate with an external Modbus TCP master device.

[0015] Preferably, the Modbus TCP communication device includes: The BLVDS bus configuration information transceiver module is used to receive configuration data from the PLC controller and send it to the internal ModbusTCP device; The BLVDS bus communication information transceiver module is used to receive internal control instructions or response data from the PLC controller and send them to the internal ModbusTCP device, or receive external control instructions or response data from the internal ModbusTCP device and send them to the PLC controller; The parsing and conversion module is used to parse and convert the data between the BLVDS protocol standard and the ModbusTCP protocol standard; The Flash storage module is used to store configuration data, backup control instructions and response data.

[0016] Due to the adoption of the above technical solutions, the present invention has the following advantages and positive effects compared with the prior art: The present invention provides a ModbusTCP master-slave configuration method and system based on the BLVDS bus, which is provided with a host computer, a PLC controller, a ModbusTCP communication device and an internal ModbusTCP device. The configuration data generated by the host computer is subjected to protocol conversion through the ModbusTCP communication device and is used to configure the internal ModbusTCP device as the master mode or the slave mode. In the master mode, the control instructions generated by the host computer can be sent to the external ModbusTCP slave device in the ModbusTCP network through the internal ModbusTCP master device. Similarly, in the slave mode, the internal ModbusTCP slave device can receive the control instructions sent by the external ModbusTCP master device, satisfying the data intercommunication function, thereby realizing the flexible and efficient configuration function of the internal ModbusTCP device and the communication compatibility function between the BLVDS bus and the ModbusTCP master-slave stations. Brief Description of the Drawings

[0017] Figure 1 The overall structural schematic diagram of a ModbusTCP master-slave configuration system based on the BLVDS bus provided by the present invention; Figure 2 The structural schematic diagram of the ModbusTCP communication device provided by the present invention. Detailed Embodiment

[0018] The following further details the ModbusTCP master-slave configuration method and system based on the BLVDS bus proposed by the present invention in conjunction with the accompanying drawings and specific embodiments. According to the following description and the claims, the advantages and features of the present invention will be clearer.

[0019] The First Embodiment Refer toFigure 1 - Figure 2 , this embodiment provides a Modbus TCP master-slave configuration method based on the BLVDS bus, which is used to implement the data communication function between the BLVDS bus and Modbus TCP master-slave devices. The specific steps are as follows: S1: Generate configuration data for the internal Modbus TCP device in the host computer, and transmit the configuration data to the PLC controller through the Ethernet communication link.

[0020] S2: The PLC controller transmits the configuration data to the Modbus TCP communication device through the BLVDS bus. The Modbus TCP communication device configures the internal Modbus TCP device as the master mode or slave mode based on the configuration data, and configures the network parameters and communication parameters of the internal Modbus TCP device.

[0021] S3: In the master mode, the host computer generates a control instruction, and a local communication link is formed from the host computer, the PLC controller, the Modbus TCP communication device to the internal Modbus TCP master device. The host computer uses the internal Modbus TCP master device to send an internal control instruction to the external Modbus TCP slave device and receive the external response data sent back by the external Modbus TCP slave device; in the slave mode, the internal Modbus TCP slave device can receive the external control instruction sent by the external Modbus TCP master device. The PLC controller drives the internal Modbus TCP slave device to operate, execute corresponding actions, and send internal response data to the external Modbus TCP master.

[0022] In summary, this embodiment provides a Modbus TCP master-slave configuration method based on the BLVDS bus, which realizes a highly flexible and integrated Modbus TCP communication method, allows users to conveniently generate and manage the configuration data of the internal Modbus TCP device through the host computer, supports the internal Modbus TCP device to switch between the master mode and the slave mode to adapt to different application scenario requirements, and at the same time integrates various communication means such as Ethernet and BLVDS bus to build a stable and reliable local and remote communication link, ensuring the accurate issuance of control instructions and the timely acquisition of response data, and solving the problem of communication incompatibility between the BLVDS bus and Modbus TCP master-slave.

[0023] Next, the specific implementation steps and functions of a Modbus TCP master-slave configuration method based on the BLVDS bus provided in this embodiment will be further described in detail: Preferably, in this embodiment, in S2, the ModbusTCP communication device receives the configuration data sent by the host computer via the PLC controller, which specifically includes the following steps: S21: The PLC controller sends the configuration data to the ModbusTCP communication device through the BLVDS bus. The BLVDS bus configuration information transceiver module receives the configuration data and stores it in the Flash storage module. The parsing and conversion module parses and processes the configuration data, converts the configuration data format of the BLVDS protocol standard into the ModbusTCP protocol standard. Subsequently, the BLVDS bus configuration information transceiver module sends the parsed and converted configuration data to the ModbusTCP configuration module. The ModbusTCP configuration module adjusts the master-slave mode of the internal ModbusTCP devices connected to it through ModbusTCP bus communication, and updates and adjusts the network configuration parameters and communication configuration parameters of the internal and external ModbusTCP devices.

[0024] Among them, in the master station mode, in addition to the master station switching instruction, the configuration parameters set in the host computer also include network configuration parameters such as the IP address, subnet mask, default gateway, and MAC address of the internal ModbusTCP master station device, the address, IP address, and port number of the external ModbusTCP slave station device that communicates with the internal ModbusTCP master station device, as well as communication configuration parameters such as access function codes, the addresses and quantities of read / write registers, and the cycle period.

[0025] In the slave station mode, in addition to the slave station switching instruction, the configuration parameters set in the host computer also include the address, IP address, and port number of the internal ModbusTCP slave station device, as well as the device register partition, including the lengths and starting positions of coils, discrete inputs, holding registers, and input registers.

[0026] After the configuration parameters are completed, variable names need to be given to generate the corresponding variable point table for assigning values and observing variable data values. After completing the custom configuration and generating the variable table content, the host computer can download the configuration data to the PLC controller in the form of a file.

[0027] Preferably, in this embodiment, in S3, in the master station mode, the host computer uses the internal ModbusTCP master station device to send control instructions to the external ModbusTCP slave station device and receives the response data sent back by the external ModbusTCP slave station device, which specifically includes the following steps: S31: The host computer generates a control instruction. In this step, the control instruction is intended to control an external Modbus TCP slave device to perform corresponding operations. The control instruction is transmitted to the Modbus TCP communication device via the PLC controller. The BLVDS bus communication information transceiver module receives the control instruction, and the parsing and conversion module parses and processes the control instruction, converting the control instruction format of the BLVDS protocol standard into the Modbus TCP protocol standard. Subsequently, the BLVDS bus communication information transceiver module sends the parsed and converted control instruction to the Modbus TCP data transceiver module, and the Modbus TCP data transceiver module further sends the control instruction to the internal Modbus TCP master device via the Modbus TCP bus communication. Finally, the internal Modbus TCP master device sends the internal control instruction to several external Modbus TCP slave devices communicatively connected thereto.

[0028] In this embodiment, there may be multiple groups of Modbus TCP slave devices, that is, a single Modbus TCP master device can simultaneously communicate with multiple groups of Modbus TCP slave devices.

[0029] S32: The internal Modbus TCP master device can receive the external response data sent back by several external Modbus TCP slave devices communicatively connected thereto in real time. The internal Modbus TCP master device sends the response data to the Modbus TCP data transceiver module via the Modbus TCP bus communication. The Modbus TCP data transceiver module sends the response data to the parsing and conversion module, and the parsing and conversion module parses and processes the response data, converting the response data format of the Modbus TCP protocol standard into the BLVDS protocol standard. Subsequently, the BLVDS bus communication information transceiver module further sends the parsed and converted response data to the PLC controller and the host computer.

[0030] By alternately sending the control instruction and receiving the response data, the communication function between the internal Modbus TCP master device and the external Modbus TCP slave device is realized.

[0031] Further, in this embodiment, in the slave mode of S3, the PLC controller uses the internal Modbus TCP slave device to receive the control instruction sent by the external Modbus TCP master device and send back the response data to the external Modbus TCP master, which specifically includes the following steps: S33: A number of internal Modbus TCP slave devices receive external control instructions sent by an external Modbus TCP master device. The internal Modbus TCP slave devices send the external control instructions to the Modbus TCP data transceiver module through Modbus TCP bus communication. The Modbus TCP data transceiver module sends the external control instructions to the parsing and conversion module. The parsing and conversion module parses and processes the external control instructions, converts the external control instruction format of the Modbus TCP protocol standard into the BLVDS protocol standard, and then sends the parsed and converted external control instructions to the BLVDS bus communication information transceiver module. The BLVDS bus communication information transceiver module further sends the external control instructions to the PLC controller. The PLC controller generates a secondary control instruction for adjusting the actions of the internal Modbus TCP slave devices based on the external control instructions. Refer to step S31, and then uses the secondary control instruction to control the operation of the internal Modbus TCP slave devices; S34: After the internal Modbus TCP slave devices complete the corresponding actions, the PLC controller generates internal response data based on the operation actions of the internal Modbus TCP slave devices and transmits it to the Modbus TCP communication device. The BLVDS bus communication information transceiver module receives the response data. The parsing and conversion module parses and processes the response data, converts the control instruction format of the BLVDS protocol standard into the Modbus TCP protocol standard. Then the BLVDS bus communication information transceiver module sends the parsed and converted response data to the Modbus TCP data transceiver module. The Modbus TCP data transceiver module further sends the response data to the internal Modbus TCP slave devices through Modbus TCP bus communication. Finally, the internal Modbus TCP slave devices send the internal response data to the external Modbus TCP master device communicating with them.

[0032] By alternately receiving external control instructions and sending internal response data, the communication function between the internal Modbus TCP slave devices and the external Modbus TCP master device is realized.

[0033] Preferably, in an embodiment, in the master mode, the control instructions output by the internal Modbus TCP master device are associated and mapped with the output register area (Q area) of the PLC controller, and the response data received by the internal Modbus TCP master device is associated and mapped with the input register area (I area) of the PLC controller. In the slave mode, the secondary control instructions received by the internal Modbus TCP slave devices are associated and mapped with the output register area (Q area) of the PLC controller, and the response data output by the internal Modbus TCP slave devices is associated and mapped with the input register area (I area) of the PLC controller.

[0034] Therefore, in this embodiment, the output register area (Q area) and the input register area (I area) of the PLC controller are associated and mapped with the data areas (such as coils, holding registers, discrete inputs, input registers) in the Modbus TCP protocol, enabling developers to more intuitively understand the data flow and ensuring the consistency between the data inside the PLC controller and the data transmitted and received by the internal Modbus TCP master-slave devices, thus improving the reliability of data transmission.

[0035] Preferably, in this embodiment, in the master mode, the configuration data generated by the upper computer includes register partition configuration data for several external Modbus TCP slave devices, and the control instructions sent by the internal Modbus TCP master device to the external Modbus TCP slave devices can be used to access the registers in specific partitions of the external Modbus TCP slave devices. In the slave mode, the configuration data generated by the upper computer includes register custom partition configuration data for several internal Modbus TCP slave devices, and the control instructions sent by the external Modbus TCP master device to the internal Modbus TCP slave devices can be used to access the registers in specific partitions of the internal Modbus TCP slave devices.

[0036] Therefore, in this embodiment, in the master mode, through the clear register partition configuration of the external Modbus TCP slave devices, the internal Modbus TCP master device can accurately access specific registers in the external Modbus TCP slave devices, improving the efficiency and accuracy of data access, reducing unnecessary data transmission, lowering the network load, and enhancing the performance of the overall system. In the slave mode, users are allowed to customize the register partitions for the internal Modbus TCP slave devices according to actual application requirements. On the premise of improving the efficiency of external data access, by precisely configuring the usage and access permissions of each register, finer-grained control capabilities are provided, enhancing the security and reliability of the system.

[0037] Preferably, in this embodiment, in the master mode, when the internal Modbus TCP master device sends a control instruction to the external Modbus TCP slave device and the time for waiting to receive the response data sent back by the external Modbus TCP slave device times out, the internal Modbus TCP master device and the external Modbus TCP slave device attempt to reconnect. When the number of reconnection attempts within a single cycle reaches the maximum limit, the internal Modbus TCP master device sends a disconnection alarm to the upper computer.

[0038] That is, in this embodiment, in the master station mode, the generated configuration data includes the connection timeout and response timeout between the internal ModbusTCP master device and the external ModbusTCP slave device, sets the timeout mechanism and the functions of reconnection attempts and disconnection alarm feedback. The communication connection can automatically restore the connection in case of a short network interruption or temporary unavailability of the external ModbusTCP slave device, reducing the need for manual intervention and improving the robustness and reliability of the communication connection.

[0039] Preferably, in this embodiment, in S2, the PLC controller transmits the configuration data to the ModbusTCP communication device, which further includes the following steps: S22: The ModbusTCP communication device stores the configuration data in the Flash storage module. When no new configuration data for the internal ModbusTCP device is generated in the upper computer, the ModbusTCP communication device can automatically configure the operation mode and parameters of the internal ModbusTCP device based on the original configuration data after power-on and power-off.

[0040] That is, in this embodiment, as a non-volatile memory, the Flash memory can retain data even after the device is powered off. After the ModbusTCP communication device is powered on again, it can be initialized and configured immediately according to the original configuration data stored in the Flash, without having to download the configuration file from the upper computer and the PLC controller again, reducing the startup time and potential configuration errors, and improving the availability and continuity of the system.

[0041] In summary, this embodiment provides a ModbusTCP master-slave configuration method based on the BLVDS bus, which solves the compatibility problem between the BLVDS bus and the ModbusTCP master-slave devices, expands the application of the Modbus bus in industrial buses, gives users better freedom in use, and allows them to configure the master or slave function of the ModbusTCP device according to their own needs, with good flexibility and convenience in operation, effectively promoting the efficient development of the fieldbus control system.

[0042] Second Embodiment Based on the same concept, the present invention also provides a ModbusTCP master-slave configuration system based on the BLVDS bus, which is used to execute the ModbusTCP master-slave configuration method based on the BLVDS bus described in any one of the first embodiments, and includes: The host computer is used to set and monitor the operation status of the internal ModbusTCP device, including providing configuration data to configure the master-slave mode of the internal ModbusTCP device, outputting control instructions to enable the internal ModbusTCP device to access external ModbusTCP devices externally, and simultaneously monitoring and obtaining the external response data received by the internal ModbusTCP device and its own executed actions.

[0043] The ModbusTCP communication device is used to directly configure the operation mode and parameters of the internal ModbusTCP device, including the master-slave mode configuration, network configuration, and communication configuration of the internal ModbusTCP device.

[0044] The PLC controller is used to realize the data exchange between the host computer and the ModbusTCP communication device.

[0045] The internal ModbusTCP device is provided with a master mode and a slave mode. The internal ModbusTCP master device is used to communicate with several external ModbusTCP slave devices, and several internal ModbusTCP slave devices are used to communicate with external ModbusTCP master devices.

[0046] In this embodiment, configuration data for the internal ModbusTCP device can be generated in the host computer. The configuration data is transmitted to the PLC controller through an Ethernet communication link. The PLC controller transmits the configuration data to the ModbusTCP communication device through the BLVDS bus. The ModbusTCP communication device configures the internal ModbusTCP device as the master mode or the slave mode based on the configuration data, and sets the network parameters and communication parameters of the internal ModbusTCP device. In the master mode, the host computer uses the internal ModbusTCP master device to send control instructions to the external ModbusTCP slave device and receives the response data sent back by the external ModbusTCP slave device. In the slave mode, the PLC controller drives the internal ModbusTCP slave device to operate based on the control instructions received by the internal ModbusTCP slave device from the external ModbusTCP master device and sends back the response data to the external ModbusTCP master. Thus, a local connection link is established with the internal ModbusTCP device through the BLVDS bus, and the communication and access functions with the external ModbusTCP device are realized.

[0047] Preferably, in this embodiment, the ModbusTCP communication device further includes: The BLVDS bus configuration information transceiver module is used to receive configuration data from the PLC controller and send it to the internal ModbusTCP device to realize the transmission function of the configuration data.

[0048] The BLVDS bus communication information transceiver module is used to receive internal control instructions or response data from the PLC controller and send them to the internal ModbusTCP device, or receive external control instructions or response data from the internal ModbusTCP device and send them to the PLC controller, so as to realize the bidirectional transmission function of control instructions and response data.

[0049] The parsing and conversion module is used to parse and convert the data of the BLVDS protocol standard and the ModbusTCP protocol standard to realize the protocol conversion function.

[0050] The Flash storage module is used to store configuration data, backup control instructions and response data.

[0051] And the ModbusTCP configuration module is used to adjust the master-slave mode of the internal ModbusTCP device connected to it through ModbusTCP bus communication, and update and adjust the network configuration parameters and communication configuration parameters of the internal and external ModbusTCP devices.

[0052] The ModbusTCP data transceiver module is used to receive the internal control instructions and response data sent by the BLVDS bus communication information transceiver module, and send them to the internal ModbusTCP device connected to it through ModbusTCP bus communication, or obtain the external control instructions and response data received by the internal ModbusTCP device connected to it and send them to the BLVDS bus communication information transceiver module.

[0053] The embodiments of the present invention have been described in detail above in conjunction with the accompanying drawings, but the present invention is not limited to the above embodiments. Even if various changes are made to the present invention, provided that these changes fall within the scope of the claims of the present invention and their equivalent technologies, they still fall within the protection scope of the present invention.

Claims

1. A ModbusTCP master-slave station configuration method based on BLVDS bus, characterized in that: The steps include: S1: Generate configuration data for internal ModbusTCP devices in the host computer, and transmit the configuration data to the PLC controller through the Ethernet communication link; S2: The PLC controller transmits the configuration data to the ModbusTCP communication device through the BLVDS bus, and the ModbusTCP communication device configures the internal ModbusTCP device to the master mode or the slave mode based on the configuration data; S3: In the master mode, the host computer uses the internal ModbusTCP master device to send control instructions to the external ModbusTCP slave device, and receives the response data returned by the external ModbusTCP slave device; In slave mode, the PLC controller drives the internal ModbusTCP slave device to operate based on the control instruction sent by the external ModbusTCP master device and received by the internal ModbusTCP slave device, and returns response data to the external ModbusTCP master device.

2. The ModbusTCP master-slave station configuration method based on BLVDS bus as claimed in claim 1, characterized in that, In S2, the ModbusTCP communication device receives the configuration data sent by the host computer via the PLC controller, which specifically includes the following steps: S21: The ModbusTCP communication device receives and stores configuration data, parses the configuration data, converts the configuration data format of the BLVDS protocol standard into the ModbusTCP protocol standard, and updates and adjusts the master-slave mode of the internal ModbusTCP device, and the network configuration parameters and communication configuration parameters of the internal and external ModbusTCP devices according to the parsed and converted configuration data.

3. The ModbusTCP master-slave station configuration method based on BLVDS bus as claimed in claim 1, characterized in that, In the master mode in S3, the host computer uses the internal ModbusTCP master device to send control instructions to the external ModbusTCP slave device, and receives the response data returned by the external ModbusTCP slave device, which specifically includes the following steps: S31: The host computer generates a control instruction, which is transmitted to the ModbusTCP communication device via the PLC controller. The ModbusTCP communication device parses the control instruction, converts the control instruction format of the BLVDS protocol standard into the ModbusTCP protocol standard, and sends the parsed and converted control instruction to the internal ModbusTCP master station device, which then sends the control instruction to a number of external ModbusTCP slave station devices. S32: The internal ModbusTCP master station device receives the response data returned by several external ModbusTCP slave station devices and transmits it to the ModbusTCP communication device. The ModbusTCP communication device parses the response data, converts the response data format of the ModbusTCP protocol standard into the BLVDS protocol standard, and sends the parsed and converted response data to the PLC controller and the host computer.

4. The ModbusTCP master-slave station configuration method based on BLVDS bus as claimed in claim 3, characterized in that, In the slave mode in S3, the PLC controller uses the internal ModbusTCP slave device to receive the control command sent by the external ModbusTCP master device, and returns the response data to the external ModbusTCP master, which specifically includes the following steps: S33: A number of internal ModbusTCP slave devices receive control instructions sent by an external ModbusTCP master device, and transmit them to the ModbusTCP communication device, the ModbusTCP communication device parses the control instructions, converts the control instruction format of the ModbusTCP protocol standard into the BLVDS protocol standard, and sends the parsed and converted control instructions to the PLC controller, the PLC controller generates secondary control instructions based on the external control instructions to control the operation of the internal ModbusTCP slave devices; S34: The PLC controller generates response data based on the running action of the internal ModbusTCP slave device and transmits it to the ModbusTCP communication device. The ModbusTCP communication device parses the response data, converts the control instruction format of the BLVDS protocol standard into the ModbusTCP protocol standard, and sends the parsed and converted response data to the internal ModbusTCP slave device, which then sends the response data to the external ModbusTCP master device.

5. The ModbusTCP master-slave station configuration method based on BLVDS bus as claimed in claim 4, characterized in that, In the master mode, the control instructions output by the internal ModbusTCP master device are associated and mapped with the output register area of ​​the PLC controller, and the response data received by the internal ModbusTCP master device is associated and mapped with the input register area of ​​the PLC controller; In slave mode, the secondary control instructions received by the internal ModbusTCP slave device are associated and mapped with the output register area of ​​the PLC controller, and the response data output by the internal ModbusTCP slave device is associated and mapped with the input register area of ​​the PLC controller.

6. The ModbusTCP master-slave station configuration method based on BLVDS bus as claimed in claim 1, characterized in that, In the master mode, the configuration data generated by the host computer includes register partition configuration data for several external ModbusTCP slave devices, and the control instructions sent by the internal ModbusTCP master device to the external ModbusTCP slave device are used to access the registers of specific partitions of the external ModbusTCP slave device; In slave mode, the configuration data generated by the host computer includes custom partition configuration data for registers of several internal ModbusTCP slave devices, and the control instructions sent by the external ModbusTCP master device to the internal ModbusTCP slave device are used to access the registers of specific partitions of the internal ModbusTCP slave device.

7. The ModbusTCP master-slave station configuration method based on BLVDS bus as claimed in claim 1, characterized in that, In the master station mode, the internal ModbusTCP master station device sends a control instruction to the external ModbusTCP slave station device. If the time for waiting to receive the response data returned by the external ModbusTCP slave station device times out, the internal ModbusTCP master station device and the external ModbusTCP slave station device attempt to reconnect. When the number of single reconnections reaches the maximum limit, the internal ModbusTCP master station device feeds back a disconnection alarm to the host computer.

8. The ModbusTCP master-slave station configuration method based on BLVDS bus as claimed in claim 1, characterized in that, In S2, the PLC controller transmits the configuration data to the ModbusTCP communication device, further comprising the following steps: S22: The ModbusTCP communication device stores the configuration data in the Flash storage module. When the host computer does not generate new configuration data for the internal ModbusTCP device, the ModbusTCP communication device can automatically configure the operation mode and parameters of the internal ModbusTCP device based on the original configuration data after powering on and off.

9. A ModbusTCP master-slave station configuration system based on BLVDS bus, characterized in that: The method for configuring a ModbusTCP master-slave station based on a BLVDS bus according to any one of claims 1 to 8 comprises: The host computer is used to set and monitor the operating status of internal ModbusTCP devices; ModbusTCP communication device, used to configure the operation mode and parameters of internal ModbusTCP devices; A PLC controller, used to realize data exchange between the host computer and the ModbusTCP communication device; The internal ModbusTCP device has a master mode and a slave mode. The internal ModbusTCP master device is used to realize data communication with several external ModbusTCP slave devices, and several internal ModbusTCP slave devices are used to realize data communication with external ModbusTCP master devices.

10. The ModbusTCP master-slave station configuration system based on BLVDS bus as claimed in claim 9, characterized in that: The ModbusTCP communication device comprises: A BLVDS bus configuration information transceiver module is used to receive configuration data from the PLC controller and send it to an internal ModbusTCP device; A BLVDS bus communication information transceiver module is used to receive internal control instructions or response data from the PLC controller and send it to an internal ModbusTCP device, or receive external control instructions or response data from an internal ModbusTCP device and send it to the PLC controller; Parsing and conversion module, used to parse and convert data of BLVDS protocol standard and ModbusTCP protocol standard; The Flash storage module is used to store configuration data and backup control instructions and response data.

Citation Information

Patent Citations

  • Communication management method for master station and slave station of Modbus device based on real-time database, and communication management system for master station and slave station of Modbus device based on real-time database

    CN104407591A

  • Method for processing multi-host data access by Modbus gateway

    CN116016017A

  • BLVDS bus-based configurable CANopen master station system and implementation method

    CN116980497A