Parameter updating method and system and data interaction method and system

By establishing direct interactive connections in multi-PLC systems and adopting a data interaction method with producer-consumer mode, the problem of HMI processing interactive data in multi-PLC and multi-HMI systems is solved, and the system response speed and stability are improved.

CN119629054APending Publication Date: 2025-03-14MESNAC CO LTD +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411835279.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

In multi-PLC and multi-HMI systems, the use of a single TCP/IP interaction method causes HMI to process interactive data, and the system runs slowly and stutter. Especially in complex control systems, the large amount of data interaction of HMI leads to slow operation and stuttering interface switching.

Method used

By establishing a direct interactive connection between PLCs, the dependence on HMI is reduced, and the producer-consumer mode and MSG instruction communication is adopted to realize parameter interaction and data forwarding between PLCs, avoiding the cross-interaction between HMI and the PLC system.

Benefits of technology

Effectively reduce the interactive burden of HMI, improve system response speed and stability, reduce system complexity, and avoid the problems of slow HMI operation and lag in interface switching.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119629054A_ABST
    Figure CN119629054A_ABST
Patent Text Reader

Abstract

The invention relates to a parameter updating method and system and a data interaction method and system. The parameter updating method is used for updating parameters of equipment in a system comprising multiple HMIs and multiple PLCs, and the system comprises a main device comprising a main HMI and a main PLC which are connected with each other; the auxiliary equipment comprises an auxiliary HMI and an auxiliary PLC which are connected with each other; the parameter updating method is characterized by comprising the steps that connection is established between the main HMI and the auxiliary HMI, connection is established between the main PLC and the auxiliary PLC, and connection is not established between the main HMI and the auxiliary PLC, and connection is not established between the main PLC and the auxiliary HMI; a PLC connection is established between the primary PLC and the secondary PLC to transmit parameter data and parameter update commands.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to a parameter updating method and system, a data interaction method and system, and in particular to a method and system for performing data interaction in a device including multiple HMIs and multiple PLCs. Background Art

[0002] In the prior art, the Programmable Logic Controller (PLC) is one of the core components in industrial automation control, used to control the machines and equipment in the manufacturing process. The Human Machine Interface (HMI) is the interface used by the operator to interact with the control system. The data exchange between PLC and HMI is an important part of realizing factory automation.

[0003] There are several ways for PLC and HMI to exchange data, including serial port connection, Ethernet connection, bus connection, wireless connection, direct connection, tag communication, etc. The following steps are usually included when PLC and HMI exchange data: establish communication connection, address mapping, data reading, data writing, alarm and event recording, real-time monitoring and control. Summary of the invention

[0004] Problems to be solved by the invention In the prior art, when multiple PLCs and multiple HMI systems interact with each other, a single TCP / IP interaction method is used between the HMI system and the PLC. There is no parameter data interaction between the PLCs, resulting in a large amount of HMI interaction data, a high proportion of messages in PLC attribute tasks, and the HMI processing of interaction data is affected, resulting in slow system operation and jamming. Especially in complex control systems, the huge amount of data interaction in the HMI will cause the HMI to run slowly and the interface switching jamming.

[0005] The inventors analyzed the above problems and found that there may be the following reasons: Interaction bottleneck: When all data needs to be forwarded through the HMI, the HMI becomes the interaction bottleneck of the entire system. As the number of PLCs increases, the amount of data that the HMI needs to process increases dramatically, which may cause the HMI's CPU load to be too high, affecting its response speed.

[0006] Data redundancy: If each PLC needs to obtain status information of other PLCs from the HMI, the same data will need to be transmitted multiple times, resulting in increased network traffic and unnecessary data interaction burden.

[0007] The delay increases because data needs to be sent from one PLC to the HMI first, and then forwarded by the HMI to another PLC. This multi-hop communication will increase the delay. In applications with high real-time requirements, this delay may be unacceptable.

[0008] Message processing burden: The high proportion of messages in the attribute tasks of PLC means that a large amount of communication processing work is transferred to PLC. If PLC needs to frequently process data requests and responses from HMI, this will occupy PLC processing resources and affect its efficiency in executing main control tasks.

[0009] HMI performance limitations: HMI devices are usually designed to provide user interfaces and simple data display functions rather than as high-performance data centers. Therefore, when the HMI needs to process large amounts of data, its performance may not be sufficient to support efficient data forwarding.

[0010] The system complexity increases, as all data needs to go through the HMI, which makes the system configuration and maintenance more complicated. Any failure of the HMI may cause communication interruption of the entire system.

[0011] In addition, MSG instruction communication and producer-consumer communication are two different inter-process communication (IPC) modes. MSG instruction usually refers to a concept in the message queue mechanism. Message queue is an asynchronous communication method that allows applications to communicate with each other by sending messages to queues without directly connecting to the receiver. When a process sends a message to a queue, the message is stored until another process takes it out of the queue and processes it. The advantage of this method is that the sender and receiver do not need to be online at the same time, and the relationship between producers and consumers can be decoupled. Its characteristics include: asynchrony, after the message is sent, the sender can continue execution immediately without waiting for the receiver's response; persistence, the message can be persisted in the queue and can be recovered even if the system crashes; reliability, providing reliable message delivery to ensure that the message is processed at least once.

[0012] The producer-consumer model is used to solve resource sharing problems in multi-threaded or multi-process environments. In this model, one or more producer threads are responsible for generating a certain type of data items and placing them in a shared buffer; similarly, one or more consumer threads are responsible for taking data items from the buffer for processing. This shared buffer is usually a data structure of limited size, such as an array, a ring buffer, etc. Its characteristics include: synchronization, depending on the implementation, a synchronization mechanism may be required to prevent race conditions (such as using a mutex lock); efficiency, if the synchronization control is implemented correctly, a very high throughput can be achieved; simplicity: the logic is relatively simple and intuitive, easy to understand and implement.

[0013] In order to solve the above problems, the researchers of the present invention considered the following improvement scheme: enable direct interaction between PLCs, so that PLCs can communicate directly with each other and reduce dependence on HMI. For example, by increasing the parameter interaction between PLCs, a separate one-to-one interaction between the whole machine HMI and PLC is achieved, avoiding the HMI data complexity and system response jamming caused by the cross-interaction between HMI and PLC system. In addition, the respective characteristics of the communication mode based on MSG instruction communication and producer-consumer form are considered to quickly and efficiently perform data interaction and parameter update processing.

[0014] To solve the above problems, it is desired to provide a parameter updating method and system, a data interaction method and system, which can significantly reduce the amount of HMI data interaction for a system including multiple HMIs and multiple PLCs, improve the data processing speed of the HMI system, shorten the response time, and make the HMI run more smoothly.

[0015] Solutions for solving problems The present invention relates to a parameter updating method, which is used for updating the parameters of a device in a system including multiple HMIs and multiple PLCs. The system includes: a main device, which includes a main HMI and a main PLC connected to each other; a sub-device, which includes a sub-HMI and a sub-PLC connected to each other; the parameter updating method is characterized by comprising: establishing a connection between the main HMI and the sub-HMI and between the main PLC and the sub-PLC, and there is no connection between the main HMI and the sub-PLC and between the main PLC and the sub-HMI; and establishing a PLC connection between the main PLC and the sub-PLC to transmit parameter data and parameter updating commands.

[0016] The present invention relates to a parameter updating system, comprising: a main device, comprising a main HMI and a main PLC connected to each other; a sub-device, comprising a sub-HMI and a sub-PLC connected to each other. The parameter updating system is characterized in that a connection is established between the main HMI and the sub-HMI and between the main PLC and the sub-PLC, and there is no connection between the main HMI and the sub-PLC and between the main PLC and the sub-HMI; a PLC connection is established between the main PLC and the sub-PLC for transmitting parameter data and parameter updating commands.

[0017] The present invention relates to a data interaction method, which is used for performing data interaction in a system including multiple HMIs and multiple PLCs. The system includes: a main device, which includes a main HMI and a main PLC connected to each other; a sub-device, which includes a sub-HMI and a sub-PLC connected to each other; the data interaction method is characterized in that it includes: establishing a connection between the main HMI and the sub-HMI and between the main PLC and the sub-PLC, and there is no connection between the main HMI and the sub-PLC and between the main PLC and the sub-HMI; and establishing a PLC connection between the main PLC and the sub-PLC to perform data forwarding and command communication.

[0018] The present invention relates to a data interaction system, comprising: a main device, comprising a main HMI and a main PLC connected to each other; a sub-device, comprising a sub-HMI and a sub-PLC connected to each other, wherein the data interaction system is characterized in that a connection is established between the main HMI and the sub-HMI and between the main PLC and the sub-PLC, and there is no connection between the main HMI and the sub-PLC and between the main PLC and the sub-HMI; a PLC connection is established between the main PLC and the sub-PLC, and the PLC connection is used for data forwarding and command communication.

[0019] Effects of the Invention In the present invention, the data interaction between HMI and PLC adopts a single interaction mode, and there is no parameter data interaction between HMIs, which can effectively reduce the interaction burden of HMI and improve the response speed and stability of the system. When operating in a local area network or locally, the producer-consumer mode communication can obtain better performance, and the message queue using MSG instruction communication can handle network delay and other problems.

[0020] The description in the specification is only exemplary and explanatory and does not limit the protection scope of the present invention.

[0021] For better understanding and implementation, the present invention is described in detail below with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or related technologies, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0023] Figure 1 It is a schematic diagram for explaining the data interaction method between the HMI and PLC involved in the present invention.

[0024] Figure 2 It is a partial flow chart for explaining the parameter updating process according to the present invention.

[0025] Figure 3 This is a flowchart for explaining when the master device updates the parameters of the entire device.

[0026] Figure 4 This is a flowchart for explaining when a slave device updates local parameters.

[0027] Figure 5 It is a schematic diagram for explaining the data exchange method between the HMI and the PLC in the comparative example. DETAILED DESCRIPTION

[0028] In order to make the objectives, technical solutions and advantages of the present invention more clear, the differences between the embodiments of the present invention and the comparative examples will be described in detail below with reference to the accompanying drawings.

[0029] <Example> Figure 1 1 is a schematic diagram for explaining the data interaction method between the HMI and the PLC involved in the present invention. For the convenience of explanation, the parameter update process is taken as an example to explain the data interaction process between the HMI and the PLC, but the data interaction method can also be applied to other processes. In the following embodiments, the example is given that the device as a whole includes three devices, but it is not limited to this and can also include more than three devices.

[0030] Figure 1 The device as a whole includes device A, device B, and device C, wherein device B is the main device, and device A and device C are slave devices. Each device includes an HMI and a PLC, that is, device A includes HMI-A and PLC-A, device B includes HMI-B and PLC-B, and device C includes HMI-C and PLC-C. Among them, HMI-B is the main HMI, PLC-B is the main PLC, HMI-A and HMI-C are slave HMIs, and PLC-A and PLC-C are slave PLCs.

[0031] The specific structure of each device is not particularly limited, and may also include other devices, such as servo, frequency conversion system, etc. The specific content of the parameter is not particularly limited, and may include the operating parameters, configuration parameters, control parameters, etc. of the device, such as the operating speed, temperature alarm threshold, working mode, etc. of the servo and frequency conversion system.

[0032] The whole machine parameter H is a parameter of the whole device, and the whole machine parameter H includes parameters corresponding to device A, device B, and device C, which are recorded as whole machine parameter part a, whole machine parameter part b, and whole machine parameter part c. In the following embodiments, the whole machine parameter H includes three local parameters, but it is not limited to this, and the whole machine parameter H may also include more than three local parameters.

[0033] The local parameter a`, the local parameter b`, and the local parameter c` are parameters of the device A, the device B, and the device C, respectively, and are stored in the device A, the device B, and the device C, respectively. The parameter update process includes the process of making the whole machine parameter a part, the whole machine parameter b part, and the whole machine parameter c part of the whole machine parameter H consistent with the local parameter a`, the local parameter b`, and the local parameter c`, respectively, including the process of updating the local parameter a` of the device A according to the whole machine parameter a part, and also including the process of updating the whole machine parameter a part according to the local parameter a` of the device A.

[0034] <Data interaction method> The following is an introduction to the data interaction method between the HMI and the PLC involved in the present invention. When the HMI and the PLC are connected using a predetermined transmission protocol (e.g., TCP / IP protocol), in order to ensure the accuracy, stability and reliability of the data interaction between the HMI and the PLC, the general operation process includes network configuration and connection establishment, communication protocol and parameter setting, data variable mapping and transmission, data processing and display, and connection maintenance and fault handling.

[0035] Specifically, before data interaction, the following preliminary processing is required to configure the network and establish a connection.

[0036] A physical connection is made, and the Ethernet interfaces of the HMI and the PLC are connected using a network cable, or the HMI and the PLC are connected to the same switch or router to achieve network communication. Specifically, in this embodiment, HMI-A is physically connected to PLC-A, HMI-B is physically connected to PLC-B, and HMI-C is physically connected to PLC-C. There is no physical connection between HMI-B as the main HMI and HMI-A and HMI-C as the secondary HMIs, and there is no physical connection between HMI-A and HMI-C.

[0037] Set addresses and assign unique addresses to HMI and PLC respectively, ensuring that HMI and PLC are in the same network segment or can access each other through routing. Set corresponding network parameters in the configuration interface of HMI and PLC, such as subnet mask, gateway, etc.

[0038] Configure the port number, depending on the communication protocol used (for example, Modbus TCP, EtherNet / IP, etc.), configure the port number of the HMI and PLC. Usually, the default port number of the Modbus TCP slave is 502, but it can be changed as needed.

[0039] After the preliminary processing, the communication protocol is set and parameters are set through the following configuration processing.

[0040] Select the communication protocol. In the programming software or configuration interface of the HMI and PLC, select the established transmission protocol as the communication protocol. According to the selected communication protocol, configure the corresponding parameters, such as data format, verification method, etc.

[0041] Establish a connection. In the HMI configuration software, set the connection parameters with the PLC, including the PLC address, port number, and connection timeout. Make the HMI try to establish a communication connection with the PLC. When the HMI logs in with administrator privileges, the HMI transmits data to the PLC, and the PLC verifies the received data. If the correct verification data is received, the communication connection is successfully established. During the data transmission process, there is a watchdog time limit. Multiple transmissions will be performed within the watchdog time. If the verification data is not received after the timeout, an error will be reported.

[0042] If the communication connection is established successfully, subsequent data interaction can be performed. Specifically, in this embodiment, when HMI-A and PLC-A, HMI-B and PLC-B, and HMI-C and PLC-C have established communication connections, subsequent parameter update processing can be performed. There is no communication connection between HMI-B as the main HMI and HMI-A and HMI-C as the secondary HMIs, and there is no communication connection between HMI-A and HMI-C.

[0043] After the configuration process, data variable mapping and transmission are performed to carry out data interaction processing.

[0044] Define variables. In the programming environment of HMI and PLC, define variables for data interaction respectively. These variables can be input variables, output variables or internal variables.

[0045] Establish a mapping relationship. In the HMI configuration software, establish a mapping relationship between the HMI variables and the PLC addresses. This is usually achieved by configuring a variable table or address mapping. Ensure that the variables in the HMI correspond to the addresses in the PLC one by one so that data can be read and written correctly.

[0046] When the HMI needs to read data from the PLC, the HMI sends a read request to the PLC through the established communication connection. The request usually contains information such as the variable name or address to be read and the data length. After receiving the read request, the PLC reads the corresponding data from the memory according to the address and data length in the request, and sends it to the HMI through the communication connection.

[0047] When the HMI needs to write data to the PLC, the HMI encapsulates the data to be written into a write request and sends it to the PLC through the connection. The request usually contains the variable name or address to be written, the data content, and the verification information. After receiving the write request, the PLC writes the corresponding data into the memory according to the address and data content in the request, and returns the confirmation information of successful writing to the HMI as needed.

[0048] Data processing: After receiving the data sent by PLC, HMI performs necessary processing on the data, such as data parsing, format conversion, etc. Based on the processed data, HMI updates the corresponding display interface, such as instrument panel, indicator light, text box, etc.

[0049] When the operator performs normal operations, other displays and interactions will be performed. For example, the operator can view the operating status and control parameters of the PLC in real time through the HMI display interface; the HMI provides interactive methods such as touch screens, allowing operators to input control instructions or modify parameters by touching the screen.

[0050] When operators perform maintenance or repair operations, they will perform connection maintenance and troubleshooting. For example, in connection monitoring, HMI and PLC usually provide connection status monitoring functions to monitor the status of the connection in real time; if the connection is disconnected or abnormal, the HMI will issue an alarm message and try to re-establish the connection; in fault handling, when a communication failure occurs, the operator will perform troubleshooting and handling by checking the network connection, address and port number configuration, firewall settings, etc.

[0051] In this embodiment, the operator can input the parameters that need to be updated to the device through manual input or batch import in the host computer or HMI. Specifically, for example, in the configuration tool of the HMI software, a mapping relationship between the HMI variables and the PLC variables is established. In the HMI configuration tool, the connection information such as the type, address, port number, etc. of the PLC to be connected is specified. For each HMI variable, the corresponding PLC variable is selected, and the address of the PLC variable is specified. This usually involves filling in the relevant information in the variable table or mapping configuration interface of the HMI software.

[0052] <Parameter update processing> There is no special limitation on the specific application of the data interaction method, and this embodiment takes the parameter update method as an example for explanation. The following specifically describes the parameter update method involved in this embodiment.

[0053] Step S0100: The HMI of the device receives a parameter update instruction input by an operator.

[0054] Step S0110: The HMI determines whether the parameter to be updated is a whole-machine parameter or a local parameter.

[0055] When it is determined that the parameter to be updated is a whole-machine parameter, the process proceeds to step S0120 ; when it is determined that the parameter to be updated is a local parameter, the process proceeds to the following step S2000 .

[0056] Step S0120: When the parameter to be updated is a whole machine parameter, the HMI of the device determines whether it has the authority to update the whole machine parameter.

[0057] When the device is a master device, the HMI of the device has the authority to update the parameters of the entire machine, and the process of updating the parameters of the entire machine by the master device is executed, and the process proceeds to the following step S1000; when the device is a slave device, the HMI of the device does not have the authority to update the parameters of the entire machine, and the process proceeds to step S0130.

[0058] Step S0130: The HMI issues an error message, prompting the operator to update the whole machine parameters on the authorized master device.

[0059] In this embodiment, the master device can update the whole machine parameters and local parameters, and the slave device can only update the local parameters and has no authority to update the whole machine parameters. When the parameter to be updated is a local parameter, it is not necessary to determine whether the device is the master device, thereby improving processing efficiency and reducing the burden on the HMI.

[0060] <Process of updating the whole machine parameters by the master device> The following is an example of an operator inputting the whole machine parameters to be updated in device B (master device). There is no special limitation on the method of setting the master device. For example, the variable value of the specified address in HMI-B can be pre-set to set HMI-B as the master HMI, or the master device can be set according to the state of the hardware toggle switch.

[0061] Step S1000: HMI-B of device B receives a machine parameter update instruction.

[0062] Step S1010: HMI-B determines whether the whole machine parameter to be written is stored in HMI-B. If it is determined that there is no whole machine parameter data to be written in HMI-B, proceed to step S1020; if it is determined that HMI-B has the whole machine parameter data to be written, proceed to step S1030.

[0063] Step S1020: HMI-B reads the whole machine parameter data and the whole machine parameter download command from the ROM (non-volatile memory) in HMI-B to the RAM (volatile memory), and HMI-B executes the whole machine parameter download command to download the whole machine parameter H to be written.

[0064] Step S1030: HMI-B obtains whole machine parameter part a, whole machine parameter part b, and whole machine parameter part c from the downloaded whole machine parameter H, and sends the obtained whole machine parameter part a, whole machine parameter part b, and whole machine parameter part c to PLC-B.

[0065] Specifically, HMI-B encapsulates the whole machine parameter part a, whole machine parameter part b, and whole machine parameter part c into a write request, and sends it to PLC-B through the connection between HMI-B and PLC-B. The write request may include the variable name or address to be written, data content, and verification information.

[0066] Step S1040: PLC-B determines that the devices that need to update parameters include device A, device B, and device C based on the received whole machine parameter H. PLC-B sends the whole machine parameter a related to device A to PLC-A through MSG instruction communication, and sends the whole machine parameter c related to device C to PLC-C through MSG instruction communication.

[0067] Specifically, PLC-B sends the whole machine parameter part a to the parameter address specified in PLC-A and sends the whole machine parameter part c to the parameter address specified in PLC-C through MSG instruction communication. Alternatively, before sending the whole machine parameter part a and the whole machine parameter part c, the network status, the communication status between the HMI and the PLC, the PLC operation status, etc. are detected, and MSG instruction communication is performed when each status is normal.

[0068] Step S1050: After the MSG instruction communication command is sent successfully, PLC-B updates the local parameter b` of device B itself according to the whole machine parameter b part in the specified parameter address, and PLC-B sends the update command to PLC-A and PLC-C through producer-consumer communication, PLC-A updates the local parameter a` of device A according to the whole machine parameter a part in the specified parameter address, and PLC-C updates the local parameter c` of device C according to the whole machine parameter c part in the specified parameter address.

[0069] Therefore, based on producer-consumer communication, devices A, B, and C can be updated at a specified timing, for example, local parameters a`, b`, and c` can be updated synchronously at the same time.

[0070] Step S1060: When the update of local parameters a`, local parameters b`, and local parameters c` is completed, PLC-A, PLC-B, and PLC-C each generate information indicating that the local parameters have been successfully updated, and PLC-A and PLC-C respectively send the information indicating that the local parameters have been successfully updated to PLC-B through producer-consumer communication.

[0071] Specifically, PLC-A, PLC-B, and PLC-C each generate a success flag FlagA, a success flag FlagB, and a success flag FlagC indicating that a local parameter update is successful, and PLC-A and PLC-C respectively send the success flag FlagA and the success flag FlagC to PLC-B through producer-consumer communication.

[0072] Step S1070: PLC-B determines whether the parameter update of all devices is completed. If it is determined that the parameter update of all devices is completed, the process proceeds to step S1080; if it is determined that the parameter update of all devices is not completed, the process proceeds to step S1090.

[0073] Step S1080: PLC-B sends information indicating that the whole machine parameters have been successfully updated to HMI-B, and the operator can confirm the information indicating success on HMI-B.

[0074] Step S1090: PLC-B waits for the specified standby time. If it still does not receive information indicating that the local parameter update is successful from all devices after the standby time has passed, PLC-B sends information indicating that the whole machine parameter update failed to HMI-B, and the operator can confirm the information indicating failure at HMI-B. Wait for the operator to give the next step instruction at HMI-B, and PLC-B will perform the corresponding processing. In this way, the operator can control the parameter update process as needed and find problems in time.

[0075] Alternatively, PLC-B also restores the local parameter b' of device B based on a pre-set setting, and sends a restore command to PLC-A and PLC-C through producer-consumer communication, and PLC-A and PLC-C restore the local parameter a' of device A and the local parameter c' of device C, respectively. In this way, the local parameters a', b', and c' can be kept matched, preventing devices A, B, and C from malfunctioning due to parameter mismatch.

[0076] Alternatively, PLC-B can restore only the local parameters that have not been successfully updated, keep the local parameters that have been successfully updated in the updated state, and send the corresponding information to HMI-B. Wait for the operator to give the next step instruction on HMI-B, and PLC-B will perform the corresponding processing. In this way, the operator only needs to update the parameters of the equipment that has not been updated after eliminating the problem, which can save operation time.

[0077] <Process of updating local parameters of slave device> The following description will take as an example a case where an operator inputs a local parameter a1 to be written into HMI-A of device A (slave device).

[0078] Step S2000: HMI-A receives a local parameter a1 update instruction.

[0079] Step S2010: HMI-A determines whether the local parameter a1 to be written is already stored in HMI-A. If it is determined that there is no local parameter a1 to be written, the process proceeds to step S2020; if it is determined that there is already a local parameter a1 to be written, the process proceeds to step S2030.

[0080] Step S2020: HMI-A reads the local parameter data and the local parameter download command from the ROM (non-volatile memory) in HMI-A to the RAM (volatile memory), and HMI-A executes the local parameter download command to download the local parameter a1 to be written.

[0081] Step S2030: HMI-A sends the local parameter a1 to be written to PLC-A. Specifically, HMI-A encapsulates the local parameter a1 into a write request and sends it to PLC-A through the connection between HMI-A and PLC-A. The write request may include the variable name or address to be written, data content, and verification information.

[0082] Step S2040: PLC-A determines the target parameters to be updated based on the received local parameter a1 as the local parameter a' in PLC-A and the whole machine parameter a in PLC-B. PLC-A sends the local parameter a1 to the parameter address specified in PLC-B through MSG instruction communication.

[0083] Step S2050: After the MSG instruction communication command is sent successfully, PLC-A updates the local parameter a` in PLC-A according to the local parameter a1, and sends the update command to PLC-B through producer-consumer communication. PLC-B updates the whole machine parameter a according to the local parameter a1 in the specified parameter address.

[0084] Therefore, based on producer-consumer communication, devices A and B can be updated at a specified timing, for example, local parameter a' and whole machine parameter a can be updated synchronously at the same time.

[0085] Step S2060: When the update of local parameter a' and whole machine parameter a is completed, PLC-A and PLC-B each generate information indicating that the parameter update is successful. PLC-B sends the information indicating that the whole machine parameter a is successfully updated to PLC-A in a producer-consumer format.

[0086] Specifically, PLC-A generates a success flag FlagA indicating that the local parameter a' is updated successfully, and PLC-B generates a success flag FlagB indicating that the whole machine parameter a is updated successfully. PLC-B sends the success flag FlagB to PLC-A via producer-consumer communication.

[0087] Step S2070: PLC-A determines whether all parameter updates are completed. If it is determined that all parameter updates are completed, the process proceeds to step S2080; if it is determined that all parameter updates are not completed, the process proceeds to step S2090.

[0088] Step S2080: PLC-A sends information indicating that all parameters have been successfully updated to HMI-A, and the operator can confirm the information indicating success on HMI-A.

[0089] Step S2090: PLC-A waits for a specified standby time. After the standby time has passed, PLC-A sends information indicating failure of local parameter update to HMI-A, and the operator can confirm the information indicating failure at HMI-A. PLC-A waits for the operator to perform corresponding processing after HMI-A gives the next step instruction. In this way, the operator can control the progress of parameter update as needed and find problems in time.

[0090] Alternatively, PLC-A can also restore the local parameter a` in PLC-A based on a preset setting, and send a restoration command to PLC-B through producer-consumer communication, so as to restore the overall parameter a of device B. In this way, the local parameter a` and the overall parameter a can be kept consistent, preventing problems caused by inconsistent parameters.

[0091] <Process of the master device updating local parameters> Hereinafter, taking the case where an operator inputs the local parameter b1 to be updated on the HMI-B of device B (master device) as an example for explanation.

[0092] The processing performed by HMI-B after receiving the overall parameter update instruction is simpler than the above processing. It only needs to update the original local parameter b` and the overall parameter b according to the local parameter b1 to be written, and there is no need to perform synchronous update with other devices. Therefore, it will not be elaborated here.

[0093] <Data exchange processing between HMI and PLC> In this embodiment, when the HMI needs to read data from the PLC, the HMI will send a read request to the PLC through the established communication connection. The request usually contains information such as the variable name or address to be read and the data length. After receiving the read request, the PLC reads the corresponding data from the memory according to the address and data length in the request, and sends it to the HMI through the communication connection.

[0094] In the PLC programming environment, define variables for each parameter that needs to be updated in the local parameters, that is, define a clear and descriptive name for each parameter, such as MotorSpeed (motor speed), TempAlarmThreshold (temperature alarm threshold), OperatingMode (operating mode). Select an appropriate data type according to the nature of the parameter, such as integer (INT), real number (REAL), enumeration type (ENUM), etc. Allocate a unique address for each variable in the PLC memory, and these addresses will be used to reference these variables in the PLC program.

[0095] In the HMI programming environment, define a corresponding HMI variable for each PLC variable. The naming of the HMI variable can correspond to the PLC variable, but usually the _HMI suffix is added after the name for distinction, such as MotorSpeed_HMI, TempAlarmThreshold_HMI, OperatingMode_HMI. Ensure that the data type of the HMI variable matches the data type of the PLC variable.

[0096] The above describes the case where HMI-B directly sends the HMI variables in the whole machine parameter b part to the addresses of the PLC variables specified in PLC-B through mapping. However, if PLC-B needs to actively read the HMI variables in the whole machine parameter b part of HMI-B, the corresponding reading logic can also be written in the program of PLC-B to write the PLC variables in PLC-B according to the HMI variable values ​​in the whole machine parameter b part of HMI-B.

[0097] <Comparative Example> Figure 5 It is a schematic diagram for explaining the data exchange method between the HMI and the PLC in the comparative example. Figure 5 The device includes equipment A, equipment B, equipment C, and the overall structure is Figure 1 The difference is that there is no distinction between master and slave devices, and each HMI has physical and communication connections with each PLC.

[0098] In the comparative example, when data is exchanged, each HMI communicates with each PLC using MSG instructions. The HMI needs to process a large amount of data, and its performance is difficult to support efficient data forwarding tasks. Moreover, each PLC receives MSG instruction communications from each HMI, and the PLC needs to frequently process data requests and responses from the HMI, which will occupy the PLC's processing resources and affect its efficiency in executing the main control tasks.

[0099] Compared with the comparative example, the technical solution of the present invention can at least achieve the following technical effects.

[0100] Direct interaction between PLCs allows PLCs to communicate directly with each other, reducing reliance on HMI. Since there is no physical connection between the main HMI and the slave PLC, or between the main PLC and the slave HMI, this simplifies the number of hardware connectors, saves costs and installation time. Since there is no communication connection between the main HMI and the slave PLC, or between the main PLC and the slave HMI, this simplifies network settings and saves network resources.

[0101] By increasing the parameter interaction between PLCs, a separate one-to-one interaction between the whole machine HMI and PLC is achieved, avoiding the problem of complicated HMI data and system response jams caused by the cross-interaction between the HMI and PLC systems.

[0102] The problem of high proportion of messages in PLC attribute tasks is solved, so PLC does not need to handle a large amount of communication processing work, which can improve the efficiency of PLC in executing its main control tasks.

[0103] The HMI does not need to process large amounts of data, and its performance is sufficient to support efficient data forwarding.

[0104] The system complexity is reduced, and a large amount of data does not need to pass through the HMI, which simplifies the configuration and maintenance of the system. The failure rate of any HMI is reduced, and the communication of the entire system is stable and reliable.

[0105] It should be clear that the above described embodiments are part of the embodiments of the present invention, but not all of them. Based on the embodiments in the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the embodiments of the present invention.

[0106] For example, Figure 1 The device shown in the figure includes one main device and two slave devices, but it may also include more than one main device and more than one slave device. If the connection relationship between the main device and the slave device and the data interaction method are based on the above-mentioned content to solve the problem of large amount of HMI interaction data and high proportion of Message in PLC attribute tasks, it can achieve a significant reduction in the amount of HMI data interaction, improve the data processing speed of the HMI system, shorten the response time, and make the HMI run more smoothly.

[0107] The main device and the slave device can be pre-set or temporarily set as needed during data interaction, without any special restrictions.

[0108] In addition, it is also possible that, in step S1060, when at least any one of the local parameters a`, b`, and c` (for example, the local parameter c`) cannot be updated, the corresponding PLC (for example, PLC-C) generates information indicating that the local parameter cannot be updated, and sends the information indicating that the local parameter cannot be updated to PLC-B through producer-consumer communication. Specifically, it is possible that the corresponding PLC (for example, PLC-C) generates a success flag (for example, FailC) indicating that the local parameter update failed, and sends it to PLC-B through producer-consumer communication.

[0109] Therefore, when PLC-B receives information indicating that local parameters cannot be updated, in step S1090, PLC-B does not need to wait for the specified standby time, but immediately sends information indicating that the whole machine parameter update has failed to HMI-B, and the operator can promptly confirm the information indicating failure on HMI-B.

Claims

1. A parameter updating method for updating parameters of a device in a system including multiple HMIs and multiple PLCs, the system comprising: A master device, which includes a master HMI and a master PLC connected to each other; A slave device including a slave HMI and a slave PLC connected to each other; The parameter updating method is characterized by comprising: Establishing a connection between the primary HMI and the secondary HMI and between the primary PLC and the secondary PLC, and no connection between the primary HMI and the secondary PLC and between the primary PLC and the secondary HMI; A PLC connection is established between the primary PLC and the secondary PLC to transmit parameter data and parameter update commands.

2. The parameter updating method according to claim 1, characterized in that: The parameters of the master device and the slave device can be updated by operating the master device. In the case of updating the parameters of the slave device by operating the master device, the parameter data to be updated is transmitted via the PLC connection using MSG instruction communication.

3. The parameter updating method according to claim 2, characterized in that: After the parameter data to be updated is transmitted by the MSG instruction communication, a parameter update command is transmitted by producer-consumer communication via the PLC connection, so that the slave device performs parameter update.

4. The parameter updating method according to claim 3, characterized in that: When the slave device completes the parameter update, information indicating that the parameter update is successful is sent from the slave device to the master device via the PLC connection using producer-consumer communication. When the parameter update of all devices is completed, the main PLC sends information indicating that the whole machine parameter update is successful to the main HMI.

5. The parameter updating method according to claim 4, characterized in that: If the master PLC has not received information indicating that the local parameters of all devices have been successfully updated after the standby time has passed, it will send information indicating that the whole machine parameter update has failed to the master HMI.

6. The parameter updating method according to claim 4, characterized in that: In the event that at least one of the slave devices cannot complete the parameter update, a message indicating the failure of the parameter update is sent from the slave device to the master device via the PLC connection using a producer-consumer communication, When the master PLC receives the information indicating that the parameter update fails, the master PLC sends the information indicating that the whole machine parameter update fails to the master HMI.

7. The parameter updating method according to claim 5 or 6, characterized in that: In the event that the whole machine parameter update fails, a recovery command for restoring the local parameters is sent from the master device to the slave device via the PLC connection using producer-consumer communication.

8. A parameter updating system, comprising: A master device, which includes a master HMI and a master PLC connected to each other; A slave device, which includes a slave HMI and a slave PLC connected to each other, The parameter updating system is characterized in that: A connection is established between the main HMI and the sub-HMI, and between the main PLC and the sub-PLC, but no connection is established between the main HMI and the sub-PLC, and between the main PLC and the sub-HMI; A PLC connection is established between the main PLC and the secondary PLC for transmitting parameter data and parameter update commands.

9. A data interaction method for performing data interaction in a system including multiple HMIs and multiple PLCs, the system comprising: A master device, which includes a master HMI and a master PLC connected to each other; A slave device including a slave HMI and a slave PLC connected to each other; The data interaction method is characterized by comprising: Establishing a connection between the primary HMI and the secondary HMI and between the primary PLC and the secondary PLC, and no connection between the primary HMI and the secondary PLC and between the primary PLC and the secondary HMI; A PLC connection is established between the main PLC and the secondary PLC to perform data forwarding and command communication.

10. A data interaction system, comprising: A master device, which includes a master HMI and a master PLC connected to each other; A slave device, which includes a slave HMI and a slave PLC connected to each other, The data interaction system is characterized in that: A connection is established between the main HMI and the sub-HMI, and between the main PLC and the sub-PLC, but no connection is established between the main HMI and the sub-PLC, and between the main PLC and the sub-HMI; A PLC connection is established between the main PLC and the secondary PLC, and the PLC connection is used for data forwarding and command communication.

Citation Information

Cited By

  • Parameter updating method and system, and data interaction method and system

    WO2026124608A1