PLC and web page-based double-end customized fault information transmission coding method

CN122601655APending Publication Date: 2026-08-18CHONGQING JIABEN AUTOMATION EQUIP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610725000.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-25
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

[0003]根据以上内容,现有技术在实现PLC与WEB端之间的故障信息传输时,通常需要增加具备网络通信功能的工控平板或额外硬件模块,从而显著提高了系统的整体成本;同时,在通信实现方式上,多采用复杂的通信协议及字符串形式的数据传输,不仅增加了程序开发难度,对开发人员的技术要求较高,还会占用较多的系统资源,降低通信效率

Benefits of technology

本发明基于现有工业控制环境中的原有硬件设备开展设计,无需额外引入新的工控平板或通信硬件,即可实现PLC与WEB端之间的故障信息交互,从而有效降低系统建设过程中的硬件投入成本。同时,通过充分利用既有设备资源,避免了新增硬件带来的兼容性问题与维护负担,使整体系统结构更加简洁稳定,在满足功能需求的同时显著提升经济性,适用于对成本控制要求较高的工业应用场景。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122601655A_ABST
    Figure CN122601655A_ABST
Patent Text Reader

Abstract

The application discloses a double-end self-defined fault information transmission coding method based on PLC and WEB pages, relates to the technical field of industrial control and industrial internet communication, and comprises the following steps: information interfaces between PLC and WEB pages are pre-set in a PLC program, and integer values are used for storage and transmission in the information interfaces; a corresponding coding rule between fault shutdown information and integer values is predefined in the PLC program based on the information interfaces, and different integer values correspond to different fault types. The application realizes PLC and WEB information interaction based on existing hardware, does not need to add new equipment, reduces cost, improves system stability, simplifies the development process through a template interface design, reduces the technical threshold, improves programming efficiency, adopts numerical coding and double-end mapping mechanism, realizes flexible self-definition and dynamic adjustment of communication content, does not need to modify the underlying program, and improves system expansibility and maintenance convenience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of industrial control and industrial internet communication technology, specifically to a dual-end customized fault information transmission encoding method based on PLC and WEB page. Background Technology

[0002] In the field of industrial automation control, industrial control equipment with programmable logic controllers (PLCs) at its core is widely used in scenarios such as production line operation control, equipment status monitoring, and fault management. With the development of informatization and intelligent manufacturing, enterprises have placed higher demands on remote monitoring of equipment operating status and fault information traceability. This typically requires transmitting equipment downtime or abnormal information collected by the PLC to a host computer or web page for centralized display and analysis. Currently, information interaction between the PLC and the web interface usually relies on network communication technology, using the transmission of text information or complex data structures to express equipment status, thereby achieving visualized management of equipment operation.

[0003] Based on the above, existing technologies for transmitting fault information between PLCs and web terminals typically require the addition of industrial control tablets or additional hardware modules with network communication capabilities, significantly increasing the overall system cost. Furthermore, the communication implementation often employs complex communication protocols and string-based data transmission, increasing program development difficulty, demanding higher technical skills from developers, consuming significant system resources, and reducing communication efficiency. In addition, existing solutions lack flexibility in adjusting fault information content; any modification or expansion of the transmitted content often necessitates substantial changes to the underlying communication program, leading to high system maintenance costs and failing to meet the demands of industrial sites for low-cost, highly flexible, and efficient information transmission.

[0004] The information disclosed in the background section is only intended to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0005] The purpose of this invention is to provide a dual-end customized fault information transmission encoding method based on PLC and WEB page to solve the problems mentioned in the background art.

[0006] To achieve the above objectives, the present invention provides the following technical solution: a dual-end customized fault information transmission encoding method based on PLC and WEB page, comprising the following steps: The information interface between the PLC and the WEB page is pre-defined in the PLC program, and integer values ​​are used for storage and transmission in the information interface. In the PLC program, the corresponding encoding rules between fault shutdown information and integer values ​​are predefined based on the information interface, so that different fault types are associated with different integer values. During the operation of industrial control equipment, corresponding operations are triggered through the human-machine interface, and corresponding integer values ​​are output to the information interface according to the corresponding coding rules; Based on a preset relationship consistent with the corresponding encoding rules, the web page parses the integer value received by the information interface and displays the fault shutdown information corresponding to the integer value. When it is necessary to update or redefine fault shutdown information, the corresponding encoding rules in the PLC program and the corresponding parsing relationship in the WEB page are adjusted synchronously to complete the re-agreement of the communication content between the two parties.

[0007] Preferably, the data range in the information interface is constrained and validated to improve the stability and validity of integer values ​​during transmission. The steps are as follows: Set corresponding value ranges for integer values ​​in the information interface, and assign corresponding encoding type identifiers to different ranges; In the PLC program, the integer value of the information writing interface is matched and judged within a range. If the range condition is not met, the alternative value writing operation is performed. After receiving an integer value on the web page, the value is classified and identified according to a preset range, and its corresponding encoding category is marked. For integer values ​​that do not belong to the preset range, perform anomaly identification processing and record the corresponding numerical information for subsequent processing.

[0008] Preferably, based on the expansion requirements of the integer numerical coding structure, the method of expressing fault information is structurally designed, and the steps are as follows: Integer values ​​are divided into multiple continuous or non-contiguous bit segments according to preset rules, and a corresponding encoding meaning is assigned to each bit segment; In the PLC program, based on the fault type, the corresponding information is written into each bit segment to form a combined code; The received integer value is split according to the same bit segment rules on the web page, and the corresponding data of each bit segment is extracted. The data segments obtained from the splitting are combined in a preset order to generate corresponding fault information.

[0009] Preferably, to address the potential for accidental triggering during human-computer interaction, the operation triggering mechanism undergoes reliability enhancement processing, with the following steps: In the human-computer interaction interface, set a corresponding trigger state variable for each operation button and record the button press and release states; The duration of the button trigger signal is detected, and a valid trigger is determined when the duration reaches a preset threshold. After confirming the trigger status, select the matching integer value according to the corresponding encoding rule; Write the selected integer value into the information interface and reset the trigger status variable.

[0010] Preferably, a state lock identifier is set for each operation button in the human-computer interaction interface, and the corresponding button is locked when the trigger state is valid; during the period of the lock state, repeated trigger signal input is restricted, and the lock is released to restore the operation response when the state reset is completed.

[0011] Preferably, considering the data processing efficiency requirements of web pages, the process of parsing integer values ​​is accelerated and optimized, as follows: Construct a mapping table structure between integer values ​​and fault information in the web page, and store it in key-value pair format; When an integer value is received, the value is used as a key to enter the mapping table for lookup. If no corresponding item is found in the mapping table, execute the backup data query logic and write the query result into the mapping table; Output the corresponding data obtained from the mapping table to the interface display area.

[0012] Preferably, to address the consistency issue during the communication content adjustment process, constraints are imposed on the synchronization mechanism between encoding rules and parsing relationships. The steps are as follows: In the PLC program, set the corresponding version identifier data for each group of coding rules and store it together with the integer value; Establish version record information corresponding to the encoding rules in the web page and associate it with the parsing relationship; During data transmission, the integer value and the corresponding version identifier are simultaneously transmitted to the web page; The received version identifier is compared on the web page, and the corresponding parsing relationship is selected based on the comparison result.

[0013] Preferably, the correspondence between version identifiers and parsing relationships is handled to ensure consistency. A binding table for version identifiers and parsing relationships is established in the web page and its uniqueness is set. When receiving an integer value and a version identifier, the binding relationship matching process is performed. When the matching fails, the preset parsing relationship is called and the correspondence information between the current version identifier and the integer value is recorded.

[0014] Preferably, to address the data differentiation requirements in multi-device access scenarios, the data organization method in the information interface is optimized, with the following steps: In the information interface, assign independent data storage addresses or data identification fields to different industrial control devices; In the PLC program, the corresponding integer value is written to the corresponding data storage location based on the device identification information; After receiving data from the web page, the integer values ​​are classified and grouped according to the data source identifier; The categorized integer values ​​are then mapped to the display areas of different devices for output.

[0015] Preferably, based on the abnormal situations that occur during operation, the abnormal state identification and handling methods are supplemented with the following steps: Multiple exception identifier values ​​are preset in the integer numerical encoding rules, each corresponding to a different type of exception state; In the PLC program, based on the detected abnormal conditions, the corresponding abnormality identifier value is written into the information interface; After receiving an integer value on the web page, it is matched and judged against the value of the anomaly indicator. When an abnormal identifier value is matched, the corresponding abnormal handling logic is invoked and the abnormal status information is output.

[0016] The technical effects and advantages provided by the present invention in the above technical solution are as follows: This invention is designed based on existing hardware equipment in the current industrial control environment. It enables fault information exchange between the PLC and the web terminal without the need for additional industrial control tablets or communication hardware, thus effectively reducing hardware investment costs during system construction. Simultaneously, by fully utilizing existing equipment resources, it avoids compatibility issues and maintenance burdens associated with adding new hardware, resulting in a simpler and more stable overall system structure. While meeting functional requirements, it significantly improves economic efficiency and is suitable for industrial applications with high cost control requirements.

[0017] This invention simplifies the program development process and improves programming efficiency by constructing a templated information interface design, ensuring a unified standard for data interaction between the PLC and the web interface. In implementation, developers only need to configure parameters and write simple logic based on preset rules to complete the information transmission function, reducing reliance on complex communication protocols and advanced programming skills, thereby shortening the development cycle and lowering the technical threshold. Furthermore, the structured interface makes system expansion and maintenance more convenient, contributing to improved overall development and operation efficiency.

[0018] This invention employs a dual-end customizable communication mechanism, allowing transmitted content to be expressed only in concise numerical form, eliminating the need for direct text transmission and effectively reducing data transmission volume and parsing complexity. Furthermore, by establishing adjustable mapping relationships on both the PLC and WEB sides, flexible redefinition of communication content is achieved. When changes to fault information representation are needed, updates can be completed simply by adjusting the corresponding relationships, without frequent modifications to the underlying program logic. This approach not only enhances the system's flexibility and scalability but also improves the convenience of later maintenance, adapting to ever-changing industrial application needs. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.

[0020] Figure 1 This is a flowchart of the method for the dual-end customized fault information transmission encoding method based on PLC and WEB page of the present invention. Detailed Implementation

[0021] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, they are provided so that the description of this disclosure will be more complete and fully convey the concept of the exemplary embodiments to those skilled in the art.

[0022] This invention provides, for example Figure 1 The illustrated dual-end custom fault information transmission encoding method based on PLC and WEB page includes the following steps: In industrial control scenarios, PLC programs need to establish information channels for data interaction with web pages. To ensure communication stability and efficiency, this information channel is defined using a unified data interface. In the implementation process, a dedicated storage area for information exchange is pre-allocated within the PLC program's data area. This storage area uses integer variables as the basic data carrier, and the correspondence with external communication is achieved through fixed addresses or variable mapping. Integer variables have the advantages of small storage space, high processing efficiency, and strong compatibility within the PLC, and can meet the real-time and stability requirements of industrial environments. Therefore, integer values ​​are selected as the basic unit for information expression.

[0023] During interface definition, the bit width of integer variables needs to be configured appropriately, such as using 16-bit or 32-bit integers to meet the information encoding requirements of different orders of magnitude. When there are few types of fault information, a smaller bit width integer variable can be used to reduce resource consumption; when there are many types of information to be expressed or there are expansion requirements, a larger bit width integer variable can be used, thus reserving space for future expansion. In addition, to ensure the standardization of data transmission, the integer variable needs to be uniformly named and address-assigned in the PLC program, so that it has a clear identification attribute during communication and avoids conflicts caused by the cross-use of multiple variables.

[0024] In terms of data storage, this integer variable is typically defined in the PLC's global data area or a specific data block, and its read and write operations are controlled through program logic. When a status change or fault information occurs during equipment operation, the information is updated by assigning a value to this integer variable. This assignment process can be triggered by logical judgment or by human-machine interaction. Since the integer variable only carries numerical information, compared to string data, it does not require complex character processing and encoding conversion within the PLC, thus significantly reducing CPU load and improving program execution efficiency.

[0025] During data transmission, the integer variable is passed to the web page via existing communication links, such as Ethernet communication, industrial bus, or other network protocols. Since the transmitted content consists only of integer values, the data packet structure is relatively simple, and the data length is fixed during transmission, effectively reducing communication bandwidth consumption and parsing complexity caused by uncertain data length. Furthermore, integer data has good universality across different platforms, avoiding parsing errors caused by inconsistent character encoding formats and improving the reliability of cross-platform communication.

[0026] To further improve the stability of the interface, a data refresh mechanism can be incorporated into its design. For example, by periodically updating the integer variable's value or triggering an update when the value changes, the web page can ensure that it receives the latest status information in a timely manner. Furthermore, a specific range of values ​​can be reserved for this integer variable as an anomaly indicator; for instance, a certain value can be set to represent communication interruption or invalid data, thus providing clear criteria for judgment in abnormal situations and improving the overall robustness of the system.

[0027] In terms of interface expansion, this integer variable can not only represent single fault information, but also achieve multi-dimensional information expression through bit segmentation. For example, an integer variable can be divided into multiple bits, with each bit corresponding to a different type of status identifier, thereby enabling the combined expression of various information without increasing the number of variables. This approach can further improve data utilization efficiency and enhance the interface's scalability, making it adaptable to the needs of complex industrial scenarios.

[0028] In summary, by pre-defining a unified information interface in the PLC program and using integer values ​​as the storage and transmission medium, we can not only simplify the data structure and reduce communication complexity, but also improve data processing efficiency and system stability. Simultaneously, it provides fundamental support for subsequent information encoding, parsing, and dynamic adjustments. This approach, while ensuring communication reliability, effectively reduces dependence on hardware and computing resources, making it suitable for industrial control environments with high requirements for real-time performance, stability, and cost control.

[0029] In industrial control operations, to achieve standardized expression and efficient transmission of equipment fault information, it is necessary to uniformly encode various fault and shutdown information on the PLC side. Specifically, during the PLC programming phase, it is necessary to systematically organize potential equipment malfunctions, shutdown causes, and related status information, and based on pre-planned coding rules, map different categories of fault information to unique integer numerical identifiers. In this way, textual information that originally had semantic descriptive properties is transformed into structured numerical information, thereby providing a standardized foundation for subsequent data transmission and parsing.

[0030] In formulating coding rules, the first step is to categorize and organize the types of faults that may occur in the industrial field, such as equipment malfunctions, production logistics anomalies, product quality issues, human intervention, and other external influencing factors. After classification, a unique numerical code is assigned to each type of fault, for example, using consecutive integers. Smaller values ​​are prioritized for high-frequency or critical fault types, thereby improving identification efficiency during system operation. Through this coding mapping relationship, a one-to-one correspondence between fault types and integer values ​​can be established, allowing the PLC program to process only numerical information to express complex semantics when outputting data.

[0031] To ensure the stability and scalability of coding rules, segmentation or reservation strategies are typically employed during coding design. For example, in the initial stage, only a portion of the coding range is used for currently known fault types, while unused numerical ranges are reserved for potentially added fault categories in the future. This avoids coding conflicts or reallocation issues during system expansion. Furthermore, different coding ranges can be set according to different types of faults. For instance, equipment faults can be divided into one numerical range, and logistics-related problems into another. This range division allows for a more structured expression of the coding semantics, facilitating rapid category determination during subsequent parsing and improving system response efficiency.

[0032] At the PLC program implementation level, this coding rule typically exists as embedded logic. It identifies the current equipment state through conditional judgments or state triggering mechanisms and outputs the corresponding integer code value based on the matching result. For example, when a equipment stop signal is detected, the corresponding variable is assigned the code representing equipment shutdown; when an abnormal material supply is detected, the variable is updated to the corresponding logistics problem code; when a quality inspection failure is detected, the code corresponding to the quality problem is output. This logic-based coding assignment method enables unified management of multiple fault states and ensures clear distinction between different states.

[0033] In practical applications, this encoding rule can not only be used to represent single faults, but also be optimized by combining it with a priority mechanism. For example, when multiple faults occur simultaneously, the most critical fault code can be selected for output according to a pre-set priority to avoid information conflicts; or, by expanding the encoding bit width, multiple fault information can be combined to further improve information carrying capacity. In addition, the encoding value can be updated in different time periods by combining it with the time dimension to reflect the dynamic changes in the equipment's operating status.

[0034] To enhance the flexibility of coding rules, a dynamic adjustment mechanism can be supported during the design phase. When production processes change or new equipment types are added, the coding rules can be updated. By redefining the correspondence between certain values ​​and fault types, adaptation to new scenarios can be achieved. During this process, by maintaining the continuity and logical consistency of the coding structure, expansion can be completed without affecting the overall communication framework, thereby reducing system maintenance costs.

[0035] From a communication perspective, converting fault information into integer codes means that only numerical information needs to be transmitted during data transfer. Compared to directly transmitting text descriptions, this significantly reduces data length and communication bandwidth consumption. Furthermore, because integer data has a fixed length, complex string processing is unnecessary during data parsing, thus reducing computational resource consumption and improving data processing efficiency. This approach is particularly suitable for resource-constrained control equipment environments, helping to improve overall system performance while ensuring information integrity.

[0036] Furthermore, during the coding rule design process, exception codes or reserved codes can be introduced to represent undefined states or communication anomalies. For example, when the PLC does not detect valid fault information, it can output a specific value to indicate normal operation; when the communication link is abnormal or the data is invalid, a reserved code can be used for identification, thus providing a clear basis for status judgment for the web terminal. This design can enhance the system's fault tolerance and improve the overall operational reliability.

[0037] In summary, by pre-establishing unified fault information coding rules on the PLC side and mapping various downtime causes to corresponding integer values, not only is the standardized expression of fault information achieved, but a stable foundation is also provided for subsequent data transmission, parsing, and dynamic expansion. This coding method effectively improves system operating efficiency and maintainability while reducing communication complexity, and can adapt to the needs of various industrial application scenarios.

[0038] In the operation of industrial control systems, to achieve visualized input and rapid response of equipment operating status and fault information, a human-machine interface (HMI) needs to be built into the industrial control equipment program. This HMI converts the operator's judgment results or equipment status information into structured data and outputs it to a designated information interface. In practice, this HMI is typically built on a touchscreen, control panel, or embedded display terminal, presenting various operation options in a graphical interface format. This allows operators to intuitively select the corresponding equipment status or fault type, thereby completing the information input.

[0039] During the design phase of the human-machine interface, common fault types need to be summarized and organized based on actual production scenarios, and visualized using buttons, switches, or selection boxes. Each interactive control corresponds to one or more equipment states, such as equipment shutdown, material abnormality, or quality issues. Clear interface partitioning and logical categorization enable operators to quickly locate and select the corresponding operation. The interface layout must adhere to industrial field operating habits to ensure that operations can be completed quickly and accurately even in emergency situations, thereby reducing the impact of human error.

[0040] In terms of interactive logic implementation, each button is associated with a specific variable or logical trigger condition in the PLC program. When an operator triggers a button, the system converts the operation into a corresponding control signal through internal logic, driving changes in the relevant variables. This change process is typically achieved through an event-triggered mechanism or a state detection mechanism within a scan cycle. Upon detecting a change in button state, the system immediately executes the corresponding assignment operation, writing a predefined integer value into the data storage location corresponding to the information interface. In this way, a rapid transition from manual operation to data output is achieved.

[0041] To ensure the accuracy and consistency of data output, the button triggering logic needs to be debouncing and a status confirmation mechanism implemented during the design process. For example, when a button is pressed, a minimum trigger time or double confirmation logic can be set to avoid erroneous data output due to accidental touches or signal jitter. Simultaneously, a status retention mechanism can be set up so that once a fault state is confirmed, its corresponding integer value can continue to be output until it is overwritten by a new state or manually reset, thereby ensuring the continuity of information transmission.

[0042] In the data output stage, the integer value generated after the button is triggered is written into a predefined information interface variable by the PLC program. This variable serves as the data source for subsequent communication and is periodically or event-drivenly transmitted to the external system. Since the output is an integer value, the entire data processing process does not require complex string concatenation or encoding conversion, significantly reducing the program execution burden and improving system response speed. Furthermore, this method effectively reduces the length of communication data, making information transmission more efficient and stable.

[0043] To adapt to complex industrial scenarios, multi-level selection or combination input mechanisms can be designed into the interactive interface. For example, after selecting a fault category on the main interface, a sub-interface can be entered to further refine the specific reasons, generating the final integer code value through multi-level logical combinations. This approach not only improves the granularity of information expression but also enables richer state description capabilities without increasing the number of data interfaces. Furthermore, by rationally designing the interface navigation structure, the system's scalability can be enhanced while ensuring ease of operation.

[0044] In practical applications, access control mechanisms can be integrated to grant different levels of access permissions to different operators. For example, ordinary operators can only select predefined fault types, while senior maintenance personnel can reset or adjust certain states, thereby ensuring the security and standardization of system operation. Access control effectively prevents accidental or unauthorized operations from affecting data accuracy.

[0045] Furthermore, to improve system reliability, anomaly detection and recovery mechanisms can be incorporated into the program. For example, when an anomaly is detected in the human-machine interface communication or when data fails to be successfully written to the information interface, an alarm prompt or automatic retry mechanism can be triggered to ensure that critical data is not lost. Simultaneously, by recording operation logs, each button trigger and its corresponding data output can be traced, providing a basis for subsequent problem analysis and system optimization.

[0046] In the collaboration between the human-machine interface and the PLC program, the matching of refresh frequency and response time must also be considered. By reasonably setting the scan cycle and data update strategy, resource waste can be avoided while ensuring system real-time performance. For example, for status information with low change frequency, event-triggered updates can be used; while for statuses that need continuous monitoring, periodic scanning can be used, thus achieving a balance between performance and real-time performance.

[0047] In summary, by constructing a structured human-machine interface in the industrial control equipment program and converting operational behaviors into integer values ​​for output to the information interface through a button trigger mechanism, an efficient connection from manual input to data transmission is achieved. This approach not only simplifies the data processing flow and reduces system complexity but also improves operational convenience and information transmission efficiency, providing a stable and reliable data foundation for subsequent remote analysis and status display. It is suitable for various industrial automation application scenarios.

[0048] In industrial information technology applications, to achieve remote visualization of equipment operating status, a data parsing mechanism corresponding to the PLC-side coding rules needs to be established on the web page. The core of this mechanism is to convert received integer values ​​into fault information with clear semantics, enabling operators to intuitively understand the current equipment status. In practice, the web page first needs to pre-establish a complete mapping relationship between numerical values ​​and semantics. This mapping relationship is configured based on pre-agreed coding rules, ensuring that each integer value corresponds to a unique fault description.

[0049] During system initialization, the web interface binds integer values ​​to corresponding text information through configuration files, databases, or front-end scripts. For example, the value "1" might be associated with a device downtime, "2" with a logistics anomaly, and "3" with a quality issue. This mapping is typically stored as key-value pairs, with the integer value as the key and the text description as the value, enabling fast lookup and efficient parsing. In actual deployment, this mapping can be stored in the backend service or directly embedded in the frontend page logic to meet different architectural requirements.

[0050] In the data receiving phase, the web interface obtains information interface data from the PLC side through existing communication methods, such as obtaining integer values ​​via HTTP requests, WebSocket connections, or other data interaction methods. This value maintains its original data structure during transmission, requiring no additional format conversion, thus reducing data processing steps. Upon receiving the integer value, the web interface immediately enters the parsing process, converting the value into corresponding fault semantic information by querying pre-established mapping relationships.

[0051] To improve response efficiency during the parsing process, a memory caching mechanism is typically used to store the mapping relationships, ensuring that each parsing operation can be completed in constant time, thus meeting the real-time requirements of industrial environments. When a new integer value is received, the system quickly retrieves the corresponding text description by looking up a table and then passes this description to the front-end display layer for presentation. Since the parsing process involves only simple numerical matching operations, it significantly reduces computational overhead and improves overall processing efficiency compared to string parsing or complex protocol parsing.

[0052] In terms of display logic, the web interface presents the corresponding fault information in a visual format based on the parsing results, such as displaying the current status of the device through status labels, color codes, icon prompts, or text descriptions. When the parsing result corresponds to a shutdown status, the reason for the shutdown can be highlighted on the interface, and visual enhancements (such as color changes or flashing effects) can be used to alert the operator. In this way, a complete closed loop from data reception to status display is achieved, enabling the device's operating information to be quickly identified and understood.

[0053] To enhance system flexibility, dynamic adjustment mechanisms are typically supported in mapping relationship design. When fault information needs to be updated or redefined, the correspondence between numerical values ​​and text can be adjusted by modifying configuration files or updating database records, without changing the data transmission structure or communication method. This design enables rapid updates of information content without affecting the overall system architecture, thus adapting to changing needs in the production process.

[0054] In practical applications, multilingual support mechanisms can be integrated to provide text descriptions in different languages ​​for the same integer value, thus meeting the needs of international applications. By adding a language dimension to the mapping relationship, the displayed content can be dynamically switched according to user selection, improving the system's applicability. Furthermore, different types of fault information can be categorized and displayed, such as by equipment category, fault level, or frequency of occurrence, further enhancing the hierarchy and readability of the information display.

[0055] To improve system reliability, an exception handling mechanism can be added during the parsing process. For example, when a received integer value is undefined in the mapping relationship, a default prompt message can be displayed or it can be marked as an unknown state, and a log can be recorded for subsequent analysis. Simultaneously, data validation logic can be set to check the validity of received data, preventing inaccurate display results due to communication anomalies or data errors. Furthermore, timed refresh or event-triggered mechanisms can be used to ensure that the displayed information always remains consistent with the PLC's status.

[0056] In terms of system performance optimization, resource consumption can be reduced while ensuring real-time performance through a well-designed data update strategy. For example, event-driven updates can be used to update display content for status information with low change frequency, while high-frequency refresh mechanisms can be used for critical statuses that require continuous monitoring. This differentiated strategy achieves a balance between performance and response speed.

[0057] In summary, by establishing an integer-based reverse parsing mechanism on the web page and combining it with pre-configured mapping relationships, an efficient conversion from data reception to semantic display is achieved. This approach not only simplifies the data processing flow and reduces parsing complexity but also improves the system's response speed and maintainability. Furthermore, it possesses good scalability and adaptability, meeting the practical needs of remote equipment status monitoring and fault information display in industrial automation scenarios.

[0058] During the operation of industrial control systems, as production processes adjust, equipment types expand, and management needs change, the original methods of expressing fault information often need to be updated or redefined. To meet these dynamic requirements, a flexible information expression method needs to be pre-established during the communication mechanism design phase. This allows for the updating and expansion of fault information semantics without altering the underlying data transmission structure. In this process, by decoupling the semantic content of fault information from the actual transmitted data, an independently adjustable mapping relationship is established between numerical transmission and textual meaning, thus providing a foundation for subsequent modifications.

[0059] On the PLC program side, the expression of fault information relies on pre-defined encoding rules, where different integer values ​​correspond to different fault meanings. When adjustments or additions to the cause of downtime are needed, the encoding rules can be directly modified. For example, the semantics of a certain value can be changed, or a new numerical code can be assigned to a new fault type. During implementation, the encoding rules can be updated by modifying the relevant parameter configurations or logical mapping relationships in the PLC program, without requiring any changes to the communication interface structure or data transmission method. This design ensures the stability of the underlying data channel, maintaining consistency in the communication mechanism over long-term operation.

[0060] On the web side, to ensure semantic consistency with the PLC side, the mapping between integer values ​​and text descriptions needs to be adjusted synchronously. This adjustment process is typically achieved by modifying configuration files, updating database records, or adjusting front-end mapping logic. By reconfiguring the mapping between values ​​and semantics, the web page can display updated fault information when receiving the same integer value. Since only numerical values ​​are involved in data transmission, the web side only needs to adjust the parsing rules to complete the adaptation, without modifying the data receiving logic or communication protocol, thus significantly reducing the complexity of the adjustment.

[0061] To ensure consistency between the PLC and web interfaces during the adjustment process, encoding and parsing rules are typically managed synchronously based on pre-agreed standards. In practical applications, this can be achieved through version identification, unified management via configuration files, or manual synchronization to ensure a consistent mapping relationship between the PLC and web interfaces within the same timeframe. For example, when updating encoding rules, the numerical values ​​and semantics can be redefined in the PLC program first, while the corresponding parsing configuration is updated on the web interface simultaneously. This ensures that the matching relationship between data transmission and displayed results remains consistent. This synchronous adjustment mechanism effectively avoids misinterpretation of information due to inconsistent rules.

[0062] During dynamic adjustments, the coding system can be optimized by incorporating expansion strategies. For example, unused values ​​can be reserved within the existing coding range for future additions of fault types, thus avoiding a complete refactoring due to insufficient coding space. Simultaneously, a partitioned coding approach can be adopted, dividing different fault categories into different numerical ranges. When expanding a category, only the corresponding range needs to be updated with new codes, without affecting the definitions of other categories. This design improves the maintainability and scalability of the coding system.

[0063] From a system maintenance perspective, this adjustment method has significant advantages. Since it requires no modification to the underlying communication protocol or data interface, information updates can be completed simply by adjusting the encoding rules and parsing relationships, greatly reducing system maintenance costs and development complexity. In real-world industrial environments, equipment operation typically requires high stability, and frequent modifications to the underlying program can pose risks. This decoupling approach, however, allows for flexible adjustments to information content while ensuring stable system operation.

[0064] Furthermore, when redefining information, historical data management mechanisms can be integrated to retain or mark old coding rules, ensuring correct parsing of historical records during data tracing. For example, by maintaining multi-version mappings on the web, the corresponding parsing rule can be selected based on the data's generation time, thus guaranteeing semantic consistency and interpretability between historical and current data. This approach is invaluable when production analysis or fault tracing is required.

[0065] In actual operation, a verification mechanism can be introduced to ensure the correctness of the adjustment process. For example, after the coding rules are updated, test data can be used to verify whether the output values ​​on the PLC side are consistent with the parsed results on the web side, thereby eliminating potential problems before formal operation. At the same time, a logging mechanism can be used to record each rule adjustment process so that backtracking analysis can be performed when anomalies occur, improving the controllability of system operation.

[0066] In summary, by adjusting the encoding rules and parsing relationships in both the PLC program and the web interface, flexible updates and redefinition of fault information content were achieved without altering the data transmission structure. This approach, by separating data transmission from semantic expression, not only enhances the system's scalability and maintenance efficiency but also effectively reduces development complexity and operational risks, enabling it to adapt to ever-changing industrial application needs. Therefore, it possesses high practical value and significant potential for widespread adoption in real-world applications.

[0067] This invention is designed based on existing hardware equipment in the current industrial control environment. It enables fault information exchange between the PLC and the web terminal without the need for additional industrial control tablets or communication hardware, thus effectively reducing hardware investment costs during system construction. Simultaneously, by fully utilizing existing equipment resources, it avoids compatibility issues and maintenance burdens associated with adding new hardware, resulting in a simpler and more stable overall system structure. While meeting functional requirements, it significantly improves economic efficiency and is suitable for industrial applications with high cost control requirements.

[0068] This invention simplifies the program development process and improves programming efficiency by constructing a templated information interface design, ensuring a unified standard for data interaction between the PLC and the web interface. In implementation, developers only need to configure parameters and write simple logic based on preset rules to complete the information transmission function, reducing reliance on complex communication protocols and advanced programming skills, thereby shortening the development cycle and lowering the technical threshold. Furthermore, the structured interface makes system expansion and maintenance more convenient, contributing to improved overall development and operation efficiency.

[0069] This invention employs a dual-end customizable communication mechanism, allowing transmitted content to be expressed only in concise numerical form, eliminating the need for direct text transmission and effectively reducing data transmission volume and parsing complexity. Furthermore, by establishing adjustable mapping relationships on both the PLC and WEB sides, flexible redefinition of communication content is achieved. When changes to fault information representation are needed, updates can be completed simply by adjusting the corresponding relationships, without frequent modifications to the underlying program logic. This approach not only enhances the system's flexibility and scalability but also improves the convenience of later maintenance, adapting to ever-changing industrial application needs.

[0070] The foregoing has only described certain exemplary embodiments of the present invention by way of illustration. Undoubtedly, those skilled in the art can modify the described embodiments in various ways without departing from the spirit and scope of the present invention. Therefore, the foregoing drawings and descriptions are illustrative in nature and should not be construed as limiting the scope of protection of the claims of the present invention.

Claims

1. A dual-end customized fault information transmission encoding method based on PLC and WEB page, characterized in that, Includes the following steps: The information interface between the PLC and the WEB page is pre-defined in the PLC program, and integer values ​​are used for storage and transmission in the information interface; In the PLC program, the corresponding encoding rules between fault shutdown information and integer values ​​are predefined based on the information interface, so that different fault types are associated with different integer values. During the operation of industrial control equipment, corresponding operations are triggered through the human-machine interface, and corresponding integer values ​​are output to the information interface according to the corresponding coding rules. Based on a preset relationship consistent with the corresponding encoding rules, the web page parses the integer value received by the information interface and displays the fault shutdown information corresponding to the integer value. When it is necessary to update or redefine fault shutdown information, the corresponding encoding rules in the PLC program and the corresponding parsing relationship in the WEB page are adjusted synchronously to complete the re-agreement of the communication content between the two parties.

2. The fault information transmission encoding method based on PLC and WEB page with dual-end customization according to claim 1, characterized in that, The steps for constraining and validating the data range in the information interface are as follows: Set corresponding value ranges for integer values ​​in the information interface, and assign corresponding encoding type identifiers to different ranges; In the PLC program, the integer value of the information writing interface is matched and judged within a range. If the range condition is not met, the alternative value writing operation is performed. After receiving an integer value on the web page, the value is classified and identified according to a preset range, and its corresponding encoding category is marked. For integer values ​​that do not belong to the preset range, perform anomaly identification processing and record the corresponding numerical information for subsequent processing.

3. The fault information transmission encoding method based on PLC and WEB page with dual-end customization according to claim 2, characterized in that, To address the need for expanding the integer numerical coding structure, a structured design for the representation of fault information is implemented, with the following steps: Integer values ​​are divided into multiple continuous or non-contiguous bit segments according to preset rules, and a corresponding encoding meaning is assigned to each bit segment; In the PLC program, based on the fault type, the corresponding information is written into each bit segment to form a combined code; The received integer value is split according to the same bit segment rules on the web page, and the corresponding data of each bit segment is extracted. The data segments obtained from the splitting are combined in a preset order to generate corresponding fault information.

4. The fault information transmission encoding method based on PLC and WEB page with dual-end customization according to claim 3, characterized in that, To address potential accidental triggering issues during human-computer interaction, the reliability of the operation triggering mechanism is enhanced through the following steps: In the human-computer interaction interface, set a corresponding trigger state variable for each operation button and record the button press and release states; The duration of the button trigger signal is detected, and a valid trigger is determined when the duration reaches a preset threshold. After confirming the trigger status, select the matching integer value according to the corresponding encoding rule; Write the selected integer value into the information interface and reset the trigger status variable.

5. The fault information transmission encoding method based on PLC and WEB page with dual-end customization according to claim 4, characterized in that, In the human-computer interaction interface, a state lock flag is set for each operation button. When the trigger state is valid, the corresponding button is locked. During the lock state, repeated trigger signal input is restricted, and the lock is released to restore operation response when the state reset is completed.

6. The fault information transmission encoding method based on PLC and WEB page with dual-end customization according to claim 4, characterized in that, To accelerate the data processing efficiency requirements of web pages, the process of parsing integer values ​​is optimized as follows: Construct a mapping table structure between integer values ​​and fault information in the web page, and store it in key-value pair format; When an integer value is received, the value is used as a key to enter the mapping table for lookup. If no corresponding item is found in the mapping table, execute the backup data query logic and write the query result into the mapping table; Output the corresponding data obtained from the mapping table to the interface display area.

7. The fault information transmission encoding method based on PLC and WEB page with dual-end customization according to claim 6, characterized in that, To address the consistency issue during the adjustment of communication content, constraints are imposed on the synchronization mechanism between encoding rules and parsing relationships. The steps are as follows: In the PLC program, set the corresponding version identifier data for each group of coding rules and store it together with the integer value; Establish version record information corresponding to the encoding rules in the web page and associate it with the parsing relationship; During data transmission, the integer value and the corresponding version identifier are simultaneously transmitted to the web page; The received version identifier is compared on the web page, and the corresponding parsing relationship is selected based on the comparison result.

8. The fault information transmission encoding method based on PLC and WEB page with dual-end customization according to claim 7, characterized in that, The correspondence between version identifiers and resolution relationships is kept consistent. A binding table for version identifiers and resolution relationships is established in the web page and uniqueness is set. When an integer value and a version identifier are received, the binding relationship matching process is performed. If the matching fails, the preset resolution relationship is called and the current version identifier and integer value correspondence information is recorded.

9. The fault information transmission encoding method based on PLC and WEB page with dual-end customization according to claim 7, characterized in that, To address the data differentiation requirements in multi-device access scenarios, the data organization method in the information interface is optimized, as follows: In the information interface, assign independent data storage addresses or data identification fields to different industrial control devices; In the PLC program, the corresponding integer value is written to the corresponding data storage location based on the device identification information; After receiving data from the web page, the integer values ​​are classified and grouped according to the data source identifier; The categorized integer values ​​are then mapped to the display areas of different devices for output.

10. The fault information transmission encoding method based on PLC and WEB page with dual-end customization according to claim 9, characterized in that, Based on the abnormal situations that occurred during operation, the abnormal state identification and handling methods were supplemented and designed, with the following steps: Multiple anomaly identifier values ​​are preset in the integer numerical encoding rules, each corresponding to a different type of anomaly state; In the PLC program, based on the detected abnormal conditions, the corresponding abnormality identifier value is written into the information interface; After receiving an integer value on the web page, it is matched and judged against the value of the anomaly indicator. When an abnormal identifier value is matched, the corresponding abnormal handling logic is invoked and the abnormal status information is output.