A fieldbus message transmission method, system and storage medium based on a general message shell

By designing a general message shell to realize the transparent transmission and parallel processing of fieldbus messages, the problems of frequent system upgrades and low transmission efficiency caused by the variety of fieldbus equipment are solved, and the system scalability and transmission efficiency are improved.

CN119011327BActive Publication Date: 2025-08-01NR ENG CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411142493.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-20
Publication Date
2025-08-01
Estimated Expiration
2044-08-20

AI Technical Summary

Technical Problem

In the prior art, the variety of fieldbus equipment leads to frequent upgrades of control system programs, poor system scalability, and low packet transmission efficiency when scanning equipment management systems, especially inconvenient debugging and maintenance in systems with large number of equipment.

Method used

The first and second general message shells are used for packet transmission between the controller node and the fieldbus IO node respectively, including relevant information required for transmission, to realize the transmissive transmission and parallel processing of packets, avoid frequent upgrades of the control system, and improve transmission efficiency.

Benefits of technology

Through the design of a general message shell, the controller node does not need to care about the specific message content, and adapts to fieldbus messages of various types of protocols, improves system scalability and transmission efficiency, and supports parallel processing of multiple devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119011327B_ABST
    Figure CN119011327B_ABST
Patent Text Reader

Abstract

The present invention discloses a fieldbus message transmission method, system and storage medium based on a general message shell, belonging to the technical field of device communication. The transmission method includes: receiving a fieldbus downstream message sent by a field device tool; loading the fieldbus downstream message into a second general message shell and sending it to a fieldbus IO node, wherein the second general message shell contains relevant information required for transmitting fieldbus messages between a controller node and the fieldbus IO node; waiting for and receiving a fieldbus upstream message replied by the fieldbus IO node; loading the fieldbus upstream message into a first general message shell and sending it to the field device tool, wherein the first general message shell contains relevant information required for transmitting fieldbus messages between the controller node and the field device tool, solving the problems of frequent upgrading of the control system program caused by the increase in the types of fieldbus protocols and the low efficiency of fieldbus transmission.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of device communication, and particularly relates to a fieldbus message transmission method, system, and storage medium based on a general message shell. Background Art

[0002] Fieldbus is a communication network widely used in the field of process control protection, with characteristics such as high digitalization, discretization, two-way intelligence, interconnection and interoperability, multiple data types, and multiple station numbers. In recent years, industrial enterprises have increasingly urgent requirements for functions such as the management, predictive maintenance, and statistical analysis of fieldbus devices. In the prior art, an integrated fieldbus device management system is implemented using a Field Device Tool (FDT) and a Device Type Manager (DTM). The device management system exchanges data with fieldbus devices through the controller node of the process control protection system and the fieldbus IO node, where the fieldbus IO node is also a type of fieldbus device.

[0003] With the development of automation technology, the types of fieldbuses are constantly expanding, and the communication mechanisms and communication protocols of various fieldbuses are different. As the intermediate controller node, targeted development needs to be carried out according to different fieldbus types, the control system program is frequently upgraded, which is not convenient for system maintenance, and the system scalability is poor.

[0004] In addition, when the device management system in the prior art scans fieldbus devices, it is necessary to perform message responses for each fieldbus device one by one. The process involves a large amount of message reading and writing and serial waiting, which consumes a long time. Especially for a system with a large number and variety of fieldbus devices, the debugging and maintenance of the system are particularly inconvenient. Summary of the Invention

[0005] The present invention aims to provide a fieldbus message transmission method, system, and storage medium based on a general message shell. By designing a first general message shell and a second general message shell, which respectively contain various fieldbus messages required for message transmission, it can adapt to fieldbus messages of various types of protocols, and solves the problems of frequent upgrade of the control system program and low fieldbus transmission efficiency caused by the increase in the types of fieldbus protocols in the prior art.

[0006] To achieve the above object, the present invention is implemented by the following technical solutions:

[0007] In a first aspect, the present invention provides a fieldbus message transmission method based on a general message shell, which is applied to a controller node in a fieldbus system. The characteristics of the message transmission method include:

[0008] Receive the field bus downstream message sent by the field device tool;

[0009] Load the field bus downstream message into a preset second general message shell and send it to the field bus IO node, where the second general message shell contains relevant information required for transmitting field bus messages between the controller node and the field bus IO node;

[0010] Wait for and receive the field bus upstream message replied by the field bus IO node;

[0011] Load the field bus upstream message into a preset first general message shell and send it to the field device tool, where the first general message shell contains relevant information required for transmitting field bus messages between the controller node and the field device tool.

[0012] Optionally, the preset first general message shell includes downstream information or upstream information, and the preset second general message shell includes downstream information or upstream information;

[0013] The downstream information of the first general message shell includes: message number, controller node number, field bus IO node information, field bus type, field bus downstream message length, field bus downstream message body;

[0014] The upstream information of the first general message shell includes: message number, controller node number, field bus IO node information, field bus type, field bus message processing result, field bus upstream message length, field bus upstream message body;

[0015] The downstream information of the second general message shell includes: message function code, buffer location, field bus IO node type, field bus type, field bus downstream message length, field bus downstream message body;

[0016] The upstream information of the second general message shell includes: message function code, buffer location, field bus IO node type, field bus type, field bus message processing result, field bus upstream message length, field bus upstream message body.

[0017] Optionally, after receiving the field bus downstream message sent by the field device tool, it further includes:

[0018] Verify the received downstream information of the first general message shell;

[0019] If the verification passes, search for a fieldbus transmission element with an idle status in the buffer queue, write relevant information into the fieldbus transmission element according to the downstream fieldbus message, and switch the fieldbus transmission element with an idle status to the downstream ready state. If the verification fails, discard the downstream fieldbus message and reply with the reason for the error, and the fieldbus transmission element with an idle status remains in the idle state. Among them, a single fieldbus transmission element includes a state machine, source node information, fieldbus IO node information, fieldbus information, timeout information, downstream fieldbus information, and upstream fieldbus information, and the buffer queue contains multiple fieldbus transmission elements.

[0020] Optionally, the writing of relevant information into the fieldbus transmission element according to the downstream fieldbus message includes: writing the source node information, fieldbus IO node information, downstream fieldbus information, and the fieldbus type in the fieldbus information into the fieldbus transmission element with an idle status, and setting the timeout setting value of the timeout information of the fieldbus transmission element.

[0021] Optionally, the loading of the downstream fieldbus message into a preset second general message shell and sending it to the fieldbus IO node includes:

[0022] Perform a secondary confirmation on the status of the target IO node to be sent. If the confirmation passes, fill the relevant information in the fieldbus transmission element with a downstream ready status into the second general message shell, complete the content of the second general message shell, and send the supplemented second general message shell to the target IO node. The fieldbus transmission element with a downstream ready status is switched to the upstream waiting state. If the confirmation fails, discard the downstream fieldbus message, set the length of the upstream fieldbus information message in the fieldbus transmission element with a downstream ready status to 0, set the transmission processing result to the secondary confirmation failure of the target fieldbus IO node, and switch the fieldbus transmission element with a downstream ready status to the upstream ready state.

[0023] Optionally, the filling of the relevant information in the fieldbus transmission element with a downstream ready status into the second general message shell includes: taking out the type in the fieldbus information and the downstream fieldbus information in the fieldbus transmission element with a downstream ready status and filling them into the second general message shell.

[0024] Optionally, the waiting for and receiving the upstream fieldbus message replied by the fieldbus IO node includes:

[0025] During the waiting process, the cumulative processing time in the timeout information is updated in real time;

[0026] If a reply from the fieldbus IO node is not received before the cumulative processing time accumulates to the timeout setting value, the length of the fieldbus upstream information message in the fieldbus transmission element with the status of upstream waiting state is set to 0, the transmission processing result is set to timeout for the reply from the target fieldbus IO node, and the fieldbus transmission element with the status of upstream waiting state is switched to the upstream ready state;

[0027] If a reply from the fieldbus IO node is received before the cumulative processing time accumulates to the timeout setting value, the received fieldbus upstream message is verified. If the verification passes, the fieldbus message processing result in the reply of the fieldbus upstream message is taken out and filled into the fieldbus information in the fieldbus transmission element with the status of upstream waiting state, the fieldbus upstream message length and the fieldbus upstream message body are taken out and filled into the fieldbus upstream information in the fieldbus transmission element with the status of upstream waiting state, and the fieldbus transmission element with the status of upstream waiting state is switched to the upstream ready state. If the verification fails, the reply message of this frame is discarded and waiting continues, and the fieldbus transmission element with the status of upstream waiting state remains in the upstream waiting state.

[0028] Optionally, loading the fieldbus upstream message into a preset first general message shell and sending it to the field device tool includes:

[0029] Taking out the source node information, fieldbus IO node information, fieldbus information, and fieldbus upstream information in the fieldbus transmission element with the status of upstream ready state and filling them into the upstream information of the first general message shell, and sending them out according to the source node information.

[0030] In a second aspect, the present invention provides a fieldbus message transmission system based on a general message shell, including:

[0031] A first processing module, configured to receive a fieldbus downstream message sent by a field device tool, and configured to load the fieldbus upstream message into a preset first general message shell and send it to the field device tool, where the first general message shell contains relevant information required for transmitting a fieldbus message between a controller node and the field device tool;

[0032] A second processing module, configured to load the fieldbus downstream message into a preset second general message shell and send it to the fieldbus IO node, and configured to wait for and receive a fieldbus upstream message replied by the fieldbus IO node, where the second general message shell contains relevant information required for transmitting a fieldbus message between a controller node and the fieldbus IO node.

[0033] In a third aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the fieldbus message transmission method based on a general message shell as described in the first aspect.

[0034] Compared with the prior art, the beneficial effects achieved by the present invention are as follows: By designing the first general message shell and the second general message shell, various fieldbus messages required for message data interaction between the controller node and the field device tool and the field IO node are included in the message body of the general message shell. The controller node does not need to care about the specific content of the message body and can directly pass it through to the target node, which can adapt to fieldbus messages of various types of protocols, avoid frequent upgrades of the control and protection system, and improve the system scalability. In addition, through the buffer queue that can cache multiple messages, the first processing module and the second processing module can process new fieldbus downstream messages without waiting for the previous frame of fieldbus upstream message, thereby realizing parallel processing of fieldbus messages and improving the message transmission efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 The figure shows a flowchart of a fieldbus message transmission method based on a general message shell in an embodiment of the present invention;

[0036] Figure 2 The figure shows a framework diagram of a fieldbus system in an embodiment of the present invention;

[0037] Figure 3 The figure shows a schematic diagram of the structure of a fieldbus transmission element in a buffer queue in an embodiment of the present invention;

[0038] Figure 4 The figure shows a schematic diagram of the downlink information structure of the first general message shell in an embodiment of the present invention;

[0039] Figure 5 The figure shows a schematic diagram of the uplink information structure of the first general message shell in an embodiment of the present invention;

[0040] Figure 6 The figure shows a schematic diagram of the downlink information structure of the second general message shell in an embodiment of the present invention;

[0041] Figure 7 The figure shows a schematic diagram of the uplink information structure of the second general message shell in an embodiment of the present invention;

[0042] Figure 8 The figure shows a schematic diagram of the state machine switching of a fieldbus transmission element in an embodiment of the present invention;

[0043] Figure 9The following is a framework diagram of a fieldbus message transmission system based on a general message shell in an embodiment of the present invention. Detailed implementation manners

[0044] The present invention will be further described below with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solutions of the present invention and should not be used to limit the protection scope of the present invention.

[0045] Embodiment 1

[0046] As Figure 1 shown, this embodiment provides a fieldbus message transmission method based on a general message shell, which is applied to a controller node in a fieldbus system. The characteristics of the message transmission method include:

[0047] Receiving a fieldbus downstream message sent by a field device tool;

[0048] Loading the fieldbus downstream message into a preset second general message shell and sending it to a fieldbus IO node, where the second general message shell contains relevant information required for transmitting fieldbus messages between the controller node and the fieldbus IO node;

[0049] Waiting for and receiving a fieldbus upstream message replied by the fieldbus IO node;

[0050] Loading the fieldbus upstream message into a preset first general message shell and sending it to the field device tool, where the first general message shell contains relevant information required for transmitting fieldbus messages between the controller node and the field device tool.

[0051] Embodiment 2

[0052] On the basis of Embodiment 1, the following design is further made in this embodiment.

[0053] As Figure 2 shown, the fieldbus system in this embodiment includes an FDT server, a controller node, a fieldbus IO node, and a fieldbus instrument. The fieldbus downstream message is initiated by the FDT server, passes through the controller node and the fieldbus IO node to reach the fieldbus instrument. The fieldbus upstream message is replied by the fieldbus instrument and reaches the FDT server through the reverse path. For the controller node, only the transparent transmission of the fieldbus message is performed, and there is no need to care about the specific content of the message body. Therefore, it can adapt to fieldbus messages of various types of protocols, avoid frequent upgrades of the control and protection system, and improve the system scalability. In addition, multiple FDT servers are allowed to send fieldbus downstream messages simultaneously, and the controller node supports parallel processing, which improves the transmission efficiency.

[0054] Step S100: Receive the fieldbus downstream message in the first general message shell sent by the FDT server. First, verify the downstream information of the first general message shell. If the verification passes, search for a fieldbus transmission element with an idle status in the buffer queue, and then push the fieldbus downstream message into the fieldbus downstream information of the fieldbus transmission element with an idle status. Otherwise, directly discard the fieldbus downstream message and return the error reason.

[0055] Among them, as Figure 3 shown, a single fieldbus transmission element in the buffer queue includes a state machine, source node information, fieldbus IO node information, fieldbus information, timeout information, fieldbus downstream information, and fieldbus upstream information; the source node information includes a source link number and a message number; the fieldbus IO node information includes a station number, a branch number, and a board card number; the fieldbus information includes a type and a transmission processing result; the timeout information includes a timeout setting value and an accumulated processing time; the fieldbus downstream information includes a message length and a message body; the fieldbus upstream information includes a message length and a message body; the buffer queue contains multiple such fieldbus transmission elements.

[0056] The first general message shell is a message data structure, which is divided into first general message shell downstream information and first general message shell upstream information.

[0057] As Figure 4 shown, the first general message shell downstream information includes: a message number, a controller node number, fieldbus IO node information, fieldbus type, fieldbus downstream message length, and fieldbus downstream message body. Among them, the fieldbus IO node information is further divided into a fieldbus IO node station number, a fieldbus IO node branch number, and a fieldbus IO node board card number; the fieldbus type includes, such as, Profibus, Modbus, Hart, CanOpen, etc.; the fieldbus downstream message length cannot be 0.

[0058] As Figure 5 shown, the first general message shell upstream information includes: a message number, a controller node number, fieldbus IO node information, fieldbus type, fieldbus transmission processing result, fieldbus upstream message length, and fieldbus upstream message body. Among them, the fieldbus IO node information and the fieldbus type are the same as those in the first general message shell downstream information; the fieldbus upstream message length can be 0.

[0059] Step S200: Retrieve the status of each element in the buffer queue, and perform a secondary confirmation on the target IO node status. If the confirmation passes, load the fieldbus message into the second general message shell and send it to the fieldbus IO node. Otherwise, directly discard the fieldbus downstream message and return the error reason.

[0060] The second general message shell is also a message data structure, which is divided into the second general message shell downlink information and the second general message shell uplink information.

[0061] As Figure 6 shown, the second general message shell downlink information includes: message function code, buffer location, fieldbus IO node type, fieldbus type, fieldbus downlink message length, and fieldbus downlink message body. Among them, the fieldbus type and the fieldbus downlink message length are the same as those of the first general message shell downlink information.

[0062] As Figure 7 shown, the second general message shell uplink information includes: message function code, buffer location, fieldbus IO node type, fieldbus type, fieldbus message processing result, fieldbus uplink message length, and fieldbus uplink message body. Among them, the fieldbus type is the same as that of the first general message shell downlink information; the fieldbus uplink message length is the same as that of the first general message shell uplink information.

[0063] Step S300: Wait for and receive the fieldbus uplink message replied by the fieldbus IO node. During the waiting process, a timeout judgment mechanism is set. After the timeout, the buffer queue resources are released and the error reason is replied.

[0064] Step S400: Search for the fieldbus uplink message and its source node information in the buffer queue, and judge whether to send the fieldbus uplink message according to the fieldbus message information status. The fieldbus uplink message includes a normal reply message containing the fieldbus message body or an abnormal reply message without the fieldbus message body. If the fieldbus uplink message can be sent, the fieldbus uplink message is loaded into the first general message shell and the message is sent.

[0065] According to Figure 8 the schematic diagram of the fieldbus transmission element state machine switching shown, taking the fieldbus transmission element No. 1 in the buffer queue as an example, the specific steps of the message transmission method applied to the controller node are as follows:

[0066] 1. After initialization, the state machine of element No. 1 is idle.

[0067] 2. After receiving the field bus downlink message, the first processing module first verifies the downlink information of the first general message shell, specifically including whether the controller node number is consistent with the local controller node number, whether the field bus IO node information is legal and configured, and whether the length of the field bus downlink message is non-zero. After passing the verification, it searches for an element with an idle state machine in the buffer queue. In this example, the found element is element No. 1. Then, it writes the source node information, field bus IO node information, the type in the field bus information, and the field bus downlink information into element No. 1, sets the timeout setting value of the timeout information of element No. 1, and changes the state machine of element No. 1 to the downlink ready state. If the verification fails, the first processing module directly discards this frame of the field bus downlink message and replies with the error reason of the source of the field bus downlink message, and the state machine of element No. 1 remains in the idle state.

[0068] 3. When the second processing module detects that the state machine of element No. 1 in the buffer queue is in the downlink ready state, it performs a secondary confirmation on the target IO node status, including whether the type of the target field bus IO node is correct and whether the communication of the target field bus IO node is normal. After passing the confirmation, it takes out the type in the field bus information and the field bus downlink information from element No. 1, fills them into the second general message shell and completes the content of the second general message shell. The buffer position of the second general message shell is filled with element serial number 1. Finally, it is sent to the target field bus IO node, and the state machine of element No. 1 is changed to the uplink waiting state. If the confirmation fails, it directly discards this frame of the field bus downlink message, sets the length of the field bus uplink information message of element No. 1 to 0, sets the transmission processing result to the secondary confirmation failure of the target field bus IO node, and changes the state machine to the uplink ready state.

[0069] 4. The second processing module waits for and receives the field bus uplink message replied by the field bus IO node, and updates the cumulative processing time in the timeout information in real time during the waiting process. If, before the cumulative processing time accumulates to the timeout setting value, a reply message from the field bus IO node is received, it first verifies whether the buffer position, field bus type, and field bus IO node information in the reply message are consistent with the information in element No. 1. If they are consistent, it takes out the field bus message processing result in the reply message and fills it into the transmission processing result of the field bus information of element No. 1, takes out the length of the field bus uplink message and the field bus uplink message body and fills them into the field bus uplink information of element No. 1, and the state machine of element No. 1 is changed to the uplink ready state. If they are inconsistent, it discards this frame of the reply message and continues to wait, and the state machine of element No. 1 remains unchanged. If, before the cumulative processing time accumulates to the timeout setting value, a valid reply message from the field bus IO node is not received, the length of the field bus uplink information message of element No. 1 is set to 0, the transmission processing result is set to the reply timeout of the target field bus IO node, and the state machine is changed to the uplink ready state.

[0070] 5. The first processing module continuously detects the state machines of all elements in the buffer queue. When it detects that the state machine of Element 1 is in the upstream ready state, it extracts the source node information, fieldbus IO node information, fieldbus information, and fieldbus upstream information from Element 1, fills them into the first general message shell upstream information structure, and sends them out according to the source link number. All the content of Element 1 is cleared, and the state machine switches to the idle state.

[0071] Embodiment 3

[0072] As Figure 9 shown, this embodiment provides a fieldbus message transmission system based on a general message shell, including:

[0073] A first processing module, configured to receive the fieldbus downstream message sent by the field device tool, and to load the fieldbus upstream message into a preset first general message shell and send it to the field device tool, where the first general message shell contains relevant information required for transmitting the fieldbus message between the controller node and the field device tool;

[0074] A second processing module, configured to load the fieldbus downstream message into a preset second general message shell and send it to the fieldbus IO node, and to wait for and receive the fieldbus upstream message replied by the fieldbus IO node, where the second general message shell contains relevant information required for transmitting the fieldbus message between the controller node and the fieldbus IO node.

[0075] The first processing module and the second processing module exchange data through the buffer queue to achieve functional isolation of the two modules.

[0076] Embodiment 4

[0077] This embodiment provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the fieldbus message transmission method based on a general message shell as described in Embodiment 2.

[0078] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) containing computer-usable program codes.

[0079] This application is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, as well as the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the functions specified in one or more flows and / or one or more blocks in the flow Figure 1 one or more flows and / or blocks Figure 1 means for implementing the functions specified in one or more blocks or more blocks.

[0080] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including instruction means that implement the functions specified in one or more flows and / or one or more blocks in the flow Figure 1 one or more flows and / or blocks Figure 1 means for implementing the functions specified in one or more blocks or more blocks.

[0081] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more flows and / or one or more blocks in the flow Figure 1 one or more flows and / or blocks Figure 1 means for implementing the functions specified in one or more blocks or more blocks.

[0082] The embodiments of the present invention have been described above in conjunction with the accompanying drawings. However, the present invention is not limited to the above specific embodiments. The above specific embodiments are merely illustrative and not restrictive. Under the inspiration of the present invention, those of ordinary skill in the art can also make many forms without departing from the spirit and scope protected by the present invention and the claims. All of these fall within the protection scope of the present invention.

Claims

1. A fieldbus message transmission method based on a general message shell, which is applied to a controller node in a fieldbus system. The characteristics of the message transmission method include: Receiving a fieldbus downstream message sent by a field device tool; Loading the fieldbus downstream message into a preset second general message shell and sending it to a fieldbus IO node. The second general message shell contains relevant information required for transmitting fieldbus messages between the controller node and the fieldbus IO node; Waiting for and receiving a fieldbus upstream message replied by the fieldbus IO node; Loading the fieldbus upstream message into a preset first general message shell and sending it to the field device tool. The first general message shell contains relevant information required for transmitting fieldbus messages between the controller node and the field device tool; The step of loading the fieldbus downstream message into a preset second general message shell and sending it to the fieldbus IO node includes: Performing a secondary confirmation on the status of the target IO node to be sent. If the confirmation is passed, filling the relevant information in the fieldbus transmission element with the status of downstream ready state into the second general message shell, and completing the content of the second general message shell. Then, sending the supplemented second general message shell to the target IO node, and switching the fieldbus transmission element with the status of downstream ready state to the upstream waiting state. If the confirmation fails, discarding the fieldbus downstream message, setting the length of the fieldbus upstream information message in the fieldbus transmission element with the status of downstream ready state to 0, setting the transmission processing result to the secondary confirmation failure of the target fieldbus IO node, and switching the fieldbus transmission element with the status of downstream ready state to the upstream ready state; The step of filling the relevant information in the fieldbus transmission element with the status of downstream ready state into the second general message shell includes: extracting the type in the fieldbus information and the fieldbus downstream information from the fieldbus transmission element with the status of downstream ready state and filling them into the second general message shell.

2. The fieldbus message transmission method based on a general message shell according to claim 1, characterized in that The preset first general message shell includes downstream information or upstream information, and the preset second general message shell includes downstream information or upstream information; The downstream information of the first general message shell includes: message number, controller node number, fieldbus IO node information, fieldbus type, length of the fieldbus downstream message, and fieldbus downstream message body; The upstream information of the first general message shell includes: message number, controller node number, fieldbus IO node information, fieldbus type, fieldbus message processing result, length of the fieldbus upstream message, and fieldbus upstream message body; The downstream information of the second general message shell includes: message function code, buffer location, fieldbus IO node type, fieldbus type, length of the fieldbus downstream message, and fieldbus downstream message body; The upstream information of the second general message shell includes: message function code, buffer location, fieldbus IO node type, fieldbus type, fieldbus message processing result, length of the fieldbus upstream message, and fieldbus upstream message body.

3. The fieldbus message transmission method based on a general message shell according to claim 2, characterized in that, After receiving the fieldbus downstream message sent by the field device tool, it further includes: Verify the received first general message shell downlink information; If the verification passes, search for a fieldbus transmission element with an idle status in the buffer queue, write the relevant information into the fieldbus transmission element according to the fieldbus downlink message, and switch the fieldbus transmission element with the idle status to the downlink ready state. If the verification fails, discard the fieldbus downlink message and reply with the error reason, and the fieldbus transmission element with the idle status remains in the idle state. Among them, a single fieldbus transmission element includes a state machine, source node information, fieldbus IO node information, fieldbus information, timeout information, fieldbus downlink information, and fieldbus uplink information, and the buffer queue contains multiple fieldbus transmission elements.

4. The fieldbus message transmission method based on a general message shell according to claim 3, characterized in that, The writing the relevant information into the fieldbus transmission element according to the fieldbus downlink message includes: writing the source node information, fieldbus IO node information, fieldbus downlink information, and the fieldbus type in the fieldbus information into the fieldbus transmission element with the idle status, and setting the timeout setting value of the timeout information of the fieldbus transmission element.

5. The fieldbus message transmission method based on a general message shell according to claim 4, characterized in that The waiting for and receiving the fieldbus uplink message replied by the fieldbus IO node includes: During the waiting process, the cumulative processing time in the timeout information is updated in real time; If the reply from the fieldbus IO node is not received before the cumulative processing time accumulates to the timeout setting value, set the length of the fieldbus uplink information message in the fieldbus transmission element with the uplink waiting status to 0, set the transmission processing result to timeout for the reply from the target fieldbus IO node, and switch the fieldbus transmission element with the uplink waiting status to the uplink ready state; If the reply from the fieldbus IO node is received before the cumulative processing time accumulates to the timeout setting value, verify the received fieldbus uplink message. If the verification passes, take out the fieldbus message processing result in the replied fieldbus uplink message and fill it into the fieldbus information in the fieldbus transmission element with the uplink waiting status, take out the fieldbus uplink message length and the fieldbus uplink message body and fill them into the fieldbus uplink information in the fieldbus transmission element with the uplink waiting status, and switch the fieldbus transmission element with the uplink waiting status to the uplink ready state. If the verification fails, discard the current frame reply message and continue waiting, and the fieldbus transmission element with the uplink waiting status remains in the uplink waiting state.

6. The fieldbus message transmission method based on a general message shell according to claim 5, characterized in that, Loading the fieldbus uplink message into a preset first general message shell and sending it to the field device tool includes: Taking out the source node information, fieldbus IO node information, fieldbus information, and fieldbus uplink information in the fieldbus transmission element with the uplink ready status and filling them into the first general message shell uplink information, and sending them out according to the source node information.

7. A fieldbus message transmission system based on a general message shell, characterized in that, Including: The first processing module is used to receive the field bus downlink message sent by the field device tool, and is used to load the field bus uplink message into a preset first general message shell and send it to the field device tool, where the first general message shell contains relevant information required for transmitting the field bus message between the controller node and the field device tool; The second processing module is used to load the field bus downlink message into a preset second general message shell and send it to the field bus IO node, and is used to wait for and receive the field bus uplink message replied by the field bus IO node, where the second general message shell contains relevant information required for transmitting the field bus message between the controller node and the field bus IO node; The step of loading the field bus downlink message into a preset second general message shell and sending it to the field bus IO node includes: Performing a secondary confirmation on the status of the target IO node to be sent. If the confirmation is passed, filling the relevant information in the field bus transmission element with the downlink ready state into the second general message shell, completing the content of the second general message shell, and sending the supplemented second general message shell to the target IO node. The field bus transmission element with the downlink ready state is switched to the uplink waiting state. If the confirmation fails, discarding the field bus downlink message, setting the length of the field bus uplink information message in the field bus transmission element with the downlink ready state to 0, setting the transmission processing result to the secondary confirmation failure of the target field bus IO node, and switching the field bus transmission element with the downlink ready state to the uplink ready state; The step of filling the relevant information in the field bus transmission element with the downlink ready state into the second general message shell includes: taking out the type and the field bus downlink information in the field bus information from the field bus transmission element with the downlink ready state and filling them into the second general message shell.

8. A computer-readable storage medium, characterized in that, A computer program is stored thereon, and when the computer program is executed by a processor, it implements the field bus message transmission method based on a general message shell according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Data transmission method, electronic equipment and storage medium

    CN111209240A

  • Communication method based on CAN bus and related device

    CN116781450A