Communication rate adjustment method applicable to industrial field bus and industrial control system

By receiving and processing bus communication rate and cycle parameters in the industrial control system, generating rate synchronization packets, and adjusting fieldbus communication rate, the problems of high hardware complexity and low adjustment efficiency in the prior art are solved, and more efficient is achieved communication rate adjustment.

CN119276433BActive Publication Date: 2025-02-18CHINA TECHENERGY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411796759.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-09
Publication Date
2025-02-18
Estimated Expiration
2044-12-09

AI Technical Summary

Technical Problem

In the prior art, when adjusting the communication rate of industrial fieldbus, multiple dial switches need to be configured to increase hardware complexity and cost, and the adjustment process is inefficient and prone to failure.

Method used

The main node receives the bus communication rate parameters and bus communication cycle parameters sent by the engineer station, generates a rate synchronization packet, and adjusts the communication rate and communication cycle of the field bus according to these parameters, without adding hardware structure.

Benefits of technology

It reduces hardware complexity and cost, improves the efficiency of communication rate adjustment, and avoids the problem of failure due to repeated dial switches.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119276433B_ABST
    Figure CN119276433B_ABST
Patent Text Reader

Abstract

The present application provides a communication rate adjustment method and an industrial control system applicable to an industrial field bus, wherein the communication rate and the communication cycle of the field bus are adjusted by a master node according to bus communication rate parameters and bus communication cycle parameters; the master node generates a rate synchronization packet for each slave node according to a pre-agreed synchronization command, a slave node address of each slave node, a bus communication cycle parameter and a first whole packet check value, and sends a corresponding rate synchronization packet to each slave node according to the communication rate and communication cycle of the field bus; the slave node verifies the rate synchronization packet of the slave node; if the verification passes, the slave node is controlled to set the current rate to the communication rate used when the rate synchronization packet is used, and a synchronization confirmation packet is generated to be fed back to the master node, and the communication cycle is determined by using the bus communication cycle parameter in the rate synchronization packet; when the master node verifies the synchronization confirmation packet fed back by the slave node, the slave node's identifier is marked as an in-place identifier.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of industrial field control, and more specifically, to a communication rate adjustment method and an industrial control system applicable to an industrial field bus. Background Art

[0002] In the use of industrial control systems that use industrial fieldbus communication, the bus communication between the master node (master control) and the slave nodes (ordinary IO and remote IO) in the industrial control system often needs to adjust the corresponding communication rate according to the size of the bus load and the needs of the system response time, so as to ensure the reliability of the fieldbus communication while taking into account the rapid transmission of data. However, there are many slave nodes on the fieldbus connected to the master node. Therefore, how to quickly and conveniently adjust the communication rate of the fieldbus according to the needs, that is, how to quickly and conveniently adjust the communication rate of the fieldbus according to the size of the bus load and the needs of the system response time is a problem that needs to be solved urgently.

[0003] In order to adjust the communication rate of the fieldbus, in the prior art, a corresponding number of bits of a DIP switch can be configured according to the number of communication rates supported by the industrial control system, and the technician can adjust the communication rate of the fieldbus by adjusting the switch state of each DIP switch. However, this method requires the configuration of a certain number of DIP switches, which not only increases the complexity of hardware and structural parts, but also increases a certain cost; each time the communication rate of the fieldbus is adjusted, the technician needs to manually modify the switch state of each DIP switch one by one, which not only has a large workload and low efficiency, but also is prone to failure due to repeated toggling of the DIP switch, thereby causing the communication rate to fail to be adjusted. Summary of the invention

[0004] In view of this, the present application provides a communication rate adjustment method and industrial control system suitable for industrial field buses, so as to reduce the complexity of hardware and structural parts, reduce the corresponding costs, reduce the workload of adjusting the communication rate of the industrial field bus and improve the adjustment efficiency, while avoiding the problem of failure of communication rate adjustment caused by repeated toggling of the dip switch in the prior art.

[0005] In a first aspect, the present application provides a communication rate adjustment method applicable to an industrial field bus, which is applied to an industrial control system, wherein the industrial control system includes an engineer station, a switch, a master node, and a plurality of slave nodes, wherein the master node and the slave nodes are connected via a field bus, and the method includes:

[0006] Receiving the bus communication rate parameter and the bus communication cycle parameter sent by the engineer station through the master node, and adjusting the communication rate and the communication cycle of the field bus according to the bus communication rate parameter and the bus communication cycle parameter;

[0007] The master node generates a rate synchronization packet corresponding to each slave node according to a pre-agreed synchronization command, a slave node address of each slave node, a bus communication cycle parameter and a first whole packet check value, and sends a corresponding rate synchronization packet to each slave node according to the communication rate and communication cycle of the field bus; wherein the first whole packet check value of the slave node is generated by the master node according to a calculation formula pre-agreed with the slave node, the slave node address, the synchronization command and the bus communication cycle parameter;

[0008] For each of the slave nodes, receiving, through the slave node, a rate synchronization packet of the slave node sent by the master node, and verifying the received rate synchronization packet of the slave node;

[0009] If the slave node determines that the rate synchronization packet of the slave node has passed the verification, the slave node is controlled to set the current rate to the communication rate used when the rate synchronization packet of the slave node is received, a corresponding synchronization confirmation packet is generated to feed back the synchronization confirmation packet to the master node, and the communication cycle is determined using the bus communication cycle parameter in the rate synchronization packet;

[0010] The master node verifies the synchronization confirmation packet fed back by the slave node, and when it is confirmed that the synchronization confirmation packet has passed the verification, the identifier of the slave node is marked as an in-place identifier.

[0011] Optionally, receiving a bus communication rate parameter and a bus communication cycle parameter sent by an engineer station through the master node, and adjusting the communication rate and communication cycle of the field bus according to the bus communication rate parameter and the bus communication cycle parameter, includes:

[0012] Receiving the bus communication rate parameter and the bus communication cycle parameter sent by the engineer station through the master node, and storing the bus communication rate parameter and the bus communication cycle parameter in an internal non-volatile memory;

[0013] Determining, by the master node, a target communication rate corresponding to the bus communication rate parameter from various preset communication speeds according to the correspondence between the preset bus communication rate parameter and the communication rate, and adjusting the communication rate of the field bus according to the target communication rate;

[0014] The master node determines the target communication cycle corresponding to the bus communication cycle parameters from the preset communication cycles according to the correspondence between the preset bus communication cycle parameters and the communication cycle, and adjusts the communication cycle of the field bus according to the target communication cycle.

[0015] Optionally, for each of the slave nodes, receiving, by the slave node, a rate synchronization packet of the slave node sent by the master node, and verifying the received rate synchronization packet of the slave node includes:

[0016] For each slave node, the slave node is controlled to use a pre-agreed maximum communication cycle as the switching time, and according to the pre-set order of change of each communication speed, a corresponding communication rate is selected from each pre-set communication rate to listen to the rate synchronization packet of the node sent by the master node through the field bus, and the received slave node rate synchronization packet is verified.

[0017] Optionally, the verifying, by the slave node, the received rate synchronization packet of the slave node includes:

[0018] Receiving, by the slave node, a rate synchronization packet of the slave node sent by the master node; wherein the rate synchronization packet includes a slave node address, a synchronization command, a bus communication cycle parameter and a first whole packet check value;

[0019] The slave node generates a second whole packet check value according to the slave node address, synchronization command and bus communication cycle parameters in the rate synchronization packet in accordance with a calculation formula pre-determined with the master node, and when the second whole packet check value is consistent with the first whole packet check value in the rate synchronization packet, and the slave node address in the rate synchronization packet is consistent with the slave node address of the slave node, it is determined that the rate synchronization packet received from the slave node has passed the check.

[0020] Optionally, if the slave node determines that the rate synchronization packet of the slave node has passed verification, controlling the slave node to set the current rate to the communication rate used when receiving the rate synchronization packet of the slave node, generating a corresponding synchronization confirmation packet to feed back the synchronization confirmation packet to the master node, and determining the communication cycle using the bus communication cycle parameter in the rate synchronization packet, including:

[0021] If the slave node determines that the rate synchronization packet of the slave node has passed the verification, control the slave node to lock the communication rate used when receiving the rate synchronization packet of the slave node, and set the current communication rate to the locked communication rate, so that the slave node communicates with the master node based on the locked communication rate;

[0022] Generate a corresponding synchronization confirmation packet through the slave node, and feed back the synchronization confirmation packet to the master node;

[0023] The slave node is controlled to lock the bus communication cycle parameters in the rate synchronization packet of the slave node, so that the slave node uses the locked bus communication cycle parameters as a basis for subsequent communication cycle diagnosis.

[0024] Optionally, generating a corresponding synchronization confirmation packet by the slave node and feeding back the synchronization confirmation packet to the master node includes:

[0025] Generate corresponding synchronization confirmation information through the slave node, and generate a third whole-packet check value according to the slave node address of the slave node and the synchronization confirmation information according to a calculation formula pre-agreed with the master node;

[0026] The slave node generates a corresponding synchronization confirmation packet according to the slave node address of the slave node, the synchronization confirmation information and the third whole packet check value, and feeds back the synchronization confirmation packet to the master node.

[0027] Optionally, verifying the synchronization confirmation packet fed back by the slave node through the master node, and marking the identifier of the slave node as an in-place identifier when confirming that the synchronization confirmation packet has passed the verification, includes:

[0028] Receiving the synchronization confirmation packet fed back by the slave node through the master node;

[0029] The master node generates a corresponding fourth whole-packet verification value according to the calculation formula pre-agreed with the slave node and the slave node address and the synchronization confirmation information in the synchronization confirmation packet, and when the fourth whole-packet verification value is consistent with the third whole-packet verification value in the synchronization confirmation packet, it is determined that the synchronization confirmation packet feedback by the slave node has passed the verification, and the identifier of the slave node is marked as an in-place identifier.

[0030] Optionally, the method further includes:

[0031] When it is detected that the master node is restarted, the master node is controlled to be initialized, so that the master node clears the identification of all slave nodes marked as in-place identification, and loads the bus communication rate parameters and the bus communication cycle parameters from the internal non-volatile memory, and executes the step of adjusting the communication rate and communication cycle of the field bus according to the bus communication rate parameters and the bus communication cycle parameters.

[0032] Optionally, the method further includes:

[0033] For each of the slave nodes, during the normal operation of the industrial control system, the slave node detects in real time whether it is restarted;

[0034] When the slave node detects that it has restarted, the slave node controls itself to reset and then initialize to complete the corresponding restart operation;

[0035] The master node detects the identifier of the slave node in real time;

[0036] When the master node detects that the identifier of the slave node is not a presence identifier, the master node sends a corresponding rate synchronization packet to the slave node according to the communication rate and communication cycle of the field bus.

[0037] A second aspect of the present application provides an industrial control system, the industrial control system comprising an engineer station, a switch, a master node and a plurality of slave nodes, the master node and the slave nodes being connected via a field bus;

[0038] The master node is used to receive bus communication rate parameters and bus communication cycle parameters sent by the engineer station, and adjust the communication rate and communication cycle of the field bus according to the bus communication rate parameters and the bus communication cycle parameters; generate a rate synchronization packet corresponding to each slave node according to a pre-agreed synchronization command, the slave node address of each slave node, the bus communication cycle parameters and the first whole packet check value, and send a corresponding rate synchronization packet to each slave node according to the communication rate and communication cycle of the field bus; wherein the first whole packet check value of the slave node is generated by the master node according to the calculation formula pre-agreed with the slave node, according to the slave node address, the synchronization command and the bus communication cycle parameters; verify the synchronization confirmation packet fed back by the slave node, and when it is confirmed that the synchronization confirmation packet check has passed, mark the identifier of the slave node as an in-place identifier;

[0039] The slave node is used to receive the rate synchronization packet of the slave node sent by the master node, and to verify the received rate synchronization packet of the slave node; if the slave node determines that the rate synchronization packet of the slave node has passed the verification, the current rate is set to the communication rate used when the rate synchronization packet of the slave node is received, a corresponding synchronization confirmation packet is generated to feed back the synchronization confirmation packet to the master node, and the communication cycle is determined using the bus communication cycle parameters in the rate synchronization packet.

[0040] The present application provides a communication rate adjustment method and an industrial control system suitable for an industrial field bus. The industrial control system includes an engineer station, a switch, a master node and multiple slave nodes. The master node and the slave nodes are connected via a field bus. The master node receives bus communication rate parameters and bus communication cycle parameters sent by the engineer station, and adjusts the communication rate and communication cycle of the field bus according to the bus communication rate parameters and bus communication cycle parameters. There is no need to increase the corresponding hardware structure, which can not only reduce the complexity of the structural parts, but also reduce a certain cost; and the entire adjustment process does not require manual intervention, which can not only reduce the workload of the staff and improve the adjustment efficiency of the bus communication rate, but also effectively avoid the failure of the communication rate adjustment caused by repeated toggling of the dip switch; after adjusting the communication rate and communication cycle of the field bus, the master node can pre-agreed with the same The master node detects and receives the rate synchronization packet of the slave node sent by the master node, and verifies the rate synchronization packet of the slave node detected to ensure that the slave node can receive the correct and complete rate synchronization packet; when the slave node determines that the rate synchronization packet of the slave node has passed the verification, the slave node sets the current rate to the communication rate used when receiving the rate synchronization packet of the slave node, generates a corresponding synchronization confirmation packet, feeds back the synchronization confirmation packet to the master node, and determines the communication cycle by using the bus communication cycle parameter in the rate synchronization packet; the master node verifies the synchronization confirmation packet fed back by the slave node, and when the verification passes, marks the slave node's identifier as an in-place identifier. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0042] Figure 1 A schematic diagram of the structure of an industrial control system provided in an embodiment of the present application;

[0043] Figure 2 A flow chart of a communication rate adjustment method applicable to an industrial field bus provided in an embodiment of the present application;

[0044] Figure 3 A schematic diagram of a data synchronization process after a master node is started provided in an embodiment of the present application;

[0045] Figure 4 A schematic diagram of a data synchronization process after a slave node is started provided in an embodiment of the present application;

[0046] Figure 5 An exemplary diagram of a communication rate adjustment method applicable to an industrial field bus provided in an embodiment of the present application. DETAILED DESCRIPTION

[0047] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0048] In this application, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.

[0049] See also Figure 1 , shows a schematic diagram of the structure of an industrial control system provided by an embodiment of the present application, the industrial control system includes an engineer station 1, a switch 2, a master node 3 and multiple slave nodes (4~N), wherein N is a positive integer greater than 5, the engineer station 1 communicates with the switch 2 via a network, the switch 2 communicates with the master node 3 via a network, and the master node 3 and each slave node (4~N) communicate via a field bus. The field bus may be RS485, Profibus, CAN, Modbus, etc., which is not limited in the embodiment of the present application.

[0050] The master node is used to receive the bus communication rate parameters and bus communication cycle parameters sent by the engineer station, and adjust the communication rate and communication cycle of the field bus according to the bus communication rate parameters and bus communication cycle parameters; generate a rate synchronization package corresponding to each slave node according to a pre-agreed synchronization command, the slave node address of each slave node, the bus communication cycle parameters and the first whole package check value, and send the corresponding rate synchronization package to each slave node according to the communication rate and communication cycle of the field bus; wherein the first whole package check value of the slave node is generated by the master node according to the calculation formula pre-agreed with the slave node, according to the slave node address, the synchronization command and the bus communication cycle parameters; the master node verifies the synchronization confirmation package fed back by the slave node, and when it is confirmed that the synchronization confirmation package has passed the verification, the slave node identifier is marked as an in-place identifier;

[0051] The slave node is used to receive the rate synchronization packet of the slave node sent by the master node and verify the received rate synchronization packet of the slave node; if the slave node determines that the rate synchronization packet of the slave node has passed the verification, the current rate is set to the communication rate used when the rate synchronization packet of the slave node is received, and a corresponding synchronization confirmation packet is generated to feed back the synchronization confirmation packet to the master node, and the communication cycle is determined using the bus communication cycle parameters in the rate synchronization packet.

[0052] The industrial control system provided by the present application receives the bus communication rate parameters and bus communication cycle parameters sent by the engineer station through the master node, and adjusts the communication rate and communication cycle of the field bus according to the bus communication rate parameters and the bus communication cycle parameters, without adding the corresponding hardware structure, which can not only reduce the complexity of the structural parts, but also reduce a certain cost; and the entire adjustment process does not require manual intervention, which can not only reduce the workload of the staff and improve the adjustment efficiency of the bus communication rate, but also effectively avoid the failure of the communication rate adjustment caused by repeated toggling of the dip switch; after adjusting the communication rate and communication cycle of the field bus, the master node can generate the rate synchronization corresponding to each slave node based on the pre-agreed synchronization command, the slave node address of each slave node, the bus communication cycle parameters and the first whole packet check value. Package, and send the corresponding rate synchronization package to each slave node according to the communication rate and communication cycle of the field bus, so that the slave node receives the rate synchronization package of the slave node sent by the master node; the slave node receives the rate synchronization package for the slave node sent by the master node, and verifies the received rate synchronization package of the slave node to ensure that the slave node can receive the correct and complete rate synchronization package; when the slave node determines that the rate synchronization package of the slave node has passed the verification, the slave node controls the slave node to set the current rate to the communication rate used when receiving the rate synchronization package of the slave node, generates a corresponding synchronization confirmation package, and feeds back the synchronization confirmation package to the master node, and uses the bus communication cycle parameters in the rate synchronization package to determine the communication cycle; the master node verifies the synchronization confirmation package fed back by the slave node, and when the verification passes, marks the slave node's identifier as an in-place identifier.

[0053] Optionally, a master node that receives bus communication rate parameters and bus communication cycle parameters sent by an engineer station and adjusts the communication rate and communication cycle of the field bus according to the bus communication rate parameters and the bus communication cycle parameters is specifically used for:

[0054] Receive the bus communication rate parameter and the bus communication cycle parameter sent by the engineer station, and store the bus communication rate parameter and the bus communication cycle parameter in the internal non-volatile memory; determine the target communication rate corresponding to the bus communication rate parameter from various pre-set communication speeds according to the correspondence between the pre-set bus communication rate parameter and the communication rate, and adjust the communication rate of the field bus according to the target communication rate; determine the target communication cycle corresponding to the bus communication cycle parameter from various pre-set communication cycles according to the correspondence between the pre-set bus communication cycle parameter and the communication cycle, and adjust the communication cycle of the field bus according to the target communication cycle.

[0055] Optionally, the slave node that receives the rate synchronization packet of the slave node sent by the master node and verifies the received rate synchronization packet of the slave node is specifically used for:

[0056] Taking the pre-agreed maximum communication cycle as the switching time, according to the pre-set order of change of each communication speed, the corresponding communication rate is selected from the pre-set communication rates to listen to the rate synchronization packet of the node sent by the master node through the field bus, and the received slave node rate synchronization packet is verified.

[0057] Optionally, the slave node that verifies the received rate synchronization packet of the slave node is specifically used for:

[0058] By receiving the rate synchronization packet of the slave node sent by the master node; wherein the rate synchronization packet includes the slave node address, synchronization command, bus communication cycle parameters and a first whole packet check value; generating a second whole packet check value according to the slave node address, synchronization command and bus communication cycle parameters in the rate synchronization packet according to a calculation formula predetermined with the master node, and when the second whole packet check value is consistent with the first whole packet check value in the rate synchronization packet, and the slave node address in the rate synchronization packet is consistent with the slave node address of the slave node, determining that the received slave node rate synchronization packet has passed the check.

[0059] Optionally, if the slave node determines that the rate synchronization packet of the slave node has passed the verification, the current rate is set to the communication rate used when the rate synchronization packet of the slave node is received, and a corresponding synchronization confirmation packet is generated to feedback the slave node of the synchronization confirmation packet to the master node, and the bus communication cycle parameter in the rate synchronization packet is used to determine the communication cycle, which is specifically used for:

[0060] If the slave node determines that the rate synchronization packet of the slave node has passed the verification, it locks the communication rate used when the rate synchronization packet of the slave node is received, and sets the current communication rate to the locked communication rate setting, so that the slave node communicates with the master node based on the locked communication rate; generates a corresponding synchronization confirmation packet, and feeds back the synchronization confirmation packet to the master node; locks the bus communication cycle parameters in the rate synchronization packet of the slave node, so that the slave node uses the locked bus communication cycle parameters as the basis for subsequent communication cycle diagnosis.

[0061] Optionally, a slave node that generates a corresponding synchronization confirmation packet and feeds back the synchronization confirmation packet to the master node is specifically used for:

[0062] Generate corresponding synchronization confirmation information, and generate a third whole package verification value according to the slave node address and the synchronization confirmation information of the slave node based on the calculation formula pre-agreed with the master node; generate a corresponding synchronization confirmation packet according to the slave node address, the synchronization confirmation information and the third whole package verification value of the slave node, and feed the synchronization confirmation packet back to the master node.

[0063] Optionally, the synchronization confirmation packet fed back by the slave node is verified. When the synchronization confirmation packet is verified, the slave node is marked as the master node with the in-place identification, which is specifically used for:

[0064] Receive the synchronization confirmation packet fed back by the slave node; generate a corresponding fourth whole packet verification value according to the slave node address and the synchronization confirmation information in the synchronization confirmation packet based on the calculation formula pre-agreed with the slave node, and when the fourth whole packet verification value is consistent with the third whole packet verification value in the synchronization confirmation packet, determine that the synchronization confirmation packet fed back by the slave node has passed the verification, and mark the slave node's identifier as an in-place identifier.

[0065] Optionally, the master node is also used to:

[0066] When the master node restart is detected, initialization is performed, the identification of all slave nodes marked as in-place identification is cleared, and the bus communication rate parameters and bus communication cycle parameters are loaded from the internal non-volatile memory, and the step of adjusting the communication rate and communication cycle of the field bus according to the bus communication rate parameters and bus communication cycle parameters is executed.

[0067] Optionally, slave nodes are also used to:

[0068] During the normal operation of the industrial control system, it detects in real time whether it has restarted. When the slave node detects that it has restarted, it resets itself and initializes to complete the corresponding restart operation.

[0069] Correspondingly, the master node is also used to detect the identification of the slave node in real time; when the identification of the master node is not an in-place identification, the step of periodically sending the corresponding rate synchronization packet to the slave node through the master node according to the communication rate and communication cycle of the field bus is executed.

[0070] based on Figure 1 The industrial control system shown in FIG. 1 is a control system for controlling a communication rate of an industrial field bus. Accordingly, the present application embodiment provides a communication rate adjustment method applicable to an industrial field bus. Figure 2 As shown, applied to Figure 1 The industrial control system shown, the communication rate adjustment method applicable to the industrial field bus specifically comprises the following steps:

[0071] S201: receiving the bus communication rate parameters and bus communication cycle parameters sent by the engineer station through the master node, and adjusting the communication rate and communication cycle of the field bus according to the bus communication rate parameters and bus communication cycle parameters.

[0072] In an embodiment of the present application, the various communication rates supported by the industrial control system can be determined first, and the bus communication rate parameters corresponding to each communication rate can be set, and finally the correspondence between each communication rate and its corresponding bus communication rate parameters can be set; multiple communication cycles and their corresponding bus communication cycle parameters can be pre-set, and the correspondence between each communication cycle and its corresponding bus cycle can be set; so that when the master node receives the bus communication rate parameters and bus communication cycle parameters sent by the engineering station, it can adjust the communication rate and communication cycle of the field bus according to the received bus communication rate parameters and bus communication cycle parameters, combined with the pre-set correspondence between the communication rate and the bus communication rate parameters and the pre-set correspondence between the communication cycle and the bus communication cycle parameters, and at the same time, the "in-place flag" of all slave nodes can be cleared.

[0073] In actual application, the "in-place flag" of all slave nodes is cleared, that is, the flags of all slave nodes retained in the master node are changed from "in-place flag" to "out-of-place flag", so that the subsequent master node can synchronize the corresponding slave nodes according to the flags of each slave node.

[0074] It should be noted that when it is detected that the application situation of the actual project at the industrial site has changed, in order to adapt to the application situation of the actual project, the communication rate and communication cycle of the field bus of the industrial control system need to be adjusted, and then the communication rate and communication cycle required for the field bus of the industrial control system can be determined according to the application situation of the actual project, and the bus communication rate parameters corresponding to the communication cycle required by the field bus and the bus communication cycle parameters corresponding to the required communication cycle are determined according to the correspondence between the preset communication rate and the bus communication rate parameters and the correspondence between the preset communication cycle and the bus communication cycle parameters. Finally, the determined bus communication rate parameters and bus communication cycle parameters are sent to the master node through the network interface using the maintenance software in the engineer station.

[0075] For example, taking the RS485 bus as the field bus in the industrial control system, assuming that the industrial control system supports 8 bus communication rates, namely: 0.5MHz, 1MHz, 2MHz, 4MHz, 6MHz, 8MHz, 10MHz, and 12MHz; then the bus communication rate parameter corresponding to 0.5MHz can be set to 000, the bus communication rate parameter corresponding to 1MHz can be set to 001, the bus communication rate parameter corresponding to 2MHz can be set to 010, the bus communication rate parameter corresponding to 4MHz can be set to 011, the bus communication rate parameter corresponding to 6MHz can be set to 100, the bus communication rate parameter corresponding to 8MHz can be set to 101, the bus communication rate parameter corresponding to 10MHz can be set to 110, and the bus communication rate parameter corresponding to 12MHz can be set to 111.

[0076] It can be seen that sending the bus communication rate parameters and bus communication cycle parameters to the master node through the engineering station instead of directly sending the corresponding communication rate and communication cycle can not only effectively avoid the conversion of data format and data accuracy, but also simplify the corresponding code design at the software level, improve the readability and maintainability of the code, and enable the software to better communicate with the underlying hardware without having to deeply understand the complex physical layer details.

[0077] Optionally, the process of receiving the bus communication rate parameters and bus communication cycle parameters sent by the engineer station through the master node, and adjusting the communication rate and communication cycle of the field bus according to the bus communication rate parameters and the bus communication cycle parameters can be specifically as follows: receiving the bus communication rate parameters and bus communication cycle parameters sent by the engineer station through the master node; determining, through the master node, a target communication rate corresponding to the bus communication rate parameters from various pre-set communication speeds according to a correspondence between the pre-set bus communication rate parameters and the communication rate, and adjusting the communication rate of the field bus according to the target communication rate; determining, through the master node, a target communication cycle corresponding to the bus communication cycle parameters from various pre-set communication cycles according to a correspondence between the pre-set bus communication cycle parameters and the communication cycle, and adjusting the communication cycle of the field bus according to the target communication cycle.

[0078] It should be noted that by pre-setting the correspondence between each communication rate supported by the industrial control system and its corresponding bus communication rate parameter, after the master node receives the bus communication rate parameter and the bus communication cycle parameter sent by the engineer station, the correspondence between the pre-set communication rate and the bus communication rate parameter and the correspondence between the pre-set communication cycle and the bus communication cycle parameter determine the target communication rate and target communication cycle corresponding to the field bus, and set the communication rate of the field bus to the target communication rate, and set the communication cycle of the field bus to the target communication cycle, so as to achieve the adjustment of the communication rate and communication cycle of the field bus without adding the corresponding hardware structure, which can not only reduce the complexity of the structural parts, but also reduce a certain cost; and the entire adjustment process does not require manual intervention, which can not only reduce the workload of the staff and improve the adjustment efficiency of the bus communication rate, but also effectively avoid the failure of the communication rate adjustment caused by repeated toggling of the dip switch.

[0079] For example, taking the field bus as RS485 bus, assuming that the industrial control system supports 8 bus communication rates, namely: 0.5MHz, 1MHz, 2MHz, 4MHz, 6MHz, 8MHz, 10MHz, 12MHz; and then the bus communication rate parameters can be set respectively as: 000, 001, 010, 011, 100, 101, 110, 111. When the required field bus communication rate is determined to be 1MHz according to the application of the actual project, the corresponding bus communication rate parameter is determined to be 001 according to the correspondence between the preset communication rate and the bus communication rate parameter, and then the determined bus communication rate parameter (001) is sent to the master node through the network interface using the maintenance software in the engineer station; after receiving the bus communication rate parameter (001) sent by the engineer, the master node determines the target communication rate corresponding to the bus communication rate parameter as 1MHz according to the correspondence between the preset communication rate and the bus communication rate parameter, and then the field bus communication rate can be set to 1MHz. The process of adjusting the communication cycle of the field bus may refer to the process of adjusting the communication rate of the field bus, which will not be described in detail in the embodiments of the present application.

[0080] Furthermore, in an embodiment of the present application, after receiving the bus communication rate parameters and bus normal cycle parameters sent by the engineering station, the master node may also write the bus communication rate parameters and bus normal cycle parameters into an internal non-volatile memory (for example, EEPROM or FLASH) before adjusting the communication rate and communication cycle of the field bus according to the bus communication rate parameters and bus communication cycle parameters, and when adjusting the communication rate and communication cycle of the field bus, load the corresponding bus communication rate parameters and bus communication cycle parameters from the internal non-volatile memory so as to adjust the communication rate and communication cycle of the field bus according to the loaded bus communication rate parameters and bus communication cycle parameters.

[0081] It should be noted that the master node first stores the received bus communication rate parameters and bus communication cycle parameters into the internal non-volatile memory, and then loads the corresponding bus communication rate parameters and bus communication cycle parameters from the internal non-volatile memory when adjusting the communication rate and communication cycle of the field bus. This not only ensures that the local area can correctly receive and save the corresponding setting information throughout the process, but also can restore the bus communication rate parameters and bus communication cycle parameters received before the master node is restarted or powered off after an abnormal restart or accidental power outage of the industrial control system.

[0082] S202: The master node generates a rate synchronization packet corresponding to each slave node according to a pre-agreed synchronization command, the slave node address of each slave node, the bus communication cycle parameters and the first whole packet check value, and sends the corresponding rate synchronization packet to each slave node according to the communication rate and communication cycle of the field bus; wherein the first whole packet check value is generated by the master node according to the calculation formula pre-agreed with the slave node, according to the slave node address, the synchronization command and the bus communication cycle parameters.

[0083] In the process of specifically executing step S202, after the master node adjusts the communication rate and communication cycle of the field bus, for each slave node, it can generate a corresponding first whole packet check value according to the slave node address, synchronization command and bus communication cycle parameters of the slave node based on the calculation formula pre-determined with the slave node, and generate a rate synchronization packet of the slave node according to the slave node address, synchronization command, bus communication cycle parameters and the first whole packet check value of the slave node, and finally send the corresponding rate synchronization packet to each slave node in turn through the field bus according to the adjusted communication rate and communication cycle.

[0084] It should be noted that the master node can, based on the calculation formula agreed upon in advance with the slave node and in accordance with the byte order in the rate synchronization packet, substituted all bytes before the first whole-packet check value into the formula in sequence to calculate the corresponding first whole-packet check value; that is, the slave node address, synchronization command and bus communication cycle parameters of the slave node are substituted into the calculation formula agreed upon with the slave node to calculate the corresponding first whole-packet check value.

[0085] It should also be noted that the pre-determined calculation formula can be a CRC formula, and accordingly, the first whole packet check value calculated based on the calculation formula can be a CRC check value; wherein, the pre-set calculation formula can also be CRC8, CRC16, CRC32, CRC64 or other check formulas such as sum check, and the calculation formula predetermined by the master node and the slave node can be set according to actual applications, and this is not limited in the embodiments of the present application.

[0086] S203: For each slave node, the slave node receives the rate synchronization packet of the slave node sent by the master node, and verifies the received rate synchronization packet of the slave node; if it is determined that the rate synchronization packet of the slave node passes the verification, execute step S204.

[0087] In the specific execution process of step S203, for each slave node, the slave node uses the system maximum communication cycle agreed in advance with the industrial control system as the switching time, and controls the slave node to periodically change in turn according to the pre-set order of change of each communication rate and the maximum communication cycle, and listens to the master node through the field bus according to the adjusted communication rate and communication cycle to send the rate synchronization packet of the slave node; when the slave node listens to the rate synchronization packet sent by the master node to the slave node, it verifies the received rate synchronization packet according to the slave node address, synchronization command, bus communication cycle parameter and the first whole packet check value in the received rate synchronization packet; when it is determined that the verification of the received rate synchronization packet passes, execute step S204; when it is determined that the verification of the rate synchronization packets received within this switching time has not passed, the communication rate can be changed in the agreed order within the next switching time to continue to listen to the master node to send the rate synchronization packet of the slave node until it is determined that the verification of the received rate synchronization packet passes, and then execute step S204.

[0088] Optionally, the slave node can be controlled to use a pre-agreed maximum communication cycle as the switching time, and select a corresponding communication rate from the pre-set communication rates according to the pre-set order of change of each communication speed to listen to the rate synchronization packet of the node sent by the master node through the field bus, and verify the received slave node rate synchronization packet.

[0089] Specifically, the slave node can be controlled to use the maximum communication cycle as the switching time. Each time the corresponding switching time is reached, a communication rate is selected from the pre-set communication rates according to the pre-set change order of the communication rates, and the rate synchronization packet of the slave node sent by the master node through the field bus is listened to according to the selected communication rate, and the received slave node rate synchronization packet is verified.

[0090] In some embodiments, taking the field bus as RS485 bus as an example, assuming that the industrial control system supports 8 bus communication rates, namely: 0.5MHz, 1MHz, 2MHz, 4MHz, 6MHz, 8MHz, 10MHz, and 12MHz; the corresponding bus communication rate parameters are set as: 000, 001, 010, 011, 100, 101, 110, and 111; for each slave node, the slave node uses the system maximum communication cycle agreed in advance with the industrial control system as the switching time, and follows the order of 0.5MHz, 1MHz to 12MHz, and then cycles to 0.5MHz, 1MHz to 12MHz, cycles, and continuously listens to the rate synchronization packet sent by the master node to the slave node through the field bus, and verifies the rate synchronization packet sent by the master node to the slave node.

[0091] Optionally, the process of receiving a rate synchronization packet of a slave node sent by a master node by a slave node and verifying the received rate synchronization packet of the slave node can be specifically as follows: receiving a rate synchronization packet of a slave node sent by a master node by a slave node; wherein the rate synchronization packet includes a slave node address, a synchronization command, a bus communication cycle parameter and a first whole packet verification value; generating a second whole packet verification value by the slave node according to a calculation formula pre-determined with the master node according to the slave node address, the synchronization command and the bus communication cycle parameter in the rate synchronization packet, and when the second whole packet verification value is consistent with the first whole packet verification value in the rate synchronization packet, and the slave node address in the rate synchronization packet is consistent with the slave node address of the slave node, it is determined that the received rate synchronization packet of the slave node has passed the verification.

[0092] It should be noted that since the calculation formula and data (slave node address, synchronization command and bus communication cycle parameters) used by the master node in calculating the first whole packet check value and the slave node in calculating the second whole packet check value are the same, if the second whole packet check value generated by the slave node based on the calculation formula pre-determined with the master node according to the slave node address, synchronization command and bus communication cycle parameters in the rate synchronization packet is consistent with the first whole packet check value in the rate synchronization packet received by the slave node, and the slave node address in the rate synchronization packet is consistent with the slave node address of the slave node, it means that the rate synchronization packet received by the slave node is sent to itself and is complete and correct, and the communication rate used when the rate synchronization packet is currently intercepted can be locked, and the current interception is terminated; if it is determined that the second whole packet check value is inconsistent with the first whole packet check value in the received rate synchronization packet, and / or the slave node address in the rate synchronization packet is inconsistent with the slave node address of the current slave node, it means that the rate synchronization packet received according to the currently intercepted communication rate is incomplete or erroneous or is not from the current slave node, and it is necessary to continue to listen to subsequent rate synchronization packets sent by the master node, or switch to other rates and try again.

[0093] In actual application, for each slave node, after the slave node receives the rate synchronization packet of the slave node sent by the master node, a second whole packet check value is calculated based on the calculation formula agreed with the master node according to the slave node location, synchronization command and bus communication cycle parameters in the rate synchronization packet; and it is determined whether the calculated second whole packet check value is consistent with the first whole packet check value in the received rate synchronization packet, and whether the slave node address in the rate synchronization packet is consistent with the slave node address of this slave node; if it is determined that the second whole packet check value is consistent with the first whole packet check value in the received rate synchronization packet, and the slave node address in the rate synchronization packet is consistent with the slave node address of this slave node, it is determined that the received rate synchronization packet has passed the check, and then it can be Execute step S204 to generate a corresponding synchronization confirmation packet and feed back the corresponding synchronization confirmation packet to the master node; if it is determined that the second whole packet check value is inconsistent with the first whole packet check value in the received rate synchronization packet, and / or the slave node address in the rate synchronization packet is inconsistent with the slave node address of the current slave node, it is determined that the received rate synchronization packet is inconsistent, or the received rate synchronization packet is not the rate synchronization packet of the slave node, then the slave node is controlled to continue to listen to the rate synchronization packet sent by the master node to the slave node at the current communication rate before the end of this cycle, and switch to the next communication rate after the end of this cycle to continue listening to the rate synchronization packet sent by the master node to the slave node, until the appropriate communication rate is rotated to successfully receive the rate synchronization packet of the slave node.

[0094] S204: Control the slave node to set the current rate to the communication rate used when receiving the rate synchronization packet of the slave node, generate a corresponding synchronization confirmation packet to feed back the synchronization confirmation packet to the master node, and determine the communication cycle using the bus communication cycle in the rate synchronization packet.

[0095] In the specific process of executing step S204, for each slave node, when determining that the received rate synchronization packet has passed the verification, the slave node can determine the communication rate used when receiving the rate synchronization packet, and lock the communication rate used when receiving the rate synchronization packet and the communication cycle parameters in the rate synchronization packet, so as to set the locked communication rate as the subsequent communication rate for communication with the master node and use the locked communication cycle parameters as the basis for the subsequent diagnosis of the communication cycle by the slave node; generate corresponding synchronization confirmation information, so as to generate a corresponding synchronization confirmation packet according to its own slave node address and synchronization confirmation information, and feed back the generated synchronization confirmation packet to the master node.

[0096] Optionally, if the slave node determines that the rate synchronization packet of the slave node has passed the verification, the slave node is controlled to lock the communication rate used when receiving the rate synchronization packet of the slave node, and the current communication rate is set to the locked communication rate, so that the slave node communicates with the master node based on the locked communication rate; the corresponding synchronization confirmation packet is generated by the slave node, and the synchronization confirmation packet is fed back to the master node; the slave node is controlled to lock the bus communication cycle parameters in the rate synchronization packet of the slave node, so that the slave node uses the locked bus communication cycle parameters as the basis for subsequent communication cycle diagnosis.

[0097] As a preferred method of an embodiment of the present application, the process of generating a corresponding synchronization confirmation packet by a slave node and feeding back the synchronization confirmation packet to the master node can specifically be: generating corresponding synchronization confirmation information by the slave node, and generating a third whole packet verification value according to the slave node address and the synchronization confirmation information of the slave node based on a calculation formula pre-agreed with the master node; generating a corresponding synchronization confirmation packet by the slave node according to the slave node address, the synchronization confirmation information and the third whole packet verification value of the slave node, and feeding back the synchronization confirmation packet to the master node.

[0098] In actual application, for each slave node, when the slave node determines that the received rate synchronization check has passed, it can generate corresponding synchronization confirmation information, and calculate the third whole packet verification value based on its own slave node address field and synchronization confirmation information field based on the calculation formula pre-agreed with the master node, so as to generate corresponding synchronization confirmation information based on its own slave node address, synchronization confirmation information and the third whole packet verification value, and send the generated synchronization confirmation information to the master node.

[0099] S205: When the master node verifies the synchronization confirmation packet fed back by the slave node and it passes, the identifier of the slave node is marked as an in-place identifier.

[0100] In the specific process of executing step S205, after receiving the synchronization confirmation packet fed back by the slave node, the master node can verify the received synchronization confirmation packet according to the slave node address, synchronization confirmation information and the third whole packet verification value in the received synchronization confirmation packet; if it is determined that the verification of the received synchronization confirmation packet passes, the identifier of the slave node is marked as an "in-place identifier" and the corresponding rate synchronization packet is stopped from being sent to the slave node; if it is determined that the verification of the received synchronization confirmation packet fails, the corresponding rate synchronization packet is continued to be sent to the slave node through the field bus according to the adjusted communication rate and communication cycle.

[0101] Optionally, when the synchronization confirmation packet fed back by the slave node is verified by the master node, the process of marking the identifier of the slave node as the "in-place identifier" can be specifically as follows: the synchronization confirmation packet fed back by the slave node is received by the master node; the master node generates a corresponding fourth whole packet verification value according to the slave node address and the synchronization confirmation information in the synchronization confirmation packet based on a calculation formula pre-agreed with the slave node, and when the fourth whole packet verification value is consistent with the third whole packet verification value in the synchronization confirmation packet, it is determined that the synchronization confirmation packet fed back by the slave node has passed the verification, and the identifier of the slave node is marked as the "in-place identifier"; if it is determined that the verification of the received synchronization confirmation packet has not passed, continue to send the corresponding rate synchronization packet to the slave node through the field bus according to the adjusted communication rate and communication cycle.

[0102] It should be noted that since the calculation formula and data (slave node address field and synchronization confirmation information field) used by the master node in calculating the fourth whole packet check value and the slave node in calculating the third whole packet check value are the same, if the fourth whole packet check value generated by the master node based on the calculation formula pre-determined with the slave node according to the slave node address and synchronization confirmation information in the received synchronization confirmation packet is consistent with the third whole packet check value in the synchronization confirmation packet received by the master node, it can be confirmed that the slave node has received the correct and complete rate synchronization packet; if they are inconsistent, it means that the communication rate used by the slave node to send the synchronization confirmation packet may be wrong, and the master node needs to continue to send the corresponding rate synchronization packet to the slave node through the field bus according to the adjusted communication rate and communication cycle in the next cycle.

[0103] In actual application, after the master node receives the synchronization confirmation packet fed back by the slave node, it calculates a fourth whole packet check value based on the calculation formula agreed with the slave node and the slave node location field and the synchronization confirmation information field in the synchronization confirmation packet; and determines whether the calculated fourth whole packet check value is consistent with the third whole packet check value in the received synchronization confirmation packet; if it is determined that the fourth whole packet check value is consistent with the third whole packet check value in the received synchronization confirmation packet, it can be confirmed that the slave node has received the correct and complete rate synchronization packet, and the "absent flag" of the slave node in the master node is modified to "present flag"; if it is determined that the fourth whole packet check value is inconsistent with the third whole packet check value in the received synchronization confirmation packet, it is determined that the received synchronization confirmation packet is inconsistent, indicating that the communication rate used by the slave node to send the synchronization confirmation packet may be wrong, and the master node needs to continue to send the corresponding rate synchronization packet to the slave node through the field bus in the next cycle according to the adjusted communication rate and communication cycle.

[0104] It can be seen that the communication rate adjustment method suitable for industrial field buses provided in the embodiment of the present application receives the bus communication rate parameters and bus communication cycle parameters sent by the engineer station through the master node, and adjusts the communication rate and communication cycle of the field bus according to the bus communication rate parameters and the bus communication cycle parameters. There is no need to increase the corresponding hardware structure, which can not only reduce the complexity of the structural parts, but also reduce a certain cost; and the entire adjustment process does not require manual intervention, which can not only reduce the workload of the staff and improve the adjustment efficiency of the bus communication rate, but also effectively avoid the failure of the communication rate adjustment caused by repeated toggling of the dip switch; after adjusting the communication rate and communication cycle of the field bus, the master node can pre-agreed synchronization The master node generates a rate synchronization packet corresponding to each slave node according to the command, the slave node address of each slave node, the bus communication cycle parameter and the first whole packet verification value, and sends the corresponding rate synchronization packet to each slave node according to the communication rate and communication cycle of the field bus, so that the slave node receives the rate synchronization packet of the slave node sent by the master node, and verifies the received rate synchronization packet of the slave node to ensure that the slave node can receive the correct and complete rate synchronization packet; when the slave node determines that the rate synchronization packet of the slave node has been verified, it sets the subsequent communication rate, generates the corresponding synchronization confirmation packet, and feeds back the synchronization confirmation packet to the master node, so that when the master node verifies the synchronization confirmation packet fed back by the slave node, it changes the "absent flag" of the slave node to the "present flag".

[0105] Furthermore, in an embodiment of the present application, if the master node determines that the verification of the synchronization confirmation packet fed back by the slave node has passed, the "absent flag" of the slave node is modified to the "in-place flag", that is, it is confirmed that the slave node is in a normal communication connection state in the current cycle. Then, when the next communication cycle is reached, a normal communication data packet of the slave node can be generated according to the communication protocol corresponding to the field bus, and the normal communication data packet of the slave node can replace the rate synchronization packet of the slave node, so as to send the corresponding normal communication data packet to the slave node through the field bus at the adjusted communication rate, thereby realizing a normal communication cycle after the communication rate adaptive adjustment of the slave node entering the field bus is successfully achieved.

[0106] It should be noted that, after receiving the normal communication data packet fed back by the master node, the slave node may feed back the corresponding periodic communication packet.

[0107] It should also be noted that, when the master node determines that the slave node is in a normal communication connection state in the current cycle, when it reaches the next communication cycle, it can generate a corresponding normal whole packet check value based on the slave node address, pre-agreed periodic communication command and periodic communication data of the slave node, and generate a normal communication data packet based on the slave node address, pre-agreed periodic communication command, periodic communication data and normal whole packet check value of the slave node; after receiving the normal communication data packet sent by the master node, the slave node address, pre-agreed periodic communication command and periodic communication data in the normal communication data packet can be used to generate a new normal whole packet check value, and determine whether the new normal whole packet check value is consistent with the normal whole packet check value in the normal communication data packet, and whether the slave node address in the normal communication data packet is consistent with the slave node address of the slave node; if they are consistent, it is determined that the received normal communication data packet has passed the check, and the corresponding valid periodic communication response packet is fed back to the master node; otherwise, it is determined that the received normal communication data packet has failed the check.

[0108] Furthermore, in an embodiment of the present application, the master node can also be detected in real time. When it is detected that the master node is restarted, the master node is controlled to be initialized, so that the master node clears the "in-place flag" of all slave nodes (modifies the "in-place flag" of the slave node to the "not-in-place flag"), and loads the bus communication rate parameters and bus communication cycle parameters from the internal non-volatile memory, and adjusts the communication rate and communication cycle of the field bus according to the bus communication rate parameters and the bus communication cycle parameters and subsequent steps, that is, executes steps S201-S205; wherein, the specific execution process of steps S201-S205 can refer to the specific content under the above-mentioned corresponding steps, and the embodiments of the present application will not be repeated here.

[0109] It should be noted that, since the master node will no longer send rate synchronization packets to the slave node marked as "in-place flag", but will send normal communication data packets, when the master node is restarted, the "in-place flag" of all slave nodes is cleared. This is to prevent the slave nodes from losing rate synchronization in unexpected circumstances (that is, the communication rate of the slave nodes changes unexpectedly), and the master node cannot detect it immediately after restarting. By clearing the "in-place flag" of all slave nodes, the flags of all slave nodes in the master node are all "not in-place flags", and the master node can return to execute step S201 and its subsequent steps, so that the master node can quickly synchronize the slave nodes through the field bus again.

[0110] In actual application, Figure 3As shown, the master node can detect itself in real time. When it detects that it has restarted, it can control itself to initialize to clear the "in-place flag" of all slave nodes; so that after the master node completes the initialization, it loads the bus communication rate parameters and bus communication cycle parameters from the internal non-volatile memory; the master node adjusts the communication rate and communication cycle of the field bus according to the loaded bus communication rate parameters and bus communication cycle parameters; the master node generates a rate synchronization packet corresponding to each slave node, and sends the corresponding rate synchronization packet to each slave node according to the communication rate and communication cycle of the field bus. Among them, the generation process of the rate synchronization packet of each slave node can be found in the corresponding part of the above content, and will not be repeated here.

[0111] For each slave node, the slave node uses the maximum communication cycle of the system agreed in advance with the industrial control system as the switching time, and follows the communication rate conversion sequence of 0.5MHz, 1MHz to 12MHz, and then 0.5MHz, 1MHz to 12MHz, and cycles, and continuously listens to the rate synchronization packet sent by the master node to the slave node through the field bus according to the adjusted communication rate and communication cycle; after the slave node listens to the rate synchronization packet of the slave node sent by the master node, it can verify the received rate synchronization packet; if the slave node determines that the verification of the received rate synchronization packet is passed, it sets the subsequent communication rate, and then generates a corresponding synchronization confirmation packet, and feeds the synchronization confirmation packet back to the master node; if the slave node determines that the verification of the received rate synchronization packet is not passed, then the slave node continues to listen to the rate synchronization packet sent by the master node to the slave node. Among them, the process of the slave node verifying the received rate synchronization packet, and generating and feeding back the corresponding synchronization confirmation packet to the master node when determining that the rate synchronization packet is verified, can refer to the corresponding part in the above content, and will not be repeated here.

[0112] After the master node receives the synchronization confirmation packet fed back by the slave node, it can verify the received synchronization confirmation packet; if it is determined that the verification of the received synchronization confirmation packet is passed, the "absent flag" of the slave node is changed to "present flag", and when the next communication cycle arrives, a normal communication data packet of the slave node can be generated, and the corresponding normal communication data packet is sent to the slave node through the field bus at the adjusted communication rate to achieve the normal communication cycle with the slave node. If it is determined that the verification of the received synchronization confirmation packet is not passed, the master node can continue to send the corresponding rate synchronization packet to the slave node through the field bus at the adjusted communication rate and communication cycle.

[0113] Furthermore, in an embodiment of the present application, for each slave node, during the normal operation of the industrial control system, the slave node detects in real time whether it has restarted; when the slave node detects that it has restarted, the slave node controls itself to reset and then initialize to complete the corresponding restart operation; the communication of the slave node is detected in real time by the master node; when the master node detects that the slave node communication has timed out, the "in-place flag" of the slave node is modified to the "out-of-place flag", and the master node sends the corresponding rate synchronization packet to the slave node according to the communication rate and communication cycle of the field bus, that is, returns to execute step S202, so that after the slave node completes the corresponding restart operation, continue to execute steps S203-step S205; wherein, the specific execution process of steps S202-step S205 can refer to the specific content under the above corresponding steps, and the embodiment of the present application will not be repeated here.

[0114] It should be noted that when the master node detects that the slave node's identifier is an "in-place identifier", it can determine whether the periodic communication packet fed back by the slave node has not been received for a preset number of consecutive periods; if it is determined that the periodic communication packet fed back by the slave node has not been received for a preset number of consecutive periods, the identifier of the slave node can be changed from "in-place identifier" to "out-of-place identifier" to re-send the corresponding rate synchronization packet to the slave node according to the communication rate and communication cycle of the field bus, that is, execute step S202, so that after the slave node completes the corresponding restart operation, continue to execute steps S203-step S205.

[0115] The preset number of periods may be M (M is an integer greater than 0) system maximum communication periods, which is not limited in the embodiment of the present application.

[0116] It should also be noted that during the initialization period, the slave node does not listen to the master node sending the corresponding rate synchronization packet to the slave node according to the communication rate and communication cycle of the field bus, does not feedback the corresponding synchronization confirmation packet or periodic communication packet to the master node, and maintains the corresponding offline state.

[0117] In actual application, Figure 4 As shown, for each slave node, during the normal operation of the industrial control system, the slave node can perform real-time detection on itself. When it is detected that it has restarted due to re-plugging or resetting, it can control itself to enter reset and then initialize to perform the corresponding restart operation.

[0118] The master node detects in real time whether the identification of the slave node is an "absent identification"; if it is detected that the identification of the slave node is an "absent identification", a rate synchronization packet of the slave node is sent to the slave node according to the communication rate and communication cycle of the field bus.

[0119] After completing the corresponding restart operation, the slave node uses the system maximum communication cycle agreed in advance with the industrial control system as the switching time, and follows the communication rate conversion sequence of 0.5MHz, 1MHz to 12MHz, and then cycles to 0.5MHz, 1MHz to 12MHz, cycles, and continuously listens to the rate synchronization packet sent to the slave node by the master node through the field bus according to the adjusted communication rate and communication cycle; after the slave node listens to the rate synchronization packet of the slave node sent by the master node, it can verify the received rate synchronization packet; if the slave node determines that the verification of the received rate synchronization packet passes, it sets the subsequent communication rate, and then generates a corresponding synchronization confirmation packet, and feeds the synchronization confirmation packet back to the master node; if the slave node determines that the verification of the received rate synchronization packet fails, the slave node continues to listen to the rate synchronization packet sent to the slave node by the master node through the field bus according to the adjusted communication rate and communication cycle.

[0120] After the master node receives the synchronization confirmation packet fed back by the slave node, it can verify the received synchronization confirmation packet; if it is determined that the verification of the received synchronization confirmation packet is passed, the "absent flag" of the slave node is changed to "present flag", and when the next communication cycle arrives, a normal communication data packet of the slave node can be generated, and the corresponding normal communication data packet is sent to the slave node through the field bus at the adjusted communication rate to achieve the normal communication cycle with the slave node. If it is determined that the verification of the received synchronization confirmation packet is not passed, the master node continues to send the corresponding rate synchronization packet to the slave node through the field bus at the adjusted communication rate and communication cycle.

[0121] If the master node detects that the slave node's identifier is "in-place identifier", it can determine whether it has not received a valid cycle communication response packet fed back by the slave node for M consecutive system communication cycles (M is an integer greater than 0); if it is determined that the valid communication cycle packet fed back by the slave node has not been received for M consecutive system communication cycles, the slave node's identifier is changed from "in-place identifier" to "out-of-place identifier", and in the next cycle, the step of sending the slave node's rate synchronization packet to the slave node according to the field bus communication rate and communication cycle is executed. If it is determined that the valid communication cycle packet fed back by the slave node has not been received for M consecutive system communication cycles, the master node still periodically sends normal communication data packets to the slave node until M cycles are recorded.

[0122] In order to better understand the communication rate adjustment method applicable to the industrial field bus provided in the embodiment of the present application, the following explanation is made in terms of distance, such as Figure 5 As shown:

[0123] A1: When the communication rate configuration operation is detected, the master node receives the bus communication rate parameters and bus communication cycle parameters sent by the engineer station, and saves the bus communication rate parameters and bus communication cycle parameters;

[0124] A2: The master node detects itself in real time; when it detects that it is restarting, it controls itself to initialize to clear the in-place flags of all slave nodes; and after the initialization is completed, it loads the previously stored bus communication rate parameters and bus communication cycle parameters;

[0125] A3: The master node adjusts the communication rate and communication cycle of the field bus according to the loaded bus communication rate parameters and bus communication cycle parameters, and controls the field bus to send corresponding rate synchronization packets to each slave node according to the adjusted communication rate and communication cycle;

[0126] A4: The slave node listens to the rate synchronization packet sent by the master node;

[0127] A5: The slave node verifies the detected rate synchronization packet; if the rate synchronization packet passes the verification, execute A6;

[0128] A6: Send the corresponding synchronization confirmation packet to the master node; if the rate synchronization packet verification fails, continue to listen to the rate synchronization packet sent by the master node;

[0129] A7: The master node verifies the synchronization confirmation packet fed back by the slave node; if the synchronization confirmation packet passes the verification, execute A8;

[0130] A8: Mark the slave node's ID as "in-place ID" and send a normal communication data packet to the slave node when the next communication cycle arrives;

[0131] A9: The slave node verifies the received normal communication data packet; if the normal communication data packet passes the verification, execute A10; if the normal communication data packet fails the verification, execute A13;

[0132] A10: Feedback the corresponding valid period communication response packet to the master node;

[0133] A11: The slave node detects itself in real time;

[0134] A12: When a restart is detected, the slave node controls itself to initialize and perform the corresponding restart operation;

[0135] A13: The master node detects in real time whether the identifier of the slave node is an "absent identifier"; if the master node detects that the identifier of the slave node is an "absent identifier", A3 is executed; if the master node detects that the identifier of the slave node is not an "absent identifier", A14 is executed;

[0136] A14: The master node determines whether it has not received the valid cycle communication response packet fed back by the slave node for M consecutive system communication cycles; if the master node determines that it has not received the valid cycle communication response packet fed back by the slave node for M consecutive system communication cycles, execute A15; if the master node has not received the valid communication cycle packet fed back by the slave node for M consecutive system communication cycles, execute A8 until M cycles are recorded;

[0137] A15: Change the identifier of the slave node from "in-place identifier" to "out-of-place identifier", and execute A3.

[0138] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The system and system embodiment described above are only exemplary. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.

[0139] Professionals may further appreciate that the units and steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0140] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

[0141] The above are only preferred implementations of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A communication rate adjustment method applicable to an industrial field bus, characterized in that: Applied to an industrial control system, the industrial control system includes an engineer station, a switch, a master node and multiple slave nodes, the master node and the slave nodes are connected via a field bus, and the method includes: Receiving the bus communication rate parameter and the bus communication cycle parameter sent by the engineer station through the master node, and adjusting the communication rate and the communication cycle of the field bus according to the bus communication rate parameter and the bus communication cycle parameter; The master node generates a rate synchronization packet corresponding to each slave node according to a pre-agreed synchronization command, a slave node address of each slave node, a bus communication cycle parameter and a first whole-packet check value, and sends a corresponding rate synchronization packet to each slave node according to the communication rate and communication cycle of the field bus; wherein the first whole-packet check value of the slave node is generated by the master node according to a calculation formula pre-agreed with the slave node, the slave node address, the synchronization command and the bus communication cycle parameter; For each of the slave nodes, receiving, through the slave node, a rate synchronization packet of the slave node sent by the master node, and verifying the received rate synchronization packet of the slave node; If the slave node determines that the rate synchronization packet of the slave node has passed the verification, the slave node is controlled to set the current rate to the communication rate used when the rate synchronization packet of the slave node is received, a corresponding synchronization confirmation packet is generated to feed back the synchronization confirmation packet to the master node, and the communication cycle is determined using the bus communication cycle parameter in the rate synchronization packet; The master node verifies the synchronization confirmation packet fed back by the slave node, and when it is confirmed that the synchronization confirmation packet has passed the verification, the identifier of the slave node is marked as an in-place identifier.

2. The method according to claim 1, characterized in that The receiving, by the master node, a bus communication rate parameter and a bus communication cycle parameter sent by an engineer station, and adjusting the communication rate and the communication cycle of the field bus according to the bus communication rate parameter and the bus communication cycle parameter, comprises: Receiving the bus communication rate parameter and the bus communication cycle parameter sent by the engineer station through the master node, and storing the bus communication rate parameter and the bus communication cycle parameter in an internal non-volatile memory; Determining, by the master node, a target communication rate corresponding to the bus communication rate parameter from various preset communication speeds according to the correspondence between the preset bus communication rate parameter and the communication rate, and adjusting the communication rate of the field bus according to the target communication rate; The master node determines the target communication cycle corresponding to the bus communication cycle parameters from the preset communication cycles according to the correspondence between the preset bus communication cycle parameters and the communication cycle, and adjusts the communication cycle of the field bus according to the target communication cycle.

3. The method according to claim 2, characterized in that The step of receiving, for each of the slave nodes, a rate synchronization packet of the slave node sent by the master node, and verifying the received rate synchronization packet of the slave node comprises: For each slave node, the slave node is controlled to use a pre-agreed maximum communication cycle as the switching time, and according to the pre-set order of change of each communication speed, a corresponding communication rate is selected from each pre-set communication rate to listen to the rate synchronization packet of the node sent by the master node through the field bus, and the received slave node rate synchronization packet is verified.

4. The method according to claim 3, characterized in that The verifying, by the slave node, the received rate synchronization packet of the slave node includes: Receiving, by the slave node, a rate synchronization packet of the slave node sent by the master node; wherein the rate synchronization packet includes a slave node address, a synchronization command, a bus communication cycle parameter and a first whole packet check value; The slave node generates a second whole packet check value according to the slave node address, synchronization command and bus communication cycle parameters in the rate synchronization packet in accordance with a calculation formula pre-determined with the master node, and when the second whole packet check value is consistent with the first whole packet check value in the rate synchronization packet, and the slave node address in the rate synchronization packet is consistent with the slave node address of the slave node, it is determined that the rate synchronization packet received from the slave node has passed the check.

5. The method according to claim 1, characterized in that If the slave node determines that the rate synchronization packet of the slave node has passed the verification, the slave node is controlled to set the current rate to the communication rate used when the rate synchronization packet of the slave node is received, a corresponding synchronization confirmation packet is generated to feed back the synchronization confirmation packet to the master node, and the communication cycle is determined using the bus communication cycle parameter in the rate synchronization packet, including: If the slave node determines that the rate synchronization packet of the slave node has passed the verification, control the slave node to lock the communication rate used when receiving the rate synchronization packet of the slave node, and set the current communication rate to the locked communication rate, so that the slave node communicates with the master node based on the locked communication rate; Generate a corresponding synchronization confirmation packet through the slave node, and feed back the synchronization confirmation packet to the master node; The slave node is controlled to lock the bus communication cycle parameters in the rate synchronization packet of the slave node, so that the slave node uses the locked bus communication cycle parameters as a basis for subsequent communication cycle diagnosis.

6. The method according to claim 5, characterized in that Generating a corresponding synchronization confirmation packet by the slave node and feeding back the synchronization confirmation packet to the master node includes: Generate corresponding synchronization confirmation information through the slave node, and generate a third whole-packet check value according to the slave node address of the slave node and the synchronization confirmation information according to a calculation formula pre-agreed with the master node; The slave node generates a corresponding synchronization confirmation packet according to the slave node address of the slave node, the synchronization confirmation information and the third whole packet check value, and feeds back the synchronization confirmation packet to the master node.

7. The method according to claim 6, characterized in that The step of verifying the synchronization confirmation packet fed back by the slave node through the master node, and marking the identifier of the slave node as an in-place identifier when confirming that the synchronization confirmation packet has passed the verification, includes: Receiving the synchronization confirmation packet fed back by the slave node through the master node; The master node generates a corresponding fourth whole-packet verification value according to the calculation formula pre-agreed with the slave node and the slave node address and the synchronization confirmation information in the synchronization confirmation packet, and when the fourth whole-packet verification value is consistent with the third whole-packet verification value in the synchronization confirmation packet, it is determined that the synchronization confirmation packet feedback by the slave node has passed the verification, and the identifier of the slave node is marked as an in-place identifier.

8. The method according to claim 2, characterized in that: The method further comprises: When it is detected that the master node is restarted, the master node is controlled to be initialized, so that the master node clears the identification of all slave nodes marked as in-place identification, and loads the bus communication rate parameters and the bus communication cycle parameters from the internal non-volatile memory, and executes the step of adjusting the communication rate and communication cycle of the field bus according to the bus communication rate parameters and the bus communication cycle parameters.

9. The method according to claim 1, characterized in that: The method further comprises: For each of the slave nodes, during the normal operation of the industrial control system, the slave node detects in real time whether it is restarted; When the slave node detects that it has restarted, the slave node controls itself to reset and then initialize to complete the corresponding restart operation; The master node detects the identifier of the slave node in real time; When the master node detects that the identifier of the slave node is not a presence identifier, the master node sends a corresponding rate synchronization packet to the slave node according to the communication rate and communication cycle of the field bus.

10. An industrial control system, characterized in that: The industrial control system includes an engineer station, a switch, a master node and a plurality of slave nodes, wherein the master node and the slave nodes are connected via a field bus; The master node is used to receive bus communication rate parameters and bus communication cycle parameters sent by the engineer station, and adjust the communication rate and communication cycle of the field bus according to the bus communication rate parameters and the bus communication cycle parameters; generate a rate synchronization packet corresponding to each slave node according to a pre-agreed synchronization command, the slave node address of each slave node, the bus communication cycle parameters and the first whole packet check value, and send a corresponding rate synchronization packet to each slave node according to the communication rate and communication cycle of the field bus; wherein the first whole packet check value of the slave node is generated by the master node according to the calculation formula pre-agreed with the slave node, according to the slave node address, the synchronization command and the bus communication cycle parameters; verify the synchronization confirmation packet fed back by the slave node, and when it is confirmed that the synchronization confirmation packet check has passed, mark the identifier of the slave node as an in-place identifier; The slave node is used to receive the rate synchronization packet of the slave node sent by the master node, and to verify the received rate synchronization packet of the slave node; if the slave node determines that the rate synchronization packet of the slave node has passed the verification, the current rate is set to the communication rate used when the rate synchronization packet of the slave node is received, a corresponding synchronization confirmation packet is generated to feed back the synchronization confirmation packet to the master node, and the communication cycle is determined using the bus communication cycle parameters in the rate synchronization packet.

Citation Information

Patent Citations

  • Ring redundant real-time Ethernet communication method

    CN102710484A

  • Multi-master asynchronous duplex differential bus and communication method

    CN102857397A