[go: up one dir, main page]

CN112363479B - A digital communication transmission method and system between field devices - Google Patents

A digital communication transmission method and system between field devices Download PDF

Info

Publication number
CN112363479B
CN112363479B CN202011450259.8A CN202011450259A CN112363479B CN 112363479 B CN112363479 B CN 112363479B CN 202011450259 A CN202011450259 A CN 202011450259A CN 112363479 B CN112363479 B CN 112363479B
Authority
CN
China
Prior art keywords
data
instruction
equipment
combination
special
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.)
Active
Application number
CN202011450259.8A
Other languages
Chinese (zh)
Other versions
CN112363479A (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.)
Nanchang Hangkong University
Original Assignee
Nanchang Hangkong 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 Nanchang Hangkong University filed Critical Nanchang Hangkong University
Priority to CN202011450259.8A priority Critical patent/CN112363479B/en
Publication of CN112363479A publication Critical patent/CN112363479A/en
Application granted granted Critical
Publication of CN112363479B publication Critical patent/CN112363479B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/418Total factory control, i.e. centrally controlling a plurality of machines, e.g. direct or distributed numerical control [DNC], flexible manufacturing systems [FMS], integrated manufacturing systems [IMS] or computer integrated manufacturing [CIM]
    • G05B19/4185Total factory control, i.e. centrally controlling a plurality of machines, e.g. direct or distributed numerical control [DNC], flexible manufacturing systems [FMS], integrated manufacturing systems [IMS] or computer integrated manufacturing [CIM] characterised by the network communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/02Details
    • H04L12/16Arrangements for providing special services to substations
    • H04L12/18Arrangements for providing special services to substations for broadcast or conference, e.g. multicast
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L12/403Bus networks with centralised control, e.g. polling
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L2012/4026Bus for use in automation systems
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • General Engineering & Computer Science (AREA)
  • Manufacturing & Machinery (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Automation & Control Theory (AREA)
  • Small-Scale Networks (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

本发明涉及一种现场设备间的数字通信传输方法及系统。该方法包括:利用设备指令,生成设备数据组合指令;在通信校正模式下,利用通信校正指令对所述设备数据组合指令进行配置,确定配置后的组合指令;判断所述配置后的组合指令中的特殊广播功能位是否允许所述配置后的组合指令的特殊广播功能,若是,按照所述特殊广播功能进行双向数据传输;若否,利用所述配置后的组合指令的双向数据传输功能进行双向数据传输。本发明能够大幅提升系统工作效率以及通信带宽的利用率。

Figure 202011450259

The invention relates to a digital communication transmission method and system between field devices. The method includes: using a device instruction to generate a device data combination instruction; in a communication correction mode, using the communication correction instruction to configure the device data combination instruction to determine the configured combination instruction; Whether the special broadcast function bit allows the special broadcast function of the configured combined instruction, if so, perform bidirectional data transmission according to the special broadcast function; if not, use the configured bidirectional data transmission function of the combined instruction to perform bidirectional data transmission data transmission. The invention can greatly improve the working efficiency of the system and the utilization rate of the communication bandwidth.

Figure 202011450259

Description

一种现场设备间的数字通信传输方法及系统A digital communication transmission method and system between field devices

技术领域technical field

本发明涉及数字通信领域,特别是涉及一种现场设备间的数字通信传输方法及系统。The invention relates to the field of digital communication, in particular to a method and system for digital communication transmission between field devices.

背景技术Background technique

现场总线(Fieldbus)是近年来迅速发展起来的一种工业数据总线,它主要解决工业现场的智能化仪器仪表、控制器、执行机构等现场设备间的数字通信以及这些现场控制设备和高级控制系统之间的信息传递问题,通常现场总线都是半双工总线,现有的通讯协议的通信带宽利用率十分低下。Fieldbus (Fieldbus) is an industrial data bus that has developed rapidly in recent years. It mainly solves the digital communication between field devices such as intelligent instruments, controllers, and actuators in industrial fields, as well as these field control devices and advanced control systems. The problem of information transmission between them, usually the field bus is a half-duplex bus, and the communication bandwidth utilization rate of the existing communication protocol is very low.

1.例如在单主结构中,主设备发指令,从设备发数据,假设设备中有十种数据格式,需要用到其中七种数据格式,按现有协议,就必须分别发送七条指令,将这七条数据分别获取上来,操作复杂且效率低下。1. For example, in a single-master structure, the master device sends commands and the slave device sends data. Assuming that there are ten data formats in the device, seven of them need to be used. According to the existing protocol, seven commands must be sent respectively, These seven pieces of data are obtained separately, and the operation is complicated and inefficient.

2.在现场总线通信中,主设备如果需要给从设备发送数据,需要发送一条发送数据的指令;如果主设备需要获取从设备的数据,就需要发送一条接收数据的指令。发送和接收指令不能同时发送,需要分别单次发送,操作过程较为繁琐。2. In fieldbus communication, if the master device needs to send data to the slave device, it needs to send an instruction to send data; if the master device needs to obtain data from the slave device, it needs to send an instruction to receive data. Sending and receiving commands cannot be sent at the same time, they need to be sent separately, and the operation process is cumbersome.

3.现有的正常广播包是主设备发送一条指令给所有从设备,每个从设备接收到相同的指令,而从设备不会对指令加以辨别,所有从设备会作出相同的操作,因此这种方法难以让实现对单个从设备的个性化控制。3. The existing normal broadcast packet is that the master device sends a command to all slave devices, each slave device receives the same command, and the slave device will not distinguish the command, and all slave devices will perform the same operation, so this This method makes it difficult to achieve personalized control of a single slave device.

发明内容SUMMARY OF THE INVENTION

本发明的目的是提供一种现场设备间的数字通信传输方法及系统,以解决现有的通讯传输过程的通信带宽利用率低的问题。The purpose of the present invention is to provide a digital communication transmission method and system between field devices, so as to solve the problem of low utilization rate of communication bandwidth in the existing communication transmission process.

为实现上述目的,本发明提供了如下方案:For achieving the above object, the present invention provides the following scheme:

一种现场设备间的数字通信传输方法,包括:A digital communication transmission method between field devices, comprising:

利用设备指令,生成设备数据组合指令;所述设备指令包括设备参数设定指令、从设备运行模式、最后一次命令执行状态指令、设备地址指令、特殊模式指令、存放格式校正指令以及组合数据交换指令;Use device instructions to generate device data combination instructions; the device instructions include device parameter setting instructions, slave device operation mode, last command execution status instructions, device address instructions, special mode instructions, storage format correction instructions and combined data exchange instructions ;

在通信校正模式下,利用通信校正指令对所述设备数据组合指令进行配置,确定配置后的组合指令;所述通信校正指令包括全局参数配置指令以及单项参数配置指令;所述配置后的组合指令用于在发送设备数据的同时接收设备数据;In the communication correction mode, the device data combination instruction is configured by the communication correction instruction, and the configured combination instruction is determined; the communication correction instruction includes a global parameter configuration instruction and a single parameter configuration instruction; the configured combination instruction Used to receive device data while sending device data;

判断所述配置后的组合指令中的特殊广播功能位是否允许所述配置后的组合指令的特殊广播功能,得到第一判断结果;Judging whether the special broadcast function bit in the configured combined instruction allows the special broadcast function of the configured combined instruction, and obtains a first judgment result;

若所述第一判断结果表示为所述配置后的组合指令中的特殊广播功能位允许所述配置后的组合指令的特殊广播功能,按照所述特殊广播功能进行双向数据传输;所述特殊广播功能用于在一条所述配置后的组合指令中接收应答包持续应答;If the first judgment result indicates that the special broadcast function bit in the configured combination command allows the special broadcast function of the configured combination command, bidirectional data transmission is performed according to the special broadcast function; the special broadcast function The function is used to receive the response packet in one of the configured combined instructions and continue to respond;

若所述第一判断结果表示为所述配置后的组合指令中的特殊广播功能位未允许所述配置后的组合指令的特殊广播功能,利用所述配置后的组合指令的双向数据传输功能进行双向数据传输;所述双向数据传输功能用于在一条所述配置后的组合指令中同时发送数据以及接收数据。If the first judgment result indicates that the special broadcast function bit in the configured combination command does not allow the special broadcast function of the configured combination command, use the bidirectional data transmission function of the configured combination command to perform Bidirectional data transmission; the bidirectional data transmission function is used to send data and receive data simultaneously in one of the configured combined instructions.

可选的,所述在通信校正模式下,利用通信校正指令对所述设备数据组合指令进行配置,确定配置后的组合指令,具体包括:Optionally, in the communication correction mode, use a communication correction instruction to configure the device data combination instruction, and determine the configured combination instruction, which specifically includes:

在通信校正模式下,配置所述设备数据组合指令中的全局参数:In the communication correction mode, configure the global parameters in the device data combination instruction:

第一步:对所述设备数据组合指令的通道进行配置:将全局参数通道选择位设置为0时,配置完成的的组合指令存储在组合指令数据包0中;将通道选择位设置为1时,配置完成的组合指令存储在组合指令数据包1中;The first step: configure the channel of the device data combination command: when the global parameter channel selection bit is set to 0, the configured combination command is stored in the combination command packet 0; when the channel selection bit is set to 1 , the configured combined instruction is stored in combined instruction data packet 1;

第二步:对特殊广播数据长度配置:当所述设备数据组合指令的特殊广播包被使能后,将特殊广播包的不同字段作为不同设备的数据;The second step: configure the length of special broadcast data: after the special broadcast packet of the device data combination instruction is enabled, use different fields of the special broadcast packet as data of different devices;

第三步:配置读取数据以及写入数据的映射选择位:在读取状态下,主设备向从设备发送配置完成的组合指令后读取从设备数据;在写入状态下,主设备向从设备发送配置完成的组合指令后将主设备数据写入从设备;Step 3: Configure the mapping selection bits for read data and write data: in the read state, the master device sends the configured combined command to the slave device and reads the slave device data; in the write state, the master device sends After the slave device sends the combined command that the configuration is completed, the master device data is written to the slave device;

第四步:配置数据类型个数:设定配置的数据类型个数为n,则配置完成后组合指令中有n种数据组合;Step 4: Configure the number of data types: Set the number of configured data types to n, then there are n data combinations in the combination instruction after the configuration is completed;

配置完所述全局参数后,对前n项单项参数进行配置:After configuring the global parameters, configure the first n single parameters:

第一步:配置数据类型:数据类型采用6位编码,当通信系统低于6位编码时,采用间接引用数据类型方式配置数据类型;Step 1: Configure the data type: The data type adopts 6-bit encoding. When the communication system is lower than the 6-bit encoding, the data type is configured by indirect reference data type;

第二步:配置数据的起始数据通道;Step 2: Configure the initial data channel of the data;

第三步:配置数据通道数;Step 3: Configure the number of data channels;

当单项参数配置完成后,确定配置后的组合指令。When the single parameter configuration is completed, the configured combined command is determined.

可选的,所述按照所述特殊广播功能进行双向数据传输,具体包括:Optionally, the bidirectional data transmission according to the special broadcast function specifically includes:

当设备收到的命令为发送数据命令且设备地址为广播地址时,根据所述配置后的组合指令的数据通道、数据长度以及所述存放格式校正指令中的特殊广播数据长度确定当前设备数据;所述数据长度为特殊广播数据长度的整数倍;所述设备为主设备或从设备;When the command received by the device is a sending data command and the device address is a broadcast address, the current device data is determined according to the data channel and data length of the configured combined command and the length of the special broadcast data in the storage format correction command; The data length is an integer multiple of the special broadcast data length; the device is a master device or a slave device;

当所述特殊模式指令中的RxTx功能被使能后,传输所述当前设备数据并利用Rx应答包持续应答;所述Rx应答包内包含读取数据的所述配置后的组合指令;Rx为接收,Tx为发送。When the RxTx function in the special mode command is enabled, the current device data is transmitted and the Rx response packet is used to continuously respond; the Rx response packet contains the configured combined command for reading data; Rx is Receive, Tx is send.

可选的,所述利用所述配置后的组合指令的双向数据传输功能进行双向数据传输,具体包括:Optionally, the bidirectional data transmission using the bidirectional data transmission function of the configured combined command specifically includes:

当设备被选址后且所述设备接收到一条Tx命令时,返回一个Rx应答包。When the device is addressed and the device receives a Tx command, it returns an Rx response packet.

可选的,在双向数据传输过程中,当传输数量高于传输数量阈值时,利用等时传输模式进行双向数据传输。Optionally, in the bidirectional data transmission process, when the transmission quantity is higher than the transmission quantity threshold, an isochronous transmission mode is used to perform bidirectional data transmission.

一种现场设备间的数字通信传输系统,包括:A digital communication transmission system between field devices, comprising:

设备数据组合指令生成模块,用于利用设备指令,生成设备数据组合指令;所述设备指令包括设备参数设定指令、从设备运行模式、最后一次命令执行状态指令、设备地址指令、特殊模式指令、存放格式校正指令以及组合数据交换指令;The device data combination instruction generation module is used to generate the device data combination instruction by using the device instruction; the device instruction includes the device parameter setting instruction, the slave device operation mode, the last command execution status instruction, the device address instruction, the special mode instruction, Store format correction instructions and combined data exchange instructions;

配置模块,用于在通信校正模式下,利用通信校正指令对所述设备数据组合指令进行配置,确定配置后的组合指令;所述通信校正指令包括全局参数配置指令以及单项参数配置指令;所述配置后的组合指令用于在发送设备数据的同时接收设备数据;The configuration module is used to configure the device data combination instruction by using the communication correction instruction in the communication correction mode, and determine the configured combination instruction; the communication correction instruction includes a global parameter configuration instruction and a single parameter configuration instruction; the The configured combined command is used to receive device data while sending device data;

第一判断模块,用于判断所述配置后的组合指令中的特殊广播功能位是否允许所述配置后的组合指令的特殊广播功能,得到第一判断结果;a first judgment module, configured to judge whether the special broadcast function bit in the configured combined instruction allows the special broadcast function of the configured combined instruction, and obtain a first judgment result;

特殊广播包传输模块,用于若所述第一判断结果表示为所述配置后的组合指令中的特殊广播功能位允许所述配置后的组合指令的特殊广播功能,按照所述特殊广播功能进行双向数据传输;所述特殊广播功能用于在一条所述配置后的组合指令中接收应答包持续应答;A special broadcast packet transmission module, configured to perform the special broadcast function according to the special broadcast function if the first judgment result indicates that the special broadcast function bit in the configured combination command allows the special broadcast function of the configured combination command Two-way data transmission; the special broadcast function is used to receive a response packet in a combined command after the configuration and continue to respond;

双向数据传输模块,用于若所述第一判断结果表示为所述配置后的组合指令中的特殊广播功能位未允许所述配置后的组合指令的特殊广播功能,利用所述配置后的组合指令的双向数据传输功能进行双向数据传输;所述双向数据传输功能用于在一条所述配置后的组合指令中同时发送数据以及接收数据。The bidirectional data transmission module is used for, if the first judgment result indicates that the special broadcast function bit in the configured combination instruction does not allow the special broadcast function of the configured combination instruction, use the configured combination instruction The bidirectional data transmission function of the instruction performs bidirectional data transmission; the bidirectional data transmission function is used to send data and receive data simultaneously in one of the configured combined instructions.

可选的,所述配置模块,具体包括:Optionally, the configuration module specifically includes:

全局参数配置单元,用于在通信校正模式下,配置所述设备数据组合指令中的全局参数:A global parameter configuration unit, configured to configure the global parameters in the device data combination instruction in the communication correction mode:

第一步:对所述设备数据组合指令的通道进行配置:将全局参数通道选择位设置为0时,配置完成的的组合指令存储在组合指令数据包0中;将通道选择位设置为1时,配置完成的组合指令存储在组合指令数据包1中;The first step: configure the channel of the device data combination command: when the global parameter channel selection bit is set to 0, the configured combination command is stored in the combination command packet 0; when the channel selection bit is set to 1 , the configured combined instruction is stored in combined instruction data packet 1;

第二步:对特殊广播数据长度配置:当所述设备数据组合指令的特殊广播包被使能后,将特殊广播包的不同字段作为不同设备的数据;The second step: configure the length of special broadcast data: after the special broadcast packet of the device data combination instruction is enabled, use different fields of the special broadcast packet as data of different devices;

第三步:配置读取数据以及写入数据的映射选择位:在读取状态下,主设备向从设备发送配置完成的组合指令后读取从设备数据;在写入状态下,主设备向从设备发送配置完成的组合指令后将主设备数据写入从设备;Step 3: Configure the mapping selection bits for read data and write data: in the read state, the master device sends the configured combined command to the slave device and reads the slave device data; in the write state, the master device sends After the slave device sends the combined command that the configuration is completed, the master device data is written to the slave device;

第四步:配置数据类型个数:设定配置的数据类型个数为n,则配置完成后组合指令中有n种数据组合;Step 4: Configure the number of data types: Set the number of configured data types to n, then there are n data combinations in the combination instruction after the configuration is completed;

单项参数配置单元,用于配置完所述全局参数后,对前n项单项参数进行配置:The single parameter configuration unit is used to configure the first n single parameters after the global parameters are configured:

第一步:配置数据类型:数据类型采用6位编码,当通信系统低于6位编码时,采用间接引用数据类型方式配置数据类型;Step 1: Configure the data type: The data type adopts 6-bit encoding. When the communication system is lower than the 6-bit encoding, the data type is configured by indirect reference data type;

第二步:配置数据的起始数据通道;Step 2: Configure the initial data channel of the data;

第三步:配置数据通道数;Step 3: Configure the number of data channels;

当单项参数配置完成后,确定配置后的组合指令。When the single parameter configuration is completed, the configured combined command is determined.

可选的,所述特殊广播包传输模块,具体包括:Optionally, the special broadcast packet transmission module specifically includes:

当前设备数据确定单元,用于当设备收到的命令为发送数据命令且设备地址为广播地址时,根据所述配置后的组合指令的数据通道、数据长度以及所述存放格式校正指令中的特殊广播数据长度确定当前设备数据;所述数据长度为特殊广播数据长度的整数倍;所述设备为主设备或从设备;The current device data determination unit is used to correct the special data in the command according to the data channel, data length and the storage format of the configured combined command when the command received by the device is a send data command and the device address is a broadcast address. The broadcast data length determines the current device data; the data length is an integer multiple of the special broadcast data length; the device is a master device or a slave device;

特殊广播包传输单元,用于当所述特殊模式指令中的RxTx功能被使能后,传输所述当前设备数据并利用Rx应答包持续应答;所述Rx应答包内包含读取数据的所述配置后的组合指令;Rx为接收,Tx为发送。The special broadcast packet transmission unit is used to transmit the current device data and use the Rx response packet to continuously respond when the RxTx function in the special mode command is enabled; the Rx response packet contains the read data. The configured combined command; Rx is for receiving, Tx is for sending.

可选的,所述双向数据传输模块,具体包括:Optionally, the two-way data transmission module specifically includes:

双向数据传输单元,用于当设备被选址后且所述设备接收到一条Tx命令时,返回一个Rx应答包。The bidirectional data transmission unit is used to return an Rx response packet when the device is addressed and the device receives a Tx command.

可选的,在双向数据传输过程中,当传输数量高于传输数量阈值时,利用等时传输模式进行双向数据传输。Optionally, in the bidirectional data transmission process, when the transmission quantity is higher than the transmission quantity threshold, an isochronous transmission mode is used to perform bidirectional data transmission.

根据本发明提供的具体实施例,本发明公开了以下技术效果:本发明提供了一种现场设备间的数字通信传输方法及系统,通过配置不同类型数据的组合指令,主设备只需要发送一条组合指令即可获取所需要的数据,或者只需要通过一条组合指令,就能将所需要发送的数据全部发送下去,本发明通过组合指令的方式减少了现场总线通信的次数,能够大幅提高带宽利用率,即数据的利用率;According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects: the present invention provides a method and system for digital communication transmission between field devices, by configuring the combination instructions of different types of data, the main device only needs to send a combination of The required data can be acquired by the command, or all the data to be sent can be sent by only one combined command. The present invention reduces the number of field bus communications by combining the commands, and can greatly improve the bandwidth utilization rate. , that is, the utilization rate of data;

本发明利用双向数据传输技术进行双向传输,现场总线不再局限于单一的“一发一收”通信模式,而是通过发送和接收指令的组合,能够实现同一条指令在发送数据的同时采集数据的功能。例如,主设备需要发送数据给从设备,且需要接收从设备采集或返回的数据,现在不再需要将发送数据指令和接收数据指令分别发送,只需发送一条组合指令即可,能够大大节省过程时间和提高通信效率。The present invention uses the bidirectional data transmission technology to carry out bidirectional transmission, and the field bus is no longer limited to a single "one send and one receive" communication mode, but through the combination of sending and receiving commands, the same command can collect data while sending data. function. For example, the master device needs to send data to the slave device, and needs to receive the data collected or returned by the slave device. Now it is no longer necessary to send the data sending command and the data receiving command separately, but only need to send a combined command, which can greatly save the process. time and improve communication efficiency.

同时,目前现场总线的正常广播,是主设备向所有从设备发送数据包,所有的从设备收到的数据包是一样的,各个从设备会做出相同的操作,不能实现单个设备的精准控制;而本发明利用特殊广播包传输技术进行双向传输,本发明中的特殊广播是主设备向从设备发送数据或指令,从设备收到相同的数据或指令,每个从设备会从收到的数据包或指令中属于自己的那一部分,并作出相应操作,因此,特殊广播包技术能够让主设备通过一条指令控制所有不同的设备,极大提高了现场通信中的控制效率和通信带宽的利用率。At the same time, the normal broadcast of the current fieldbus is that the master device sends data packets to all slave devices. All slave devices receive the same data packets, and each slave device will perform the same operation, which cannot achieve precise control of a single device. ; And the present invention uses special broadcast packet transmission technology to carry out bidirectional transmission, the special broadcast in the present invention is that the master device sends data or instructions to the slave equipment, and the slave equipment receives the same data or instructions, and each slave device will receive the same data or instructions. The part of the data packet or command that belongs to itself, and make corresponding operations. Therefore, the special broadcast packet technology enables the master device to control all different devices through one command, which greatly improves the control efficiency and the utilization of communication bandwidth in on-site communication. Rate.

综上,本发明能够将发送指令和接收指令组合起来,实现数据的双向传输,即同一条指令在发送数据的同时采集数据,则可大大简化操作,提高通信带宽的利用率。同时让不同从设备在一条广播指令中接受不同的数据指令,实现特殊广播包支持,那么就能够大幅提升系统工作效率以及通信带宽的利用率。To sum up, the present invention can combine sending instructions and receiving instructions to realize bidirectional transmission of data, that is, the same instruction collects data while sending data, which greatly simplifies operations and improves the utilization of communication bandwidth. At the same time, allowing different slave devices to accept different data commands in one broadcast command to achieve special broadcast packet support, it can greatly improve the system work efficiency and the utilization of communication bandwidth.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the accompanying drawings required in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some of the present invention. In the embodiments, for those of ordinary skill in the art, other drawings can also be obtained according to these drawings without creative labor.

图1为单主结构网络拓扑结构图;Fig. 1 is a single main structure network topology diagram;

图2为现场总线通信过程流程图;Fig. 2 is the flow chart of the field bus communication process;

图3为本发明所提供的现场设备间的数字通信传输方法流程图;3 is a flowchart of a digital communication transmission method between field devices provided by the present invention;

图4为等时传输模式下的数据传输流程图;Fig. 4 is the data transmission flow chart under the isochronous transmission mode;

图5为本发明所提供的现场设备间的数字通信传输系统结构图。FIG. 5 is a structural diagram of a digital communication transmission system between field devices provided by the present invention.

具体实施方式Detailed ways

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

本发明的目的是提供一种现场设备间的数字通信传输方法及系统,能够大幅提升系统工作效率以及通信带宽的利用率。The purpose of the present invention is to provide a digital communication transmission method and system between field devices, which can greatly improve the working efficiency of the system and the utilization rate of communication bandwidth.

为使本发明的上述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本发明作进一步详细的说明。In order to make the above objects, features and advantages of the present invention more clearly understood, the present invention will be described in further detail below with reference to the accompanying drawings and specific embodiments.

名词说明:Noun description:

主设备MasterDevice或Host:在网络中起主导作用的设备,或者在总线仲裁中获得总线控制权的设备,可以随时启动或者终止和该网络中任何其它设备的通信。Master Device or Host: The device that plays a leading role in the network, or the device that obtains the bus control right in the bus arbitration, can start or terminate the communication with any other device in the network at any time.

从设备SalveDevice或Device:在网络中处于从属作用的设备,或者在总线仲裁中失败没有获得总线控制权的设备,可以独自完成一定的功能,但不能主动启动与该网络中其它设备的通信,必须通过主设备才可以,而且必须是主设备所期望的。Slave device SalveDevice or Device: A device that is in a slave role in the network, or a device that fails in bus arbitration and does not obtain bus control rights, can complete certain functions by itself, but cannot actively initiate communication with other devices in the network, it must be It is only possible through the master device, and it must be what the master device expects.

本发明适用于单主结构的总线网络,例如RS485总线。图1为单主结构网络拓扑结构图,网络拓扑如图1所示。The present invention is applicable to a bus network with a single master structure, such as an RS485 bus. Fig. 1 is a network topology diagram of a single main structure, and the network topology is shown in Fig. 1 .

该网络拓扑中有且只能有一个主设备,可以有一个或多个从设备。单主结构的一次通信过程包括2个部分:寻址/连接和数据交换。主设备能够启动通信或者终止通信,而且只有在总线空闲的状态下,主设备才能够启动下一次通信。所有的数据流都由主设备来控制。There can only be one master device in this network topology, and there can be one or more slave devices. A communication process of a single master structure includes two parts: addressing/connection and data exchange. The master device can initiate or terminate communication, and only when the bus is idle can the master device initiate the next communication. All data flow is controlled by the master device.

通信启动即寻址/连接过程,由主设备发送包含期望寻址的设备地址的数据包到总线,从设备成功收到该命令包,并且地址匹配,则通信启动成功,图2为现场总线通信过程流程图,如图2所示。表1为设备指令参数表,本发明中涉及到的设备指令参数如表1所示。Communication startup is the addressing/connection process. The master device sends a data packet containing the desired address of the device to the bus. The slave device successfully receives the command packet and the address matches, then the communication starts successfully. Figure 2 shows the fieldbus communication The process flow chart is shown in Figure 2. Table 1 is a table of equipment instruction parameters, and the equipment instruction parameters involved in the present invention are shown in Table 1.

表1Table 1

Figure BDA0002826533490000071
Figure BDA0002826533490000071

Figure BDA0002826533490000081
Figure BDA0002826533490000081

图3为本发明所提供的现场设备间的数字通信传输方法流程图,如图3所示,一种现场设备间的数字通信传输方法,包括:Fig. 3 is the flow chart of the digital communication transmission method between field devices provided by the present invention, as shown in Fig. 3, a kind of digital communication transmission method between field devices, including:

步骤301:利用设备指令,生成设备数据组合指令;所述设备指令包括设备参数设定指令、从设备运行模式、最后一次命令执行状态指令、设备地址指令、特殊模式指令、存放格式校正指令以及组合数据交换指令。Step 301: Use the device command to generate the device data combination command; the device command includes the device parameter setting command, the slave device operation mode, the last command execution status command, the device address command, the special mode command, the storage format correction command and the combination. Data exchange instructions.

步骤302:在通信校正模式下,利用通信校正指令对所述设备数据组合指令进行配置,确定配置后的组合指令;所述通信校正指令包括全局参数配置指令以及单项参数配置指令;所述配置后的组合指令用于在发送设备数据的同时接收设备数据。Step 302: in the communication correction mode, use the communication correction instruction to configure the device data combination instruction, and determine the configured combination instruction; the communication correction instruction includes a global parameter configuration instruction and a single parameter configuration instruction; after the configuration The combined command is used to receive device data at the same time as sending device data.

所述步骤302具体包括:The step 302 specifically includes:

在通信校正模式下,配置所述设备数据组合指令中的全局参数:In the communication correction mode, configure the global parameters in the device data combination instruction:

第一步:对所述设备数据组合指令的通道进行配置:将全局参数通道选择位设置为0时,配置完成的的组合指令存储在组合指令数据包0中;将通道选择位设置为1时,配置完成的组合指令存储在组合指令数据包1中;The first step: configure the channel of the device data combination command: when the global parameter channel selection bit is set to 0, the configured combination command is stored in the combination command packet 0; when the channel selection bit is set to 1 , the configured combined instruction is stored in combined instruction data packet 1;

第二步:对特殊广播数据长度配置:当所述设备数据组合指令的特殊广播包被使能后,将特殊广播包的不同字段作为不同设备的数据;The second step: configure the length of special broadcast data: after the special broadcast packet of the device data combination instruction is enabled, use different fields of the special broadcast packet as data of different devices;

第三步:配置读取数据以及写入数据的映射选择位:在读取状态下,主设备向从设备发送配置完成的组合指令后读取从设备数据;在写入状态下,主设备向从设备发送配置完成的组合指令后将主设备数据写入从设备;Step 3: Configure the mapping selection bits for read data and write data: in the read state, the master device sends the configured combined command to the slave device and reads the slave device data; in the write state, the master device sends After the slave device sends the combined command that the configuration is completed, the master device data is written to the slave device;

第四步:配置数据类型个数:设定配置的数据类型个数为n,则配置完成后组合指令中有n种数据组合;Step 4: Configure the number of data types: Set the number of configured data types to n, then there are n data combinations in the combination instruction after the configuration is completed;

配置完所述全局参数后,对前n项单项参数进行配置:After configuring the global parameters, configure the first n single parameters:

第一步:配置数据类型:数据类型采用6位编码,当通信系统低于6位编码时,采用间接引用数据类型方式配置数据类型;Step 1: Configure the data type: The data type adopts 6-bit encoding. When the communication system is lower than the 6-bit encoding, the data type is configured by indirect reference data type;

第二步:配置数据的起始数据通道;Step 2: Configure the initial data channel of the data;

第三步:配置数据通道数;Step 3: Configure the number of data channels;

当单项参数配置完成后,确定配置后的组合指令。When the single parameter configuration is completed, the configured combined command is determined.

在实际应用中,本发明中使用设备相关数据组合指令对设备内部不同的数据类型进行组合,然后进行打包交换,传输所必需的数据。In practical applications, the device-related data combination instruction is used in the present invention to combine different data types inside the device, and then packaged and exchanged to transmit the necessary data.

在本发明中,数据类型DataType用于数据编码与物理信号类型的关联,物理信号类型如温度、频率量和开关量采集等;使用组合指令写入设备的数据或者读出的数据格式由通信校正指定;在通信校正模式下,使用校正指令(用于设备相关数据指令内部的数据存放格式校正)对相应的数据结构进行配置校正。In the present invention, the data type DataType is used for the association between data encoding and physical signal types, such as temperature, frequency, and switching value acquisition, etc.; the data written in the device or the data format read out using the combined command is corrected by communication Specify; in the communication correction mode, use the correction command (used for data storage format correction inside the device-related data command) to perform configuration correction on the corresponding data structure.

通信校正指令中包含全局参数和单项参数,在16位字地址中,全局参数一般占1位字地址,单项参数一般占15位字地址。全局参数用于定义该组合指令的功能与类型,包括通道选择、Read/Write数据映射选择以及数据类型的个数设置。单项参数用于定义单项配置参数,包括数据类型、起始通道和数据长度。表2为通信校正指令参数表,组合指令参数表如表2所示。The communication correction command includes global parameters and single-item parameters. In the 16-bit word address, the global parameter generally occupies a 1-bit word address, and the single-item parameter generally occupies a 15-bit word address. Global parameters are used to define the function and type of the combined command, including channel selection, Read/Write data mapping selection, and setting of the number of data types. Single-item parameters are used to define single-item configuration parameters, including data type, starting channel and data length. Table 2 is the communication correction command parameter table, and the combination command parameter table is shown in Table 2.

表2Table 2

Figure BDA0002826533490000101
Figure BDA0002826533490000101

在配置全局参数时,第一步需对组合指令的通道进行配置,在全局参数通道选择位设置为0,配置好的组合指令则存储在组合指令数据包0中;在通道选择位设置为1,配置完成后的组合指令存储在组合指令数据包1中。组合指令0和组合指令1配置完成后,在应用时即可直接调用,无需另行配置。第二步为特殊广播数据长度配置,当组合指令的特殊广播包被使能后,特殊广播包的不同字段作为不同设备的数据(详见特殊广播包部分)。第三步是配置Read/Write数据映射选择位,通过配置该位,组合指令进入Read(读取)或Write(写入)状态。在读取状态下,主设备向从设备发送组合指令后读取从设备数据;在写入状态下,主设备向从设备发送组合指令后将数据写入从设备。第四步是配置数据类型的个数,假设配置的数据类型个数为n,则组合指令中便有n种数据的组合,在配置完全局参数后,需对前n项单项参数进行配置。When configuring global parameters, the first step is to configure the channel of the combined command, set the channel selection bit in the global parameter to 0, and the configured combined command is stored in the combined command packet 0; set the channel selection bit to 1 , and the combined command after configuration is stored in the combined command data packet 1. After the combination instruction 0 and combination instruction 1 are configured, they can be called directly during application without additional configuration. The second step is to configure the length of the special broadcast data. When the special broadcast packet of the combined command is enabled, the different fields of the special broadcast packet are used as data for different devices (see the special broadcast packet section for details). The third step is to configure the Read/Write data mapping selection bit. By configuring this bit, the combined command enters the Read (read) or Write (write) state. In the read state, the master device sends a combination command to the slave device and then reads the slave device data; in the write state, the master device sends the combination command to the slave device and then writes data to the slave device. The fourth step is to configure the number of data types. Assuming that the number of configured data types is n, there are n types of data combinations in the combination instruction. After configuring the complete global parameters, the first n single parameters need to be configured.

各个单项参数的配置,第一步是对数据类型的配置;表3为数据编码与物理信号类型部分对应表,如表3所示(此表为具体应用范例,专利保护范围不仅限于此)。For the configuration of each single parameter, the first step is to configure the data type; Table 3 is the corresponding table of data encoding and physical signal type, as shown in Table 3 (this table is a specific application example, and the scope of patent protection is not limited to this).

数据类型采用6位编码,在通信系统不足以提供6位编码时,采用间接引用数据类型的方式,能够使编码紧凑,提高通信效率。间接使用“数据类型”的设备,在设备内部建立一个索引表,该索引表的每一项对应表中的一种数据类型,并且只对应一种数据类型,每种索引对应的数据类型不重复。主设备能够读取设备内部的索引与该表的对应关系。索引表按照DataType表中的定义,按编码值从小到大的方式进行排列。The data type adopts 6-bit encoding. When the communication system is insufficient to provide 6-bit encoding, the indirect reference to the data type can make the encoding compact and improve the communication efficiency. For devices that use "data type" indirectly, an index table is established inside the device. Each item of the index table corresponds to one data type in the table, and only corresponds to one data type, and the data types corresponding to each index are not repeated. . The master device can read the corresponding relationship between the index inside the device and the table. The index table is arranged according to the definition in the DataType table in ascending order of coding values.

表3table 3

Figure BDA0002826533490000111
Figure BDA0002826533490000111

Figure BDA0002826533490000121
Figure BDA0002826533490000121

单项参数配置第二步是对数据的起始数据通道进行配置,设置好起始数据通道后再进行单项参数配置的第三步,即配置数据通道数。假设有n个单项参数需要配置,则依次对各个单项参数进行配置,配置完成后的数据格式可以直接保存,在应用时可直接调取。The second step of single parameter configuration is to configure the starting data channel of the data. After setting the starting data channel, the third step of single parameter configuration is to configure the number of data channels. Assuming that there are n single-item parameters to be configured, configure each single-item parameter in turn, and the data format after the configuration can be saved directly, and can be directly retrieved during application.

步骤303:判断所述配置后的组合指令中的特殊广播功能位是否允许所述配置后的组合指令的特殊广播功能,若是,执行步骤304,若否,执行步骤305。Step 303 : Determine whether the special broadcast function bit in the configured combined instruction allows the special broadcast function of the configured combined instruction, if yes, go to step 304 , if not, go to step 305 .

步骤304:按照所述特殊广播功能进行双向数据传输;所述特殊广播功能用于在一条所述配置后的组合指令中接收应答包持续应答。Step 304: Perform bidirectional data transmission according to the special broadcast function; the special broadcast function is used for receiving a response packet in a combined command after the configuration and continuously responding.

所述步骤304具体包括:当设备收到的命令为发送数据命令且设备地址为广播地址时,根据所述配置后的组合指令的数据通道、数据长度以及所述存放格式校正指令中的特殊广播数据长度确定当前设备数据;所述数据长度为特殊广播数据长度的整数倍;所述设备为主设备或从设备;当所述特殊模式指令中的RxTx功能被使能后,传输所述当前设备数据并利用Rx应答包持续应答;所述Rx应答包内包含读取数据的所述配置后的组合指令;Rx为接收,Tx为发送。The step 304 specifically includes: when the command received by the device is a sending data command and the device address is a broadcast address, correcting the special broadcast in the command according to the configured data channel, data length and the storage format of the command. The data length determines the current device data; the data length is an integer multiple of the length of the special broadcast data; the device is a master device or a slave device; when the RxTx function in the special mode command is enabled, the current device is transmitted The Rx response packet is used to continuously respond to the data; the Rx response packet contains the configured combined instruction to read the data; Rx is for reception, and Tx is for transmission.

本发明中的特殊广播包功能基于组合指令实现:The special broadcast packet function in the present invention is realized based on the combined instruction:

CmdMode的特殊广播功能位能够使能组合指令的特殊广播功能,当设备收到的命令为发送数据命令时,并且设备地址为广播地址时,根据指令的数据通道Chnl、数据长度Len以及DaComAdj(设备相关数据指令内部的数据存放格式校正)指令中的特殊广播数据长度来确定当前设备所需要的数据。The special broadcast function bit of CmdMode can enable the special broadcast function of the combined command. When the command received by the device is a send data command, and the device address is the broadcast address, according to the command data channel Chnl, data length Len and DaComAdj (device The data required by the current device is determined by the length of the special broadcast data in the relevant data command (data storage format correction) command.

该模式下收到的数据中,指令的数据通道Chnl指定第一组数据对应的设备地址,其后的数据依次对应设备地址为Chnl+1、Chnl+2…对应的数据,所有数据连续存放。因此,当该功能被使能时,挂接在同一个总线上的所有从设备的特殊广播数据长度必须相同。此时允许的数据长度必须为特殊广播数据长度的整数倍,即数据长度=特殊广播数据长度×n,n为该广播包寻址到的设备的个数。In the data received in this mode, the data channel Chnl of the command specifies the device address corresponding to the first group of data, and the subsequent data corresponds to the data corresponding to the device address of Chnl+1, Chnl+2..., and all data are stored continuously. Therefore, when this function is enabled, the special broadcast data length of all slave devices connected to the same bus must be the same. At this time, the allowable data length must be an integer multiple of the special broadcast data length, that is, data length=special broadcast data length×n, where n is the number of devices addressed by the broadcast packet.

步骤305:利用所述配置后的组合指令的双向数据传输功能进行双向数据传输;所述双向数据传输功能用于在一条所述配置后的组合指令中同时发送数据以及接收数据。Step 305: Use the bidirectional data transmission function of the configured combination instruction to perform bidirectional data transmission; the bidirectional data transmission function is used to send data and receive data simultaneously in one of the configured combination instructions.

所述步骤305具体包括:当设备被选址后且所述设备接收到一条Tx命令时,返回一个Rx应答包。The step 305 specifically includes: after the device is addressed and the device receives a Tx command, returning an Rx response packet.

本发明中的双向数据传输功能是基于组合指令实现的。使用组合指令中的RxTx(Rx为接收,Tx为发送)功能来实现数据的双向传输。当设备被选址后,且收到一条Tx命令时,则返回一个Rx应答包,同时包含对应的组合指令读取数据。这种情况下Tx指令的执行状态存放在LastError(最后一次命令执行的状态)指令中,该指令通常用在组合指令中支持RxTx模式的情况下对Tx指令的运行状态进行监控,该参数能够通过SysPara1指令来获取。The bidirectional data transmission function in the present invention is realized based on the combined instruction. Use the RxTx (Rx is receiving, Tx is sending) function in the combined instruction to realize the bidirectional transmission of data. When the device is selected and a Tx command is received, it will return an Rx response packet, which also contains the corresponding combined command to read data. In this case, the execution status of the Tx instruction is stored in the LastError (status of the last command execution) instruction. This instruction is usually used to monitor the running status of the Tx instruction when the RxTx mode is supported in the combined instruction. This parameter can be passed through SysPara1 command to get.

CmdMode(指令特殊模式)指令中的RxTx功能位能够使能组合指令的RxTx功能。当RxTx功能被使能后,组合指令中的的Tx指令(若该指令有效,且有足够有效数据)则总是用Rx应答包进行应答,即使TxData的指令执行有错误。The RxTx function bit in the CmdMode (instruction special mode) instruction enables the RxTx function of the combined instruction. When the RxTx function is enabled, the Tx command in the combined command (if the command is valid and has enough valid data) is always responded with an Rx response packet, even if the execution of the TxData command is wrong.

通过上述方式能够在一组指令中同时发送数据和获取数据,提高通信的效率;同时当有数据需要发送时不会破坏数据采集的等时性。In the above manner, data can be sent and obtained in a set of instructions at the same time, thereby improving the efficiency of communication; at the same time, when there is data to be sent, the isochronism of data collection will not be destroyed.

在双向数据传输过程中,当传输数量高于传输数量阈值时,利用等时传输模式进行双向数据传输。In the bidirectional data transmission process, when the transmission quantity is higher than the transmission quantity threshold, the isochronous transmission mode is used for bidirectional data transmission.

图4为等时传输模式下的数据传输流程图,如图4所示,等时传输是为了在采集数据比较多时提高通信的效率,是正常通信模式的补充,为可选模式。等时通信总是从一个同步包开始计算时隙的时间,两个同步包之间的时间为等时传输的周期。Figure 4 is a flow chart of data transmission in the isochronous transmission mode. As shown in Figure 4, the isochronous transmission is to improve the efficiency of communication when a large amount of data is collected. It is a supplement to the normal communication mode and is an optional mode. Isochronous communication always starts to calculate the time of a time slot from an isochronous packet, and the time between two isochronous packets is the period of isochronous transmission.

等时传输时间片的总时间不能大于整个等时传输周期的70%,在特定的时隙内只能特定地址的设备可以传输数据。在某个时隙x中,只有设备地址是x的设备可以启动数据传输。该设备以Rx应答数据包传输数据,从数据传输开始到数据传输结束的总时间长度不能大于时隙的总时间长度(通常要短传输两个数据字节所需的时间)。The total time of the isochronous transmission time slice cannot be greater than 70% of the entire isochronous transmission period, and only devices with a specific address can transmit data in a specific time slot. In a certain time slot x, only the device whose device address is x can initiate data transfer. The device transmits data in Rx response data packets, and the total time length from the start of data transmission to the end of data transmission cannot be greater than the total time length of the time slot (usually shorter than the time required to transmit two data bytes).

由于总线传输具有延时性,组合指令中RxTx功能的不足在于多个设备收发指令不同步,将特殊广播包功能和等时传输功能组合,能够实现数据接收和发送组合功能,同时能够解决RxTx功能中指令不同步的问题。组合指令RxTx功能的优点在于其灵活性,它必须由主设备主动发送指令,才能实现数据的接收和发送,而特殊广播包和等时传输功能的组合设定好了时隙,只能够定时发送指令。所以组合指令RxTx功能与“等时传输+特殊广播包”功能优缺点互补,各有其价值。Due to the delay of bus transmission, the shortcoming of the RxTx function in the combined command is that the sending and receiving commands of multiple devices are not synchronized. The combination of the special broadcast packet function and the isochronous transmission function can realize the combined function of data reception and transmission, and can solve the RxTx function at the same time. The problem of asynchronous instructions in the middle. The advantage of the combined command RxTx function is its flexibility. It must be actively sent by the master device to receive and send data, while the combination of special broadcast packets and isochronous transmission functions have set time slots and can only be sent regularly. instruction. Therefore, the combined command RxTx function and the "isochronous transmission + special broadcast packet" function have complementary advantages and disadvantages, and each has its own value.

图5为本发明所提供的现场设备间的数字通信传输系统结构图,如图5所示,一种现场设备间的数字通信传输系统,包括:Figure 5 is a structural diagram of a digital communication transmission system between field devices provided by the present invention. As shown in Figure 5, a digital communication transmission system between field devices includes:

设备数据组合指令生成模块501,用于利用设备指令,生成设备数据组合指令;所述设备指令包括设备参数设定指令、从设备运行模式、最后一次命令执行状态指令、设备地址指令、特殊模式指令、存放格式校正指令以及组合数据交换指令。The device data combination instruction generation module 501 is used to generate the device data combination instruction by using the device instruction; the device instruction includes the device parameter setting instruction, the slave device operation mode, the last command execution status instruction, the device address instruction, and the special mode instruction. , store format correction instructions and combined data exchange instructions.

配置模块502,用于在通信校正模式下,利用通信校正指令对所述设备数据组合指令进行配置,确定配置后的组合指令;所述通信校正指令包括全局参数配置指令以及单项参数配置指令;所述配置后的组合指令用于在发送设备数据的同时接收设备数据。The configuration module 502 is configured to configure the device data combination instruction by using the communication correction instruction in the communication correction mode, and determine the configured combination instruction; the communication correction instruction includes a global parameter configuration instruction and a single parameter configuration instruction; The configured combined command is used to receive device data while sending device data.

所述配置模块502,具体包括:The configuration module 502 specifically includes:

全局参数配置单元,用于在通信校正模式下,配置所述设备数据组合指令中的全局参数:A global parameter configuration unit, configured to configure the global parameters in the device data combination instruction in the communication correction mode:

第一步:对所述设备数据组合指令的通道进行配置:将全局参数通道选择位设置为0时,配置完成的的组合指令存储在组合指令数据包0中;将通道选择位设置为1时,配置完成的组合指令存储在组合指令数据包1中;The first step: configure the channel of the device data combination command: when the global parameter channel selection bit is set to 0, the configured combination command is stored in the combination command packet 0; when the channel selection bit is set to 1 , the configured combined instruction is stored in combined instruction data packet 1;

第二步:对特殊广播数据长度配置:当所述设备数据组合指令的特殊广播包被使能后,将特殊广播包的不同字段作为不同设备的数据;The second step: configure the length of special broadcast data: after the special broadcast packet of the device data combination instruction is enabled, use different fields of the special broadcast packet as data of different devices;

第三步:配置读取数据以及写入数据的映射选择位:在读取状态下,主设备向从设备发送配置完成的组合指令后读取从设备数据;在写入状态下,主设备向从设备发送配置完成的组合指令后将主设备数据写入从设备;Step 3: Configure the mapping selection bits for read data and write data: in the read state, the master device sends the configured combined command to the slave device and reads the slave device data; in the write state, the master device sends After the slave device sends the combined command that the configuration is completed, the master device data is written to the slave device;

第四步:配置数据类型个数:设定配置的数据类型个数为n,则配置完成后组合指令中有n种数据组合;Step 4: Configure the number of data types: Set the number of configured data types to n, then there are n data combinations in the combination instruction after the configuration is completed;

单项参数配置单元,用于配置完所述全局参数后,对前n项单项参数进行配置:The single parameter configuration unit is used to configure the first n single parameters after the global parameters are configured:

第一步:配置数据类型:数据类型采用6位编码,当通信系统低于6位编码时,采用间接引用数据类型方式配置数据类型;Step 1: Configure the data type: The data type adopts 6-bit encoding. When the communication system is lower than the 6-bit encoding, the data type is configured by indirect reference data type;

第二步:配置数据的起始数据通道;Step 2: Configure the initial data channel of the data;

第三步:配置数据通道数;Step 3: Configure the number of data channels;

当单项参数配置完成后,确定配置后的组合指令。When the single parameter configuration is completed, the configured combined command is determined.

第一判断模块503,用于判断所述配置后的组合指令中的特殊广播功能位是否允许所述配置后的组合指令的特殊广播功能,得到第一判断结果。The first judgment module 503 is configured to judge whether the special broadcast function bit in the configured combination instruction allows the special broadcast function of the configured combination instruction, and obtain a first judgment result.

特殊广播包传输模块504,用于若所述第一判断结果表示为所述配置后的组合指令中的特殊广播功能位允许所述配置后的组合指令的特殊广播功能,按照所述特殊广播功能进行双向数据传输;所述特殊广播功能用于在一条所述配置后的组合指令中接收应答包持续应答。The special broadcast packet transmission module 504 is configured to, if the first judgment result indicates that the special broadcast function bit in the configured combination command allows the special broadcast function of the configured combination command, according to the special broadcast function Two-way data transmission is performed; the special broadcast function is used to receive a response packet in one of the configured combined instructions and continue to respond.

所述特殊广播包传输模块504,具体包括:当前设备数据确定单元,用于当设备收到的命令为发送数据命令且设备地址为广播地址时,根据所述配置后的组合指令的数据通道、数据长度以及所述存放格式校正指令中的特殊广播数据长度确定当前设备数据;所述数据长度为特殊广播数据长度的整数倍;所述设备为主设备或从设备;特殊广播包传输单元,用于当所述特殊模式指令中的RxTx功能被使能后,传输所述当前设备数据并利用Rx应答包持续应答;所述Rx应答包内包含读取数据的所述配置后的组合指令;Rx为接收,Tx为发送。The special broadcast packet transmission module 504 specifically includes: a current device data determination unit, used for when the command received by the device is a send data command and the device address is a broadcast address, according to the configured data channel of the combined instruction, The data length and the length of the special broadcast data in the storage format correction instruction determine the current device data; the data length is an integer multiple of the length of the special broadcast data; the device is a master device or a slave device; the special broadcast packet transmission unit, with After the RxTx function in the special mode command is enabled, the current device data is transmitted and the Rx response packet is used to continuously respond; the Rx response packet contains the configured combination command for reading data; Rx For reception, Tx for transmission.

双向数据传输模块505,用于若所述第一判断结果表示为所述配置后的组合指令中的特殊广播功能位未允许所述配置后的组合指令的特殊广播功能,利用所述配置后的组合指令的双向数据传输功能进行双向数据传输;所述双向数据传输功能用于在一条所述配置后的组合指令中同时发送数据以及接收数据。The bidirectional data transmission module 505 is configured to, if the first judgment result indicates that the special broadcast function bit in the configured combined command does not allow the special broadcast function of the configured combined command, use the configured special broadcast function. The bidirectional data transmission function of the combined instruction performs bidirectional data transmission; the bidirectional data transmission function is used to send data and receive data simultaneously in one of the configured combined instructions.

所述双向数据传输模块505,具体包括:双向数据传输单元,用于当设备被选址后且所述设备接收到一条Tx命令时,返回一个Rx应答包。The two-way data transmission module 505 specifically includes: a two-way data transmission unit, configured to return an Rx response packet when the device is addressed and the device receives a Tx command.

在双向数据传输过程中,当传输数量高于传输数量阈值时,利用等时传输模式进行双向数据传输。In the bidirectional data transmission process, when the transmission quantity is higher than the transmission quantity threshold, the isochronous transmission mode is used for bidirectional data transmission.

等时传输技术应用在采集数据比较多的情况下,能够提高通信的效率。The application of isochronous transmission technology can improve the efficiency of communication when there is a lot of collected data.

等时传输技术与特殊广播包传输技术相结合,也能够实现数据的双向传输,同时能够解决双向数据传输技术中,设备收到的组合指令TxRx不同步的问题。所以等时传输+特殊广播包传输技术不仅能实现同一条指令在发送数据的同时采集数据的功能,在提高通信带宽利用率的同时,还能保证各个设备收到指令的同步性。The combination of the isochronous transmission technology and the special broadcast packet transmission technology can also realize the bidirectional transmission of data, and at the same time, it can solve the problem that the combined command TxRx received by the device is not synchronized in the bidirectional data transmission technology. Therefore, the isochronous transmission + special broadcast packet transmission technology can not only realize the function of collecting data while sending data for the same command, but also improve the communication bandwidth utilization and ensure the synchronization of each device receiving the command.

本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。对于实施例公开的系统而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same and similar parts between the various embodiments can be referred to each other. For the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant part can be referred to the description of the method.

本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处。综上所述,本说明书内容不应理解为对本发明的限制。The principles and implementations of the present invention are described herein using specific examples. The descriptions of the above embodiments are only used to help understand the method and the core idea of the present invention; meanwhile, for those skilled in the art, according to the present invention There will be changes in the specific implementation and application scope. In conclusion, the contents of this specification should not be construed as limiting the present invention.

Claims (8)

1. A method for transmitting digital communications between field devices, comprising:
generating a device data combination instruction by using the device instruction; the device instruction comprises a device parameter setting instruction, a slave device operation mode, a last command execution state instruction, a device address instruction, a special mode instruction, a storage format correction instruction and a combined data exchange instruction;
in a communication correction mode, configuring the equipment data combination instruction by using a communication correction instruction, and determining the configured combination instruction; the communication correction instruction comprises a global parameter configuration instruction and a single parameter configuration instruction; the configured combination instruction is used for receiving the device data while sending the device data;
judging whether the special broadcast function position in the configured combined instruction allows the special broadcast function of the configured combined instruction or not to obtain a first judgment result;
if the first judgment result shows that the special broadcast function position in the configured combined instruction allows the special broadcast function of the configured combined instruction, performing bidirectional data transmission according to the special broadcast function; the special broadcast function is used for receiving a response packet in a configured combined instruction and continuously responding; the special broadcasting function is that the master equipment sends data packets or instructions to the slave equipment, the slave equipment receives the same data packets or instructions, and each slave equipment finds the corresponding data packets or instructions from the received data packets or instructions and carries out corresponding response; the bidirectional data transmission according to the special broadcasting function specifically includes:
when the command received by the equipment is a data sending command and the equipment address is a broadcast address, determining the current equipment data according to the data channel and the data length of the configured combined instruction and the special broadcast data length in the storage format correction instruction; the data length is integral multiple of the special broadcast data length; the equipment is master equipment or slave equipment;
transmitting the current device data and continuously responding by using an Rx response packet after an RxTx function in the special mode instruction is enabled; the Rx reply packet comprises the configured combination instruction of the read data; rx is receiving and Tx is transmitting;
if the first judgment result indicates that the special broadcast function position in the configured combined instruction does not allow the special broadcast function of the configured combined instruction, performing bidirectional data transmission by using the bidirectional data transmission function of the configured combined instruction; the bidirectional data transmission function is used for simultaneously sending data and receiving data in one configured combined instruction.
2. The method according to claim 1, wherein in the communication calibration mode, the device data combination command is configured by using the communication calibration command, and the determining of the configured combination command specifically includes:
in a communication correction mode, configuring global parameters in the device data combination instruction:
the first step is as follows: configuring a channel of the equipment data combination instruction: when the global parameter channel selection bit is set to 0, the configured combination instruction is stored in a combination instruction data packet 0; when the channel selection bit is set to 1, the configured combined instruction is stored in a combined instruction data packet 1;
the second step is that: configuring the length of special broadcast data: when the special broadcast packet of the equipment data combination instruction is enabled, taking different fields of the special broadcast packet as data of different equipment;
the third step: configuring mapping selection bits of read data and write data: in a reading state, the master device sends a configured combination instruction to the slave device and then reads the data of the slave device; in a writing state, after sending a configured combination instruction to the slave equipment, the master equipment writes the data of the master equipment into the slave equipment;
the fourth step: number of configuration data types: setting the number of the configured data types as n, and then combining n data combinations in the combined instruction after configuration is finished;
after the global parameters are configured, configuring the first n single parameters:
the first step is as follows: the type of configuration data: the data type adopts 6-bit coding, and when the communication system is lower than the 6-bit coding, the data type is configured in an indirect data type reference mode;
the second step is that: configuring a starting data channel of data;
the third step: configuring the number of data channels;
and when the configuration of the single parameter is finished, determining the configured combined instruction.
3. The method according to claim 1, wherein the bidirectional data transmission using the configured bidirectional data transmission function of the combination command includes:
when a device is addressed and the device receives a Tx command, it returns an Rx acknowledgement packet.
4. The method of any one of claims 1-3, wherein during the bi-directional data transmission, when the transmission amount is above the transmission amount threshold, bi-directional data transmission is performed using an isochronous transmission mode.
5. A system for transmitting digital communications between field devices, comprising:
the equipment data combination instruction generation module is used for generating an equipment data combination instruction by using the equipment instruction; the device instruction comprises a device parameter setting instruction, a slave device operation mode, a last command execution state instruction, a device address instruction, a special mode instruction, a storage format correction instruction and a combined data exchange instruction;
the configuration module is used for configuring the equipment data combination instruction by using the communication correction instruction in the communication correction mode and determining the configured combination instruction; the communication correction instruction comprises a global parameter configuration instruction and a single parameter configuration instruction; the configured combination instruction is used for receiving the device data while sending the device data;
the first judging module is used for judging whether the special broadcasting function position in the configured combined instruction allows the special broadcasting function of the configured combined instruction or not to obtain a first judging result;
a special broadcast packet transmission module, configured to perform bidirectional data transmission according to the special broadcast function if the first determination result indicates that the special broadcast function position in the configured combination instruction allows the special broadcast function of the configured combination instruction; the special broadcast function is used for receiving a response packet in a configured combined instruction and continuously responding; the special broadcasting function is that the master equipment sends data packets or instructions to the slave equipment, the slave equipment receives the same data packets or instructions, and each slave equipment finds the corresponding data packets or instructions from the received data packets or instructions and carries out corresponding response; the bidirectional data transmission according to the special broadcasting function specifically includes:
when the command received by the equipment is a data sending command and the equipment address is a broadcast address, determining the current equipment data according to the data channel and the data length of the configured combined instruction and the special broadcast data length in the storage format correction instruction; the data length is integral multiple of the special broadcast data length; the equipment is master equipment or slave equipment;
transmitting the current device data and continuously responding by using an Rx response packet after an RxTx function in the special mode instruction is enabled; the Rx reply packet comprises the configured combination instruction of the read data; rx is receiving and Tx is transmitting;
a bidirectional data transmission module, configured to perform bidirectional data transmission by using a bidirectional data transmission function of the configured combination instruction if the first determination result indicates that the special broadcast function position in the configured combination instruction does not allow the special broadcast function of the configured combination instruction; the bidirectional data transmission function is used for simultaneously sending data and receiving data in one configured combined instruction.
6. The system of claim 5, wherein the configuration module comprises:
a global parameter configuration unit, configured to configure, in the communication correction mode, a global parameter in the device data combination instruction:
the first step is as follows: configuring a channel of the equipment data combination instruction: when the global parameter channel selection bit is set to 0, the configured combination instruction is stored in a combination instruction data packet 0; when the channel selection bit is set to 1, the configured combined instruction is stored in a combined instruction data packet 1;
the second step is that: configuring the length of special broadcast data: when the special broadcast packet of the equipment data combination instruction is enabled, taking different fields of the special broadcast packet as data of different equipment;
the third step: configuring mapping selection bits of read data and write data: in a reading state, the master device sends a configured combination instruction to the slave device and then reads the data of the slave device; in a writing state, after sending a configured combination instruction to the slave equipment, the master equipment writes the data of the master equipment into the slave equipment;
the fourth step: number of configuration data types: setting the number of the configured data types as n, and then combining n data combinations in the combined instruction after configuration is finished;
and the single parameter configuration unit is used for configuring the first n single parameters after the global parameters are configured:
the first step is as follows: the type of configuration data: the data type adopts 6-bit coding, and when the communication system is lower than the 6-bit coding, the data type is configured in an indirect data type reference mode;
the second step is that: configuring a starting data channel of data;
the third step: configuring the number of data channels;
and when the configuration of the single parameter is finished, determining the configured combined instruction.
7. The system of claim 6, wherein the bidirectional data transmission module comprises:
and the bidirectional data transmission unit is used for returning an Rx response packet when the equipment receives a Tx command after the equipment is addressed.
8. The transmission system according to any one of claims 5 to 7, wherein during the bidirectional data transmission, when the transmission amount is above the transmission amount threshold, bidirectional data transmission is performed using an isochronous transmission mode.
CN202011450259.8A 2020-12-09 2020-12-09 A digital communication transmission method and system between field devices Active CN112363479B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011450259.8A CN112363479B (en) 2020-12-09 2020-12-09 A digital communication transmission method and system between field devices

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011450259.8A CN112363479B (en) 2020-12-09 2020-12-09 A digital communication transmission method and system between field devices

Publications (2)

Publication Number Publication Date
CN112363479A CN112363479A (en) 2021-02-12
CN112363479B true CN112363479B (en) 2022-04-08

Family

ID=74536067

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011450259.8A Active CN112363479B (en) 2020-12-09 2020-12-09 A digital communication transmission method and system between field devices

Country Status (1)

Country Link
CN (1) CN112363479B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113824596B (en) * 2021-10-08 2023-05-30 南昌航空大学 A communication layered architecture
CN115484323B (en) * 2022-08-03 2024-12-27 和芯星通科技(北京)有限公司 Verification device and method for multiple instruction protocol codes

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101047715A (en) * 2007-01-18 2007-10-03 宝丽雅智能系统(深圳)有限公司 Data communication coding method
WO2018113432A1 (en) * 2016-12-24 2018-06-28 华为技术有限公司 Broadcast realisation method, apparatus and device
CN108512907A (en) * 2018-03-06 2018-09-07 北京创意博物联科技有限公司 The equipment communication means of half transparent transmission

Family Cites Families (27)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE60041470D1 (en) * 1999-05-11 2009-03-19 Canon Kk Method and apparatus for synchronization between two networks
US7949777B2 (en) * 2002-11-01 2011-05-24 Avid Technology, Inc. Communication protocol for controlling transfer of temporal data over a bus between devices in synchronization with a periodic reference signal
US7231467B2 (en) * 2003-11-17 2007-06-12 Agere Systems Inc. Method and apparatus for providing an inter integrated circuit interface with an expanded address range and efficient priority-based data throughput
CN101208674B (en) * 2005-06-23 2012-07-04 赫优讯自动化系统有限公司 Method and device for data communication of bus subscribers of an open automation system
WO2008029206A2 (en) * 2006-09-05 2008-03-13 Nokia Corporation Device interface
US20090049184A1 (en) * 2007-08-15 2009-02-19 International Business Machines Corporation System and method of streaming data over a distributed infrastructure
US9730078B2 (en) * 2007-08-31 2017-08-08 Fisher-Rosemount Systems, Inc. Configuring and optimizing a wireless mesh network
DE102007061724A1 (en) * 2007-12-20 2009-06-25 Robert Bosch Gmbh Method for transmitting data in a cycle-based communication system
CN201252569Y (en) * 2008-01-24 2009-06-03 北京智强众信科技发展有限公司 Field bus protocol conversion device
GB2482681B (en) * 2010-08-09 2013-01-09 Quadrant Systems Ltd A configurable bridge circuit for integrating a new subsystem with an existing computing environment
CN102170430B (en) * 2011-03-24 2013-06-19 华中科技大学 Multi-port multi-network protocol converter
CN102438301B (en) * 2012-01-11 2014-06-04 深圳市华奥通通信技术有限公司 Wireless communication system and method
US20150201249A1 (en) * 2014-01-10 2015-07-16 Samsung Electronics Co., Ltd. Method and apparatus for receiving broadcasting channel
GB2532950B (en) * 2014-12-02 2017-04-12 Cirrus Logic Int Semiconductor Ltd Digital accessory interface calibration
AT14695U1 (en) * 2015-01-19 2016-04-15 Bachmann Gmbh Serial bus system with coupling modules
CN104836639B (en) * 2015-04-02 2018-04-27 中国科学院信息工程研究所 A kind of data transmission method for transmitting many algorithms parameter
US10127183B2 (en) * 2016-06-30 2018-11-13 Fisher Controls International Llc Systems and methods for provisioning devices operating in industrial automation environments
US10237584B2 (en) * 2017-04-17 2019-03-19 Sony Interactive Entertainment LLC Real-time incorporation of user-generated content into third-party content streams
CN107124405A (en) * 2017-04-21 2017-09-01 杭州知物数据科技有限公司 Industrial Fieldbus protocols conversion method and device are realized based on FPGA
CN108322482A (en) * 2018-03-19 2018-07-24 浙江国自机器人技术有限公司 A kind of method and device of protocol conversion
CN109640391B (en) * 2019-01-29 2021-05-14 中国科学院上海微系统与信息技术研究所 Method for switching synchronous signal and broadcast channel in electric power wireless communication system
CN110879139B (en) * 2019-11-18 2021-05-28 南昌航空大学 A sealing ring test device with deformation error compensation
CN111009172A (en) * 2019-11-18 2020-04-14 南京鼎金信息科技有限公司 Electronic building block programming method and system adopting wireless communication
CN111565170A (en) * 2020-03-24 2020-08-21 深圳市网联通信技术有限公司 Industrial field bus data transmission method, device and system
CN111522765B (en) * 2020-04-14 2024-04-30 江苏三口井信息科技有限公司 Communication system and communication method for serial port circuit with one master and multiple slaves
CN111935815B (en) * 2020-09-15 2021-03-02 深圳市汇顶科技股份有限公司 Synchronous communication method, electronic device, and storage medium
CN112799992B (en) * 2021-02-08 2022-04-01 燕山大学 Fieldbus Chip Architecture

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101047715A (en) * 2007-01-18 2007-10-03 宝丽雅智能系统(深圳)有限公司 Data communication coding method
WO2018113432A1 (en) * 2016-12-24 2018-06-28 华为技术有限公司 Broadcast realisation method, apparatus and device
CN108512907A (en) * 2018-03-06 2018-09-07 北京创意博物联科技有限公司 The equipment communication means of half transparent transmission

Also Published As

Publication number Publication date
CN112363479A (en) 2021-02-12

Similar Documents

Publication Publication Date Title
JP7024047B2 (en) EtherCAT master-slave integrated bridge controller and control method
CN101976074B (en) Industrial control system based on field bus and control network
CN103098419B (en) Method and apparatus for serial data transmission at switchable data rates
US8554863B2 (en) Master and slave system wherein master interface unit compares parameter from payload of parameter obtaining command with communication capability parameter of parameter display unit
US20130080585A1 (en) Method for transmitting data via a canopen bus
CN101707544B (en) E1 channel multidirectional network bridge transmission method
CN112363479B (en) A digital communication transmission method and system between field devices
CN107682247B (en) Efficient communication method for host and multiple slaves
CN110635982B (en) Double-host communication method and system on communication bus, industrial control gateway and storage medium
CN102546070A (en) Method and system for synchronizing a network using existing network cables
JP4571671B2 (en) Method and apparatus for accessing data in message memory of communication module
CN111585697A (en) Communication method, device and multi-module communication system
CN114844415A (en) Motor parameter self-adaption method in CANOPEN mode
CN118210751B (en) Communication method of BMS protocol based on two-in-one of CAN and RS485 bus
JP2008509464A (en) Message handler and method for controlling access to data in message memory of communication module
CN1997012A (en) The digital communication method of the digital control system based on Ethernet technology
CN101841393A (en) PWM (Pulse Width Modulation) input module and MVB (Multifunction Vehicle Bus) equipment based on MVB interface
CN101415027B (en) Communication module based on HDLC protocol, and control method for data real time forwarding and storage
EP1384355B1 (en) Interface circuit
CN202282789U (en) SOE (SERCOS OVER EtherCAT) communication conversion card for servo driver
CN105141483B (en) Multinode network minimal communications measuring space method based on CAN bus
CN117424775A (en) Data interaction method and device, electronic equipment and storage medium
CN202126617U (en) Optical switch control device and control system
CN212061144U (en) Expansion system based on ASI bus
CN116208685A (en) Data conversion system of serial port and network port

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant