[go: up one dir, main page]

CN1728703A - A protocol conversion method between Modbus and DeviceNet - Google Patents

A protocol conversion method between Modbus and DeviceNet Download PDF

Info

Publication number
CN1728703A
CN1728703A CN 200510027275 CN200510027275A CN1728703A CN 1728703 A CN1728703 A CN 1728703A CN 200510027275 CN200510027275 CN 200510027275 CN 200510027275 A CN200510027275 A CN 200510027275A CN 1728703 A CN1728703 A CN 1728703A
Authority
CN
China
Prior art keywords
devicenet
modbus
data
attribute
configuration file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN 200510027275
Other languages
Chinese (zh)
Other versions
CN100579114C (en
Inventor
费敏锐
付敬奇
王海宽
陈维刚
丁铁勇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
SHANGHAI UNIVERSITY
Original Assignee
SHANGHAI UNIVERSITY
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by SHANGHAI UNIVERSITY filed Critical SHANGHAI UNIVERSITY
Priority to CN200510027275A priority Critical patent/CN100579114C/en
Publication of CN1728703A publication Critical patent/CN1728703A/en
Application granted granted Critical
Publication of CN100579114C publication Critical patent/CN100579114C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Computer And Data Communications (AREA)
  • Communication Control (AREA)
  • Small-Scale Networks (AREA)

Abstract

本发明涉及一种Modbus与DeviceNet间的协议转换方法。它是采用Modbus总线通过RS485总线接口与微处理器连接,DeviceNet总线通过CAN收发器和控制器与微处理器连接,微处理器还连接EEPROM和数据、程序存储器,构建起协议转换硬件平台,并采用本发明提供的Modbus与DeviceNet间的协议转换模型,实现Modbus与DeviceNet间的协议转换,实现将Modbus设备以DeviceNet对象的形态,作为DeviceNet从站接入DeviceNet网络。

The invention relates to a protocol conversion method between Modbus and DeviceNet. It uses Modbus bus to connect with microprocessor through RS485 bus interface, DeviceNet bus connects to microprocessor through CAN transceiver and controller, and microprocessor also connects EEPROM and data and program memory to build a protocol conversion hardware platform, and The protocol conversion model between Modbus and DeviceNet provided by the present invention is adopted to realize the protocol conversion between Modbus and DeviceNet, and to realize that the Modbus device is connected to the DeviceNet network as a DeviceNet slave station in the form of a DeviceNet object.

Description

一种Modbus与DeviceNet间的协议转换方法A protocol conversion method between Modbus and DeviceNet

技术领域technical field

本发明涉及到两种工业通讯协议Modbus和DeviceNet之间的协议转换实现方法,尤其适用于Modbus设备接入DeviceNet网络的应用,属于现场总线控制技术领域。The invention relates to a method for implementing protocol conversion between two industrial communication protocols, Modbus and DeviceNet, and is especially suitable for the application of Modbus devices connected to the DeviceNet network, belonging to the field bus control technology field.

背景技术Background technique

鉴于现场总线标准多样化的现实,实际应用中的系统往往包含多种总线网络。为实现不同通讯协议的网络信息集成,开发通讯适配器,或称协议转换器成为现场总线控制技术领域的一大研究内容。In view of the fact that fieldbus standards are diversified, systems in practical applications often contain multiple bus networks. In order to realize the network information integration of different communication protocols, the development of communication adapters, or protocol converters, has become a major research content in the field of fieldbus control technology.

Modbus协议最初由Modicon公司开发出来,现在已经是工业领域全球最流行的通用工业标准协议之一。我国去年颁布国标GB/Z 19582.1-2004《基于Modbus协议的工业自动化网络规范》,并于2005-03-01起实施。The Modbus protocol was originally developed by Modicon, and it is now one of the most popular general industrial standard protocols in the world in the industrial field. Last year, my country promulgated the national standard GB/Z 19582.1-2004 "Industrial Automation Network Specification Based on Modbus Protocol" and implemented it from 2005-03-01.

Modbus通信使用主—从技术,即仅一个设备(主设备)能初始化传输(查询),其它设备(从设备)根据主设备查询提供的数据做出相应反应。主设备可单独和从设备通信,也能以广播方式和所有从设备通信。如果单独通信,从设备返回一个消息作为回应,如果是以广播方式查询的,则不作任何回应。Modbus communication uses master-slave technology, that is, only one device (master device) can initiate transmission (query), and other devices (slave devices) make corresponding responses according to the data provided by the master device query. The master device can communicate with the slave devices individually, and can also communicate with all slave devices in a broadcast manner. If it communicates alone, the slave device will return a message as a response, if it is inquired by broadcast, it will not make any response.

目前Modbus普遍采用标准RS-485通讯接口作为其物理层传送方式,通讯波特率1200BPS~57600BPS,主从半双工方式。At present, Modbus generally adopts the standard RS-485 communication interface as its physical layer transmission mode, the communication baud rate is 1200BPS~57600BPS, and the master-slave half-duplex mode.

DeviceNet现场总线协议是由Rockwell公司提出的基于Can的应用层协议,它明确定义了物理层、数据链路层和应用层的内容。在DeviceNet网络系统中,目前普遍采用协议规约的预定义主从连接方式,即网络中设备分为从站和主战(或扫描器)。主站能够进行点对点或广播方式通讯,而从站一般只能与主站进行通讯,从站间不能进行通讯。DeviceNet规定的通讯速率为125KBPS、250KBPS和500KBPS三种。The DeviceNet field bus protocol is a Can-based application layer protocol proposed by Rockwell Corporation, which clearly defines the contents of the physical layer, data link layer and application layer. In the DeviceNet network system, the pre-defined master-slave connection mode of the protocol specification is generally used at present, that is, the devices in the network are divided into slave stations and masters (or scanners). The master station can communicate in point-to-point or broadcast mode, while the slave station can only communicate with the master station generally, and the slave stations cannot communicate with each other. The communication rate stipulated by DeviceNet is 125KBPS, 250KBPS and 500KBPS three kinds.

由于Modbus现场总线接口的软硬件实现成本很低,目前在国内低压电器、DCS控制、仪器仪表等领域应用广泛。但是相对于DeviceNet来说,Modbus属于低速网络,并且其半双工的通讯模式在实时性要求比较高的应用中不能够满足要求。所以实际的多总线结构系统中,Modbus/DeviceNet现场总线协议转换装置可以以较低的成本实现通讯网络的升级,将原来具有Modbus通讯接口的设备接入DeviceNet网络。Because the hardware and software implementation cost of the Modbus field bus interface is very low, it is widely used in domestic low-voltage electrical appliances, DCS control, instrumentation and other fields. But compared to DeviceNet, Modbus is a low-speed network, and its half-duplex communication mode cannot meet the requirements in applications with relatively high real-time requirements. Therefore, in the actual multi-bus structure system, the Modbus/DeviceNet field bus protocol conversion device can realize the upgrade of the communication network at a lower cost, and connect the original equipment with the Modbus communication interface to the DeviceNet network.

国外国内现有Modbus/DeviceNet通讯适配器主要有如下几种:The existing foreign and domestic Modbus/DeviceNet communication adapters mainly include the following types:

■HMS公司的AnyBus-Communicator Serial To DeviceNet Gateway■AnyBus-Communicator Serial To DeviceNet Gateway of HMS

■Western Reserve Controls公司的WRC’s 1782-JD family of DeviceNet toserial Communications products■WRC’s 1782-JD family of DeviceNet toserial Communications products of Western Reserve Controls

■Real Time Automation公司的Serial Interface for DeviceNet OEMs■Serial Interface for DeviceNet OEMs from Real Time Automation

■Deutschmann Automation GmbH公司的UNIGATE RS232/485-DeviceNet■UNIGATE RS232/485-DeviceNet from Deutschmann Automation GmbH

这些协议转换装置都能够将符合Modbus的输入输出信息转为DeviceNet网络的输入输出信息,其功能特征为实现实时I/O数据在两种网络间的交换,属于通用I/O适配器。优点是可以将网络中的I/O数据打包集中交换,降低网络负载,提高系统通讯能力。These protocol conversion devices can convert the input and output information conforming to Modbus into the input and output information of the DeviceNet network. The advantage is that the I/O data in the network can be packaged and exchanged centrally, reducing network load and improving system communication capabilities.

但是,对大多数总线网络设备而言,与系统交换的信息不仅包含实时I/O数据,而且还有大量的配置参数、诊断信息等。采用通用I/O模式,只有将这些信息也作为I/O数据来处理,由于这些数据量大但无实时性要求,所以会造成网络通讯能力的巨大浪费;如果不传送或者有选择地传送少量数据,则会降低系统对设备的信息收集和控制能力。However, for most bus network devices, the information exchanged with the system not only includes real-time I/O data, but also a large number of configuration parameters and diagnostic information. Using the general I/O mode, the information can only be processed as I/O data. Since the data volume is large but has no real-time requirements, it will cause a huge waste of network communication capabilities; if it is not transmitted or selectively transmitted in a small amount data, it will reduce the information collection and control capabilities of the system on the device.

所以,在DeviceNet层次上构建Modbus设备或子网对象,是对新型协议转换器提出的要求。Therefore, constructing Modbus equipment or subnet objects on the DeviceNet level is a requirement for a new type of protocol converter.

发明内容Contents of the invention

本发明的目的在于提供一种Modbus与DeviceNet间的协议转换方法,实现将Modbus设备以DeviceNet对象的形态,作为DeviceNet从站接入DeviceNet网络。The purpose of the present invention is to provide a protocol conversion method between Modbus and DeviceNet, to realize that the Modbus device is connected to the DeviceNet network as a DeviceNet slave station in the form of a DeviceNet object.

为了达到上述目的,本发明采用下述技术方案:In order to achieve the above object, the present invention adopts following technical scheme:

一种Modbus与DeviceNet间的协议转换方法,其特征在于采用Modbus总线通过RS485总线接口与微处理器连接,DeviceNet总线通过CAN收发器和控制器与微处理器连接,微处理器还连接EEPROM和数据、程序存储器,构建起协议转换硬件平台,从而采用下述的Modbus与DeviceNet间协议转换模型,实现Modbus与DeviceNet间的协议转换:由配置口生成配置文件,然后微处理器程序从配置文件)提取单元属性,一方面生成Modbus主站的扫描列表,另一方面生成DeviceNet的路径配置,数据定义了DeviceNet应用对象的类号、实例号、属性数、属性号和组合对象、参数对象的连接路径值;由Modbus到DeviceNet的输入数据由Modbus网络按照扫描列表的配置被读入协议映射区,然后读到DeviceNet应用对象,送到DeviceNet网络;由DeviceNet到Modbus的输出数据由组合对象和参数对象送到命令转换器,由微处理器解释为协议映射区的命令区的命令,然后由命令所对应的非周期性扫描列表,发Modbus命令到Modbus网络,并更新协议映射区数据。A protocol conversion method between Modbus and DeviceNet is characterized in that the Modbus bus is connected with the microprocessor through the RS485 bus interface, the DeviceNet bus is connected with the microprocessor through a CAN transceiver and a controller, and the microprocessor is also connected with EEPROM and data , program memory, and build a protocol conversion hardware platform, thereby adopting the following protocol conversion model between Modbus and DeviceNet to realize the protocol conversion between Modbus and DeviceNet: the configuration file is generated by the configuration port, and then the microprocessor program is extracted from the configuration file) Unit attributes, on the one hand, generate the scan list of the Modbus master station, and on the other hand, generate the path configuration of DeviceNet. The data defines the class number, instance number, attribute number, attribute number, combination object, and parameter object connection path value of the DeviceNet application object ;The input data from Modbus to DeviceNet is read into the protocol mapping area by the Modbus network according to the configuration of the scan list, and then read into the DeviceNet application object, and sent to the DeviceNet network; the output data from DeviceNet to Modbus is sent to it by the combination object and parameter object The command converter is interpreted by the microprocessor as the commands in the command area of the protocol mapping area, and then sends Modbus commands to the Modbus network from the aperiodic scanning list corresponding to the commands, and updates the data in the protocol mapping area.

上述的协议转换的具体步骤如下:The specific steps of the above-mentioned protocol conversion are as follows:

①、配置文件保存于非易失性存储器EEPROM内,通过PC下载方式或程序烧录方式进行存储,文件内容的编辑由用户根据需要按照固定格式定义;①. The configuration file is stored in the non-volatile memory EEPROM, and stored by PC download or program burning. The editing of the file content is defined by the user according to the fixed format according to the needs;

②、根据配置文件初始化Modbus通讯口;②. Initialize the Modbus communication port according to the configuration file;

③、根据配置文件中DeviceNet设备信息初始化标识对象和DeviceNet对象相关信息;③. Initialize the identification object and DeviceNet object related information according to the DeviceNet device information in the configuration file;

④、根据配置文件单元属性的数量及单元数据字节数初始化协议映射区数据单元;由单元属性为周期性更新的数据单元产生Modbus周期性扫描列表,由单元属性为非周期性更新的数据单元产生Modbus非周期性扫描列表。扫描列表每项记录由单元号、Modbus节点地址、Modbus寄存器地址、功能码和数据大小组成。④. Initialize the data unit in the protocol mapping area according to the number of unit attributes in the configuration file and the number of unit data bytes; the Modbus periodic scan list is generated by the unit attribute as the data unit that is periodically updated, and the data unit that is not periodically updated by the unit attribute Generate Modbus aperiodic scan list. Each record in the scan list consists of unit number, Modbus node address, Modbus register address, function code and data size.

⑤、将协议映射区数据单元与DeviceNet应用对象实例属性一一对应,然后进行DeviceNet路径配置;将周期性更新的实例属性根据读写性质分别生成组合对象的输入实例属性和输出实例属性,将非周期性的更新的实例属性全部列入参数对象实例属性中;DeviceNet连接对象生产和消费路径配置为组合对象的输入实例数据属性项和输出实例数据属性项;⑤. Correspond the data units in the protocol mapping area with the instance attributes of the DeviceNet application object one by one, and then configure the DeviceNet path; generate the input instance attributes and output instance attributes of the combined object according to the periodically updated instance attributes according to the read and write properties. Periodically updated instance attributes are all listed in the parameter object instance attributes; DeviceNet connection object production and consumption paths are configured as input instance data attribute items and output instance data attribute items of combined objects;

⑥、根据DeviceNet应用对象实例属性对应的协议映射区数据单元属性,当DeviceNet有输出I/O数据或写输出参数时,将该操作转换为协议映射区命令区的命令信息;然后通过查询Modbus扫描列表,获取对应记录项,生成Modbus报文,响应正确后,更新协议映射区该单元数据。⑥. According to the protocol mapping area data unit attribute corresponding to the DeviceNet application object instance attribute, when DeviceNet has output I/O data or write output parameters, convert the operation into command information in the command area of the protocol mapping area; and then scan by querying Modbus List, get the corresponding record items, generate Modbus messages, and update the unit data in the protocol mapping area after the response is correct.

在上述的Modbus与DeviceNet间的协议转换模型中,所述的配置文件包含Modbus通讯口的通讯模式和波特率参数、DeviceNet设备信息和协议映射区单元属性;所述的单元属性包含Modbus地址、读写性质、是否周期性操作、单元字节数;所述的协议映射区包括数据区和命令区,数据区以单元为单位;命令区包含状态字、单元号和数据寄存器;所述的DeviceNet路径配置文件由单元属性生成,包括应用对象类号、组合对象实例属性列表、参数对象实例属性列表、连接对象实例路径;所述的Modbus扫描列表包括周期性扫描列表和非周期性扫描列表,由配置文件生成。DeviceNet输出命令转换用来执行DeviceNet设备的类3传输服务和I/O输出,将它们转换为协议映射区的命令区信息;构建所述的DeviceNet应用对象由用户的配置文件定义,其属性内容与协议映射区数据单元一一对应。In the protocol conversion model between above-mentioned Modbus and DeviceNet, described configuration file comprises the communication pattern of Modbus communication port and baud rate parameter, DeviceNet equipment information and protocol mapping area unit property; Described unit property comprises Modbus address, Read and write properties, whether to operate periodically, the number of units of bytes; the protocol mapping area includes a data area and a command area, and the data area is in units; the command area includes a status word, a unit number and a data register; the DeviceNet The path configuration file is generated by the unit attribute, including the application object class number, the combined object instance attribute list, the parameter object instance attribute list, and the connection object instance path; the Modbus scan list includes a periodic scan list and an aperiodic scan list, by The configuration file is generated. DeviceNet output command conversion is used to implement class 3 transmission services and I/O output of DeviceNet equipment, and convert them into command area information in the protocol mapping area; constructing the described DeviceNet application object is defined by the user's configuration file, and its attribute content is the same as There is a one-to-one correspondence between data units in the protocol mapping area.

根据上述的协议转换方法,可以将一个或多个Modbus从站直接转换为具有相同特征的一个或多个DeviceNet对象,从DeviceNet接口看,可完全视为一个完整的具体DeviceNet设备,而不仅仅是一些打包的I/O数据。According to the above-mentioned protocol conversion method, one or more Modbus slave stations can be directly converted into one or more DeviceNet objects with the same characteristics. From the perspective of the DeviceNet interface, it can be completely regarded as a complete specific DeviceNet device, not just Some packed I/O data.

本发明与现有技术相比较,具有如下显而易见的突出实质性特点和显著优点:本发明在构建Modbus与DeviceNet间协议转换的硬件平台上,提供了一种Modbus与DeviceNet间的协议转换模型,从而实现了Modbus与DeviceNet间的协议转换,实现将Modbus设备以DeviceNet对象的形态,作为DeviceNet从站接入DeviceNet网络。Compared with the prior art, the present invention has the following obvious outstanding substantive features and significant advantages: the present invention provides a protocol conversion model between Modbus and DeviceNet on the hardware platform for constructing protocol conversion between Modbus and DeviceNet, thereby The protocol conversion between Modbus and DeviceNet is realized, and the Modbus device is connected to the DeviceNet network as a DeviceNet slave station in the form of a DeviceNet object.

附图说明Description of drawings

图1是本发明实施例的方法模型示意图。Fig. 1 is a schematic diagram of a method model of an embodiment of the present invention.

图2是本发明实施例的单元属性数据结构图。Fig. 2 is a structure diagram of unit attribute data according to the embodiment of the present invention.

图3是本发明实施例的配置文件格式示意图。Fig. 3 is a schematic diagram of a configuration file format according to an embodiment of the present invention.

具体实施方式Detailed ways

下面结合附图对本发明的一个优选实例进行详细说明:A preferred example of the present invention is described in detail below in conjunction with accompanying drawing:

本Modbus与DeviceNet间的协议转换方法是采用Modbus总线通过RS485总线接口与微处理器连接,DeviceNet总线通过CAN收发器和控制器与微处理器连接,微处理器还连接EEPROM和数据、程序存储器,构建起协议转换硬件平台,从而采用下述的Modbus与DeviceNet间协议转换模型(见图1),实现Modbus与DeviceNet间的协议转换:由配置口生成配置文件1,然后微处理器程序从配置文件1提取单元属性2,一方面生成Modbus主站的扫描列表5,另一方面生成DeviceNet的路径配置3,数据定义了DeviceNet应用对象的类号、实例号、属性数、属性号4和组合对象、参数对象的连接路径值7;由Modbus到DeviceNet的输入数据由Modbus网络按照扫描列表的配置被读入协议映射区8,然后读到DeviceNet应用对象,送到DeviceNet网络;由DeviceNet到Modbus的输出数据由组合对象和参数对象7送到命令转换器9,由微处理器解释为协议映射区8的命令区的命令,然后由命令所对应的非周期性扫描列表,发Modbus命令到Modbus网络,并更新协议映射区数据。The protocol conversion method between Modbus and DeviceNet is to use the Modbus bus to connect with the microprocessor through the RS485 bus interface, and the DeviceNet bus to connect with the microprocessor through the CAN transceiver and controller, and the microprocessor is also connected to EEPROM and data and program memory. Build the protocol conversion hardware platform, thus adopt the following protocol conversion model between Modbus and DeviceNet (see Figure 1), realize the protocol conversion between Modbus and DeviceNet: the configuration file 1 is generated by the configuration port, and then the microprocessor program from the configuration file 1. Extract unit attributes 2. On the one hand, generate the scan list 5 of the Modbus master station; The connection path value of the parameter object is 7; the input data from Modbus to DeviceNet is read into the protocol mapping area 8 by the Modbus network according to the configuration of the scan list, and then read into the DeviceNet application object and sent to the DeviceNet network; the output data from DeviceNet to Modbus The combination object and parameter object 7 are sent to the command converter 9, interpreted by the microprocessor as the command in the command area of the protocol mapping area 8, and then the Modbus command is sent to the Modbus network by the corresponding aperiodic scan list of the command, and Update protocol map area data.

本协议转换工作的具体步骤为:The specific steps for the transformation of this agreement are as follows:

①、配置文件1基本内容如图3所示,由通讯模式字、DeviceNet设备信息和单元属性三部分组成。通讯模式字保存Modbus子网的通讯波特率和通讯模式,以及用户自定义的其他信息;DeviceNet设备信息保存应用对象4的对象类号、实例数、实例号、每个实例包含的属性号,以及组合对象参数对象7所需的路径配置。配置文件1由用户生成,其具体格式约定与用户程序解释相一致即可。①. The basic content of configuration file 1 is shown in Figure 3, which consists of three parts: communication mode word, DeviceNet device information and unit attributes. The communication mode word saves the communication baud rate and communication mode of the Modbus subnet, and other information defined by the user; the DeviceNet device information saves the object class number, instance number, instance number, and attribute number contained in each instance of the application object 4, And the path configuration needed for the composite object parameter object 7. The configuration file 1 is generated by the user, and its specific format agreement is consistent with the interpretation of the user program.

②、提取配置文件1中通讯模式字信息,初始化Modbus通讯口。②. Extract the communication mode word information in the configuration file 1, and initialize the Modbus communication port.

③、提取配置文件1中单元属性部分信息,获得单元属性2,如图2所示为单个单元属性字的数据结构。图2中,单元属性包含4个字节,最高字节A保存该单元对应的Modbus从站地址,第二和第三字节B保存该单元数据对应的设备Modbus寄存器地址,第四字节的第7位C表示读写属性,第6位D表示周期性更新标志,第5到第0位表示该单元数据字节数。③. Extract part of the unit attribute information in configuration file 1 to obtain unit attribute 2, as shown in FIG. 2 is the data structure of a single unit attribute word. In Figure 2, the unit attribute contains 4 bytes, the highest byte A saves the Modbus slave address corresponding to the unit, the second and third byte B save the device Modbus register address corresponding to the unit data, and the fourth byte The 7th bit C indicates the read-write attribute, the 6th bit D indicates the periodic update flag, and the 5th to 0th bits indicate the number of data bytes in the unit.

④、由单元属性2生成Modbus扫描列表5,由单元属性为周期性更新的数据单元产生Modbus周期性扫描列表,由单元属性为非周期性更新的数据单元产生Modbus非周期性扫描列表。扫描列表每项记录由单元号、Modbus节点地址、Modbus寄存器地址、功能码、数据大小等组成。例如:使用0x03功能码读取一个或多个寄存器值,其扫描列表记录项内容为:0x01(单元号)、0x01(从站地址)、0x0001(寄存器地址)、0x03(功能码)、0x02(数据字节数)。4. Generate the Modbus scan list 5 by the unit attribute 2, generate the Modbus periodic scan list for the periodically updated data unit by the unit attribute, and generate the Modbus aperiodic scan list for the aperiodically updated data unit by the unit attribute. Each record in the scan list consists of unit number, Modbus node address, Modbus register address, function code, data size, etc. For example: use 0x03 function code to read one or more register values, and the contents of the scan list record items are: 0x01 (unit number), 0x01 (slave station address), 0x0001 (register address), 0x03 (function code), 0x02 ( data bytes).

⑤、协议映射区8的数据区部分其数据排序按照单元号从小到大依次对应单元数据。协议映射区既可在单微处理器平台的RAM区开辟,也可在双微处理器平台的双口RAM区开辟。⑤. The data in the data area of the protocol mapping area 8 is sorted according to the unit numbers from small to large, corresponding to the unit data. The protocol mapping area can be opened in the RAM area of the single-microprocessor platform, or in the dual-port RAM area of the dual-microprocessor platform.

⑥、路径配置3提取配置文件1中DeviceNet设备信息,初始化DeviceNet应用对象4的实例,按照实例号及属性数将实例属性与协议映射区的数据单元一一对应。同时,路径配置3将完整的组合对象和参数对象实例的数据路径填入,路径内容为:类号一实例号一属性号,即应用对象4的属性路径。其中,组合对象包含协议映射区单元属性为周期性更新的数据,参数对象包含协议映射区单元属性为非周期性更新的数据。⑥. Path configuration 3 extracts the DeviceNet device information in the configuration file 1, initializes the instance of the DeviceNet application object 4, and corresponds the instance attributes with the data units in the protocol mapping area one by one according to the instance number and the number of attributes. At the same time, path configuration 3 fills in the data path of the complete combination object and parameter object instance, the content of the path is: class number-instance number-attribute number, that is, the attribute path of the application object 4. Wherein, the combination object includes the data whose attribute of the protocol mapping area unit is updated periodically, and the parameter object includes the data whose attribute of the protocol mapping area unit is updated aperiodically.

⑦、对于数据自DeviceNet到Modbus,另外通过命令转换6进行。对于来自组合对象和参数对象的数据,命令转换6比较新数据与旧数据是否有变化,若有则按其对应的单元号及单元属性,生成一个命令项写入协议映射区8的命令区,并通知Modbus扫描列表5,然后以Modbus报文的形式发往Modbus从设备,相应正确后,更新协议映射区相应数据和DeviceNet应用对象的实例数据。⑦. For data from DeviceNet to Modbus, it is also performed through command conversion 6. For the data from combination object and parameter object, command conversion 6 compares new data and old data whether there is any change, if there is, then according to its corresponding unit number and unit attribute, generate a command item and write into the command area of protocol mapping area 8, And notify the Modbus to scan the list 5, and then send it to the Modbus slave device in the form of a Modbus message. After the response is correct, update the corresponding data in the protocol mapping area and the instance data of the DeviceNet application object.

Claims (4)

1. the method for converting protocol between Modbus and DeviceNet, it is characterized in that adopting the Modbus bus to be connected with microprocessor by the RS485 bus interface, the DeviceNet bus is connected with microprocessor with controller by the CAN transceiver, microprocessor also connects EEPROM and data, program storage, build the protocol conversion hardware platform, thereby adopt protocol conversion model between following Modbus and DeviceNet, realize the protocol conversion between Modbus and DeviceNet: by configuration mouthful generation configuration file (1), microprocessor program is from configuration file (1) extraction unit attribute (2) then, generate the scan list (5) of Modbus main website on the one hand, generate the path configurations (3) of DeviceNet on the other hand, the path configurations data definition class-mark of DeviceNet application (4), instance number, attribute number, attribute number and compound object, the access path value of parameter object (7); Be read into agreement map section (8) by the Modbus network according to the configuration of scan list to the input data of DeviceNet by Modbus, read the DeviceNet application then, deliver to the DeviceNet network; Deliver to command converter (6) to the dateout of Modbus by compound object and parameter object (7) by DeviceNet, be interpreted as the order of the command area of agreement map section (8) by microprocessor, then by the pairing aperiodicity scan list of order, send out Modbus and order the Modbus network, and New Deal map section data more.
2. the method for converting protocol between Modbus according to claim 1 and DeviceNet is characterized in that the concrete steps of protocol conversion are as follows:
1., configuration file (1) is stored in the nonvolatile memory EEPROM, stores by PC downloading mode or burning program mode, the editor of file content is by user's definition according to fixed format as required;
2., according to configuration file (1) initialization Modbus communication port;
3., according to DeviceNet facility information initialization sign object and DeviceNet object-related information in the configuration file (1);
4., according to the quantity and cell data byte number initializtion protocol map section (8) data cell of configuration file cell attribute (2); Producing the tabulation of Modbus periodic scan by cell attribute (2) for the data cell that periodically updates, is that aperiodicity data updated unit produces Modbus aperiodicity scan list by cell attribute.Every record of scan list (5) is made up of unit number, Modbus node address, Modbus register address, function code and size of data;
5., agreement map section (8) data cell is corresponding one by one with DeviceNet application (4) instance properties, carry out DeviceNet path configurations (3) then; The instance properties that periodically updates is generated the input instance properties of compound object respectively and exports instance properties according to read-write character, the instance properties of acyclic renewal is all listed in the parameter object instance properties; DeviceNet connecting object production and consumption path configurations is the input instance data attribute item and the output instance data attribute item of compound object;
6., according to DeviceNet application (4) instance properties corresponding protocols map section (8) data cell attribute, when DeviceNet has output I/O data or when writing output parameter, this operation is converted to the command information of agreement map section command area; By inquiry Modbus scan list, obtain the corresponding record item then, generate the Modbus message, after response is correct, this cell data of New Deal map section more.
3. the method for converting protocol between Modbus according to claim 1 and DeviceNet is characterized in that described configuration file (1) comprises communication mode and baud rate parameter, DeviceNet facility information and the agreement map section cell attribute of Modbus communication port; Described cell attribute (2) comprises Modbus address, read-write character, whether periodical operation, unit byte number; Described agreement map section (8) comprises data field and command area, and the data field is unit with the unit; The command area comprises status word, unit number and data register; Described DeviceNet path configurations file (3) is generated by cell attribute (2), comprises application class-mark, the tabulation of compound object instance properties, the tabulation of parameter object instance properties, connecting object example path; Described Modbus scan list (5) comprises periodic scan tabulation and aperiodicity scan list, is generated by configuration file (1).The conversion of DeviceNet output command is used for carrying out the class 3 transmission services and the I/O output of DeviceNet equipment, converts them to the command area information of agreement map section (8); Make up configuration file (1) definition of described DeviceNet application (4) by the user, its property content is corresponding one by one with agreement map section (8) data cell.
4. the method for converting protocol between Modbus according to claim 1 and DeviceNet, it is characterized in that one or more Modbus slave stations directly are converted to the one or more DeviceNet objects with same characteristic features, from the DeviceNet interface, can be considered as a complete concrete DeviceNet equipment fully, and be not only the I/O data of some packings.
CN200510027275A 2005-06-29 2005-06-29 A protocol conversion method between Modbus and DeviceNet Expired - Fee Related CN100579114C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200510027275A CN100579114C (en) 2005-06-29 2005-06-29 A protocol conversion method between Modbus and DeviceNet

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200510027275A CN100579114C (en) 2005-06-29 2005-06-29 A protocol conversion method between Modbus and DeviceNet

Publications (2)

Publication Number Publication Date
CN1728703A true CN1728703A (en) 2006-02-01
CN100579114C CN100579114C (en) 2010-01-06

Family

ID=35927711

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200510027275A Expired - Fee Related CN100579114C (en) 2005-06-29 2005-06-29 A protocol conversion method between Modbus and DeviceNet

Country Status (1)

Country Link
CN (1) CN100579114C (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101969476A (en) * 2010-09-25 2011-02-09 清华大学 Communication mode management method and system for emulating semiconductor manufacturing equipment
CN102231717A (en) * 2011-06-22 2011-11-02 上海纳杰电气成套有限公司 Method for rapidly making MODBUS protocol conversion gateway
CN102710622A (en) * 2012-05-22 2012-10-03 天津理工大学 Protocol conversion device based on DeviceNet-Modbus
CN103200078A (en) * 2012-01-06 2013-07-10 珠海格力电器股份有限公司 Gateway, communication network and data processing method
CN103905410A (en) * 2012-12-31 2014-07-02 上海一诺仪表有限公司 Multi-channel communication protocol converter capable of converting user-defined protocol to Modbus protocol
CN108804363A (en) * 2018-06-14 2018-11-13 华东师范大学 A kind of general purpose interface bus conversion method of PLC technology
CN111665795A (en) * 2020-05-06 2020-09-15 南京熊猫电子股份有限公司 Modbus and Device Net protocol identification compatible design method
CN111935196A (en) * 2020-10-13 2020-11-13 之江实验室 Protocol conversion method of Modbus and dnp3 based on EdgeX Foundation
CN114095585A (en) * 2022-01-21 2022-02-25 武汉中科通达高新技术股份有限公司 Data transmission method, device, storage medium and electronic equipment

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101969476B (en) * 2010-09-25 2012-12-19 清华大学 Communication mode management method and system for emulating semiconductor manufacturing equipment
CN101969476A (en) * 2010-09-25 2011-02-09 清华大学 Communication mode management method and system for emulating semiconductor manufacturing equipment
CN102231717B (en) * 2011-06-22 2014-08-06 上海纳杰电气成套有限公司 Method for rapidly making MODBUS protocol conversion gateway
CN102231717A (en) * 2011-06-22 2011-11-02 上海纳杰电气成套有限公司 Method for rapidly making MODBUS protocol conversion gateway
CN103200078A (en) * 2012-01-06 2013-07-10 珠海格力电器股份有限公司 Gateway, communication network and data processing method
CN103200078B (en) * 2012-01-06 2016-08-24 珠海格力电器股份有限公司 gateway, communication network and data processing method
CN102710622A (en) * 2012-05-22 2012-10-03 天津理工大学 Protocol conversion device based on DeviceNet-Modbus
CN103905410A (en) * 2012-12-31 2014-07-02 上海一诺仪表有限公司 Multi-channel communication protocol converter capable of converting user-defined protocol to Modbus protocol
CN108804363A (en) * 2018-06-14 2018-11-13 华东师范大学 A kind of general purpose interface bus conversion method of PLC technology
CN111665795A (en) * 2020-05-06 2020-09-15 南京熊猫电子股份有限公司 Modbus and Device Net protocol identification compatible design method
CN111935196A (en) * 2020-10-13 2020-11-13 之江实验室 Protocol conversion method of Modbus and dnp3 based on EdgeX Foundation
CN114095585A (en) * 2022-01-21 2022-02-25 武汉中科通达高新技术股份有限公司 Data transmission method, device, storage medium and electronic equipment
CN114095585B (en) * 2022-01-21 2022-05-20 武汉中科通达高新技术股份有限公司 Data transmission method, device, storage medium and electronic equipment

Also Published As

Publication number Publication date
CN100579114C (en) 2010-01-06

Similar Documents

Publication Publication Date Title
CN112187632B (en) Industrial equipment integration model and construction method, edge gateway device and industrial equipment integration system
CN104932364B (en) The OPC UA conversion equipments and method of a kind of Modbus communications protocol
CN101739304B (en) Generating of a device description for a measuring device
CN108833269A (en) A kind of intelligent things gateway towards industry spot
CN109257208A (en) A kind of information integrated system and method based on OPC UA
CN114222009A (en) An industrial communication multi-protocol conversion system
CN102571795B (en) Based on the automatic building control system of BACnet and EIB agreement
Lee et al. Implementation of a KNX-ZigBee gateway for home automation
CN103326936A (en) Multi-protocol gateway of Internet of Things allowing unified access of various heterogeneous sensing layer networks
CN1728703A (en) A protocol conversion method between Modbus and DeviceNet
CN102621921A (en) Programmer for electric energy meters
CN103905410A (en) Multi-channel communication protocol converter capable of converting user-defined protocol to Modbus protocol
CN103151840A (en) Communication method and device for IEC61850 system and non-IEC61850 system
Shu et al. Novel modbus adaptation method for IoT gateway
CN112866207B (en) Protocol conversion method for substation automation
CN204481848U (en) Industrial field bus MPR
CN201307236Y (en) Multi-channel serial communication converter and distributed control system employing same
CN104698962A (en) Programmable logic controller (PLC) communication method and system
CN101902380B (en) A ZigBee-based FF fieldbus control system and its protocol conversion method
CN103728957A (en) HART (highway addressable remote transducer) field equipment management method and system based on real-time database
CN101179444B (en) Configuration take-effective method, configuration system and configuration gateway
CN101729339A (en) Fieldbus communication card
CN203219328U (en) Multiplex communication protocol converter
CN101441470A (en) Method for realizing equipment mutual control through equipment self description
CN116389610A (en) Data acquisition and edge computing system and method based on information creation environment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20100106

Termination date: 20140629

EXPY Termination of patent right or utility model