Based on can-modbus to mqtt gateway and communication system

A CAN bus and gateway technology, applied in the field of CAN-ModBus to MQTT gateway and communication system, can solve the problems of difficult expansion deployment, single communication mode, bus data conflict, etc., to achieve the effect of convenient deployment and real-time communication

Active Publication Date: 2021-09-28
中安智联未来有限公司
View PDF12 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] However, for the ModBus protocol based on the field bus RS485, when multiple nodes communicate at the same time, it will cause data conflicts on the bus
Although the ModBus_TCP / IP protocol can realize Ethernet communication, its single communication mode makes it difficult to expand and deploy in a cross-network environment

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Based on can-modbus to mqtt gateway and communication system
  • Based on can-modbus to mqtt gateway and communication system
  • Based on can-modbus to mqtt gateway and communication system

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0044] A gateway based on CAN-ModBus to MQTT, see figure 1 ,include:

[0045] Multiple CAN interfaces: used to connect with external devices, receive data encapsulated in CAN protocol format from external devices through the CAN bus, and convert the data into ModBus pending data encapsulated in ModBus protocol format; also used to convert ModBus The encapsulated data is converted into data encapsulated in the CAN protocol format and sent to the external device;

[0046] Specifically, see figure 2 , CAN interface completes the conversion between CAN protocol format and ModBus protocol format. Two CAN interfaces can be set, for example figure 1 shown in CAN1 and CAN2. The gateway serves as the host terminal of the ModBus protocol, and the external device serves as the slave terminal of the ModBus protocol. The external devices are referred to as peripherals for short in the drawings. The external device may be a device supporting the CAN-ModBus protocol, for example, a har...

Embodiment 2

[0055] Embodiment 2 On the basis of Embodiment 1, the following differences are added:

[0056] Since the CAN protocol can transmit valid data at most 8 bytes at a time, the length of valid data sent and received by the gateway through the CAN bus cannot exceed 8 bytes, while the ModBus protocol has no limit on the data length. This creates length inequalities between the protocols.

[0057] For this reason, in the gateway, the CAN interface is specifically used for:

[0058] Create a one-way circular linked list, the node space size of the one-way circular linked list is 8 bytes;

[0059] Specifically, the number of nodes in the one-way circular linked list is configurable, the number ranges from 1 to 10, and the default number is 1. The size of the node space is 8 bytes, so that each node just stores the longest valid data that CAN protocol can transmit at one time.

[0060] When multiple data packets are received through the CAN bus, judge the start packet, intermediate ...

Embodiment 3

[0068] Embodiment 3 On the basis of other embodiments, the following content is added:

[0069] see image 3 , the ModBus protocol unit is specifically used for:

[0070] The ModBus protocol unit analyzes the ModBus data to be processed to obtain the register address;

[0071] Converting the register address and the data stored in the register address into character strings, splicing with "&" as a separator, and separating the data stored in each register address with commas to obtain the MQTT package data;

[0072] Send the MQTT encapsulated data to the MQTT proxy server through a message publishing mechanism.

[0073] Specifically, the gateway, as the ModBus host, needs to save the register address of the requested data, and then convert the register address and the corresponding data into a string after parsing the received register data, using "&" as the separator , stitched together. For example, "512&10" means that the data content of the register whose address is 51...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

Based on the CAN-ModBus-to-MQTT gateway provided by the present invention, the CAN interface receives or sends data from external devices through the CAN bus, and completes the conversion between the CAN protocol format and the ModBus protocol format. The ModBus protocol unit completes the conversion between the ModBus protocol format and the MQTT protocol format, and receives or sends data to the MQTT proxy server. The gateway combines the advantages of CAN bus and MQTT to meet the real-time communication requirements. The CAN bus can effectively deal with the conflict of bus data when multiple nodes communicate at the same time. MQTT can realize instant data communication through the subscription and publishing message mechanism, and it is easy to deploy in a cross-network environment.

Description

technical field [0001] The invention belongs to the technical fields of industrial automatic control, building intelligent control, etc., and specifically relates to a CAN-ModBus-based MQTT gateway and a communication system. Background technique [0002] In modern industrial engineering, computers play an increasingly important role in the field of control. Various instruments, meters and microcomputer systems in industrial control provide communication protocols with computers, thus providing great convenience for the design of computer control systems. . [0003] Modbus is a serial communication protocol. The Modbus protocol has become the industry standard for communication protocols in the industrial field, and it is also a common connection method between industrial electronic devices. Modbus is more widely used than other communication protocols because of its advantages of being open and copyright-free, easy to deploy and maintain, and without many restrictions on ...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Patents(China)
IPC IPC(8): H04L12/40H04L12/66
CPCH04L12/40097H04L12/66H04L2012/40215H04L2012/40228H04L2212/00
Inventor 马锦宝李志刚
Owner 中安智联未来有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products