A programmable logic controller system with full Chinese programming and its implementation method
The programmable logic controller system, which is programmed entirely in Chinese, solves the problems of high programming threshold and strong professional dependence of PLCs. It realizes a standardized program framework and remote operation and maintenance, ensures the security of program assets, and improves development and maintenance efficiency.
Patent Information
- Application Number
- CN202611395001.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-09
- Publication Date
- 2026-11-17
AI Technical Summary
Existing PLC programming has a high barrier to entry, strong professional dependence, closed programming ecosystem, limited operation and maintenance methods, non-standard program architecture, no guarantee of program assets, and insufficient security mechanisms.
The programmable logic controller system, which adopts full Chinese programming, includes a server layer, a device layer, and a client layer. It utilizes a standardized program framework, Chinese logic configuration, and encrypted running code to support remote operation and maintenance and program cloud storage, enabling programming and operation and maintenance across operating systems and terminal devices.
It lowers the programming threshold, improves development and maintenance efficiency, supports remote operation and maintenance throughout the entire process, ensures the security of program assets, and provides comprehensive security protection.
Smart Images

Figure CN123113653A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of programmable logic controller (PLC) technology, and in particular to a programmable logic controller system with full Chinese programming and its implementation method. Background Technology
[0002] Programmable Logic Controllers (PLCs) are the core control units of industrial automation equipment, widely used in specialized equipment, production lines, and intelligent manufacturing. However, current mainstream PLC technology suffers from the following shortcomings:
[0003] 1. High programming threshold and strong professional dependence: Most mainstream PLCs on the market use professional programming languages such as ladder diagrams and instruction lists, which require professional PLC engineers who have undergone systematic training to complete the program development. Especially when it comes to functions such as stepper motor control and human-machine interface, it is also necessary to master motion control instructions and serial communication protocol development. Ordinary equipment maintenance personnel cannot independently complete programming and logic modification, resulting in high labor costs and poor talent adaptability.
[0004] 2. Closed programming ecosystem and low degree of localization: Most mainstream programming tools are provided by foreign manufacturers such as Siemens and Mitsubishi, resulting in high software licensing costs, a closed ecosystem, and uncontrollable underlying technologies.
[0005] 3. Limited operation and maintenance methods and high dependence on on-site: Traditional PLC program writing, downloading and debugging all need to be completed on-site using a dedicated computer. Equipment upgrades and troubleshooting require engineers to be on-site, resulting in high operation and maintenance costs and long response cycles, making it difficult to achieve remote operation and maintenance throughout the entire process.
[0006] 4. Non-standardized program architecture, making maintenance and iteration difficult: Developers have different programming styles and lack a unified and standardized program framework, which can easily lead to logical confusion when modifying requirements or handing over personnel later; in addition, there are no standardized modules for peripheral device integration, and each new human-computer interaction interface, motor and other peripheral devices must be developed from scratch, resulting in high maintenance costs and high error rates.
[0007] 5. Lack of security for program assets and insufficient security mechanisms: Programs are mostly stored on local computers or PLCs, making them susceptible to loss due to staff turnover or computer damage; at the same time, the underlying code is easily cracked, and there is a lack of technical protection for equipment operation security and service commercial rights. Summary of the Invention
[0008] The purpose of this invention is to overcome the shortcomings of existing technologies and to propose a programmable logic controller system with full Chinese programming and its implementation method.
[0009] To achieve the above objectives, the present invention adopts the following technical solution: a programmable logic controller system with full Chinese programming includes a server layer, a device layer, and a client layer;
[0010] The server layer is used to store program files and versions, generate encrypted execution code based on Chinese logical configuration, and communicate with the device layer.
[0011] The device layer includes a dedicated downloader, a PLC controller, a human-machine interface, motion motors, and controlled machine equipment. The motion motors are stepper motors and / or servo motors. The dedicated downloader is used to receive encrypted running code and firmware upgrade data from the server layer and transmit them to the PLC controller. At the same time, it uploads the running data collected by the PLC controller to the server layer. The PLC controller is connected to the human-machine interface, motion motors, and controlled machine equipment.
[0012] The client layer is used to configure trigger conditions, action output, human-computer interaction interface data mapping, and motion parameters of the motion motor in a fully Chinese programming interface, forming the Chinese logic configuration and program file.
[0013] The PLC controller has a built-in standardized program framework, which includes a program version layer, a common basic processing layer, a multi-task execution layer, a task internal logic layer, and a data interaction structure. The program version layer manages multiple program versions and performs power-on initialization upon startup. The common basic processing layer includes a status processing module, a button processing module, an alarm processing module, a service processing module, an emergency stop processing module, a human-machine interface processing module, and a motion motor configuration module. The multi-task execution layer runs multiple control tasks in parallel. The task internal logic layer organizes each control task according to task initialization, triggering rules, state switching, and state release. The data interaction structure, while maintaining the logical independence of each control task, transmits task status and trigger data through a preset data mapping relationship, realizing inter-task linkage triggering and data sharing.
[0014] Preferably, the server layer includes a database, MQTT communication service, WEB service, mini-program front-end, and H5 front-end;
[0015] The database establishes data isolation relationships based on enterprise accounts and is used to store user account data, device information, program files, program version information, and device operation logs.
[0016] The MQTT communication service establishes a communication topic according to the device identity and establishes a two-way communication link with the dedicated downloader, which is used to send program download tasks, control instructions and upgrade instructions to the corresponding dedicated downloader, as well as to receive device operation data;
[0017] The WEB service is used to provide the client layer with interfaces for program editing, device query, version query and running status query;
[0018] The mini-program front-end and the H5 front-end are used to provide client terminals with an operation entry point for full Chinese programming, device debugging, and device maintenance.
[0019] Preferably, the client layer includes a Chinese logic editing module, a port and wiring visualization module, and a collaborative editing module;
[0020] The Chinese logic editing module is used to establish a correspondence between trigger conditions and action outputs through Chinese function items. The trigger conditions include input port trigger conditions, time trigger conditions, state trigger conditions, and analog threshold trigger conditions. The action outputs include output port setting actions, timer start actions, state switching actions, and the motion actions of the motion motor. A structured Chinese logic configuration is formed according to the correspondence.
[0021] The port and wiring visualization module is used to generate a port definition table and a visual wiring diagram based on the Chinese logic configuration, and to associate the input port, output port, motion motor interface, analog acquisition channel and communication interface with the corresponding Chinese names.
[0022] The collaborative editing module enables multiple client terminals to edit the program file based on the same enterprise account, and generates a corresponding program version when the program content is modified.
[0023] Preferably, the server layer further includes a version management module and a program generation module;
[0024] The version management module is used to set a program version identifier for the program file, associate and store each program version with the corresponding PLC controller device identity, and perform switching, tracing and rollback between multiple program versions based on the program version identifier.
[0025] The program generation module is used to parse the Chinese logic configuration, map the correspondence between the triggering conditions and the action output, as well as the port parameters, motion motor parameters and communication parameters, to the corresponding modules and PLC controller hardware resources in the standardized program framework, generate executable running code for the PLC controller, and encrypt the running code to obtain the encrypted running code;
[0026] The MQTT communication service is used to send the encrypted runtime code to the target PLC controller via a downloader, based on the device identity of the target PLC controller.
[0027] Preferably, the dedicated downloader includes a network communication unit, a program transmission unit, and a remote upgrade unit;
[0028] The network communication unit is used to establish a communication connection with the server layer using an encrypted communication protocol via a WiFi network, and to receive the encrypted running code and upgrade data according to the device identity;
[0029] The program transmission unit is used to transmit the received encrypted running code to the corresponding PLC controller, and the PLC controller writes the encrypted running code into the running storage area.
[0030] The remote upgrade unit is used to perform a remote firmware upgrade on the dedicated downloader according to the upgrade command issued by the server layer, and to transmit the upgrade data applicable to the PLC controller to the PLC controller, thereby performing a remote firmware upgrade on the PLC controller.
[0031] Preferably, in the standardized procedure framework:
[0032] The program version layer is used to determine the target program version based on the program version identifier, and to complete the power-on initialization of digital input / output status, internal register status, motion motor parameters and communication parameters when the target program version is started.
[0033] The status processing module is used to maintain the standby status, manual status, automatic status, alarm status, emergency stop status, current sequence, and running status of the device;
[0034] The button processing module is used to read the input signals of external physical buttons and convert them into corresponding control requests;
[0035] The alarm processing module is used to determine the fault triggering conditions and execute alarm output and fault processing.
[0036] The service processing module is used to record the equipment maintenance cycle and service validity period and generate corresponding service status.
[0037] The emergency stop processing module is used to prioritize stopping the corresponding motion output and digital output when the emergency stop condition is met.
[0038] The human-machine interface processing module is used to parse the human-machine interface operation data according to the configured data mapping relationship, and to perform data conversion between the data inside the PLC controller and the human-machine interface control data.
[0039] The motion motor configuration module is used to configure the motion motor's zero position, reset, limit stop, number of steps, angle, zero return speed, speed operation, direction of motion, trapezoidal acceleration and deceleration, limit conditions, and emergency stop, among other operating parameters.
[0040] The multi-task execution layer is used to maintain the task states of multiple control tasks and schedule the multiple control tasks in parallel.
[0041] The task initialization in the internal logic layer of the task is used to restore the task parameters and task state, the triggering rule is used to determine the task start conditions, the state switching is used to determine the transition conditions and corresponding actions between different running states of the task, and the state release is used to release the task output state and task data when the task is completed or exited.
[0042] The data interaction structure is used to transmit task status, trigger data, and linkage data between various control tasks, so that different control tasks can maintain logical isolation and can interact with each other.
[0043] Preferably, the PLC controller is equipped with 20 digital input ports X1 to X20, 20 digital output ports Y1 to Y20, 4 independent motion motor control interfaces M1 to M4, 4 analog acquisition channels ACD1 to ACD4, a dedicated human-machine interface, and communication interfaces including RS232, RS485, CAN, and TCP interfaces.
[0044] The four independent motion motor control interfaces are used to connect stepper motors and / or servo motors respectively; the client layer configures the zero position, homing speed, running speed, direction of motion, displacement, limit conditions and emergency stop response rules of the motion motor through Chinese parameter items to form a motion control configuration; the program generation module maps the motion control configuration to the running parameters of the preset motion control logic and generates motion control code executed by the PLC controller calling the motion motor control interface;
[0045] The client layer is also used to configure the human-machine interface communication protocol, baud rate, data format, and data mapping relationship between the PLC controller's internal data and the human-machine interface controls, forming a human-machine interface communication configuration. The program generation module generates a data mapping table based on the human-machine interface communication configuration and configures the human-machine interface processing module. The human-machine interface processing module completes the human-machine interface data parsing, PLC internal data updating, and human-machine interface display data updating according to the preset serial communication processing logic.
[0046] Preferably, the client layer further includes a software simulation and debugging module and an operation monitoring and maintenance module;
[0047] The software simulation and debugging module is used to simulate manual mode, automatic mode, single-step control, reset operation, motion motor action, emergency stop and limit state and human-machine interface operation instructions in a virtual input state before the program is sent to the PLC controller. It also verifies the Chinese logic configuration according to the task status, action output status and data interaction status of each control task, and detects and diagnoses the communication status.
[0048] The PLC controller is used to collect digital input data, digital output status, analog data, communication data, motion motor running status, alarm information, and task running status of each control task and form running data. The dedicated downloader is used to upload the running data to the server layer.
[0049] The operation monitoring and maintenance module is used to read the operation data and display the equipment operation status and fault information, and to modify the Chinese logic configuration according to the fault information; the server layer is used to establish an update program version and generate updated encrypted operation code according to the modified Chinese logic configuration, and to send the updated encrypted operation code to the PLC controller through the dedicated downloader.
[0050] This invention also provides a method for implementing a programmable logic controller (PLC) system with full Chinese programming, applicable to a PLC system including a server layer, a device layer, and a client layer. The device layer includes a dedicated downloader, a PLC controller, a human-machine interface, motion motors, and controlled machine equipment. The motion motors are stepper motors and / or servo motors. The implementation method includes:
[0051] The client layer's fully Chinese programming interface configures the correspondence between trigger conditions and action outputs, and configures the human-computer interaction interface data mapping relationship and motion parameters of the motion motor, forming a structured Chinese logic configuration and program file;
[0052] The server layer stores the program file and corresponding program version, parses the structured Chinese logic configuration, and maps the triggering conditions, action outputs, human-machine interface data mapping relationships and motion parameters to the preset PLC standardized program framework, serial communication processing logic and motion control logic, respectively, to generate executable running code for the PLC controller, and encrypts the running code to form encrypted running code;
[0053] The encrypted execution code is sent to the corresponding dedicated downloader through the server layer, and the dedicated downloader transmits the encrypted execution code to the corresponding PLC controller.
[0054] The standardized program framework is run through the PLC controller. The standardized program framework includes a program version layer, a common basic processing layer, a multi-task execution layer, a task internal logic layer, and a data interaction structure. The common basic processing layer runs a status processing module, a button processing module, an alarm processing module, a service processing module, an emergency stop processing module, a motion motor configuration module, and a human-machine interface processing module. The multi-task execution layer runs multiple control tasks in parallel. Each control task is executed through the task internal logic layer according to task initialization, triggering rules, state switching, and state release. Data interaction is performed within tasks, between tasks, between tasks and peripherals, and between tasks and the server layer through the data interaction structure.
[0055] The PLC controller calls preset motion control logic to control the motion motor according to the motion parameters, and calls the human-machine interface processing module to execute the interaction between the PLC internal data and the human-machine interface control data according to the human-machine interface data mapping relationship.
[0056] The PLC controller collects equipment operation data, which is then uploaded to the server layer via the dedicated downloader. The client layer then performs operation monitoring, fault diagnosis, and remote program updates based on the equipment operation data.
[0057] Preferably, the structured Chinese logic configuration and the program file are formed through the fully Chinese programming interface of the client layer, including:
[0058] The control task is established through Chinese function items, and the triggering condition is configured as at least one of input port triggering condition, time triggering condition, state triggering condition, analog threshold triggering condition and data interaction, and the action output is configured as at least one of output port setting action, timer start action, state switching action and motion motor movement action.
[0059] Configure the zero position, return-to-zero speed, running speed, direction of motion, displacement, limit conditions, and emergency stop response rules of the motion motor through Chinese parameter items, and form the motion control configuration with the configuration results;
[0060] Configure the communication protocol, baud rate, and data format of the human-machine interface through Chinese parameter items, and establish the data mapping relationship between the internal data of the PLC controller and the human-machine interface controls to form the human-machine interface communication configuration.
[0061] The triggering conditions, action output, motion control configuration, and human-computer interaction interface communication configuration are structured and stored in the Chinese logic configuration. The server layer then uses the Chinese logic configuration to call the preset task logic, motion control logic, and serial communication processing logic to generate the corresponding running code.
[0062] Based on the Chinese logical configuration, a port definition table and a visual wiring diagram are generated synchronously, and the program file is saved in the server storage space corresponding to the enterprise account.
[0063] Compared with the prior art, the advantages and positive effects of the present invention are as follows:
[0064] 1. Lowering the programming threshold: The all-Chinese programming mode eliminates the reliance on professional PLC engineers. Ordinary maintenance personnel can master the programming method after only a very short period of adaptive operation training, which greatly reduces the learning cost and manpower threshold. Peripherals such as stepper motors and human-machine interfaces can be parameterized, eliminating the need to master professional instructions and protocol development, thus reducing manpower and learning costs.
[0065] 2. Improve development and maintenance efficiency: The standardized and modular program framework has clear boundaries, and common functions and peripheral logic are pre-integrated, so developers do not need to build the program architecture from scratch; later requirement modifications and personnel handover are convenient, avoiding logical confusion problems.
[0066] 3. Native peripheral device adaptation and simplified program structure: Built-in dedicated processing module for human-machine interface and multi-channel stepper motor control interface, peripheral device docking does not require additional complex program development, reducing the amount of PLC code and reducing the probability of errors.
[0067] 4. Enable end-to-end remote operation and maintenance: Supports remote programming, debugging, downloading and maintenance, and with OTA upgrade capabilities, reduces on-site operation and maintenance costs and improves fault response speed.
[0068] 5. Ensure program asset security: Cloud-based account storage of programs solves the problem of program loss due to staff turnover or equipment damage, and multi-version management supports function iteration and traceability.
[0069] 6. Full-scenario and multi-terminal adaptation: Support for cross-operating systems and cross-terminal devices enables programming and maintenance operations anytime, anywhere, improving flexibility.
[0070] 7. Comprehensive security protection: A security system is built from four dimensions: function, code, device, and service, which not only ensures the safe operation of the device, but also protects intellectual property rights and commercial interests. Attached Figure Description
[0071] Figure 1 This is a block diagram of the PLC program framework of the present invention;
[0072] Figure 2 This is a block diagram of the overall system architecture of the present invention. Detailed Implementation
[0073] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0074] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that the following embodiments are for illustrative purposes only and are not intended to limit the scope of protection of the present invention. Without departing from the technical concept of the present invention, those skilled in the art can adjust the corresponding structure and parameters according to the actual equipment type, the number of control points, the communication method, and the type of actuator.
[0075] This invention provides a programmable logic controller (PLC) system with full Chinese programming capability. The system comprises a server layer, a device layer, and a client layer. The device layer includes a dedicated programmer, a PLC controller, a human-machine interface, motion motors, and controlled machine equipment. The motion motors include stepper motors and / or servo motors.
[0076] The "full Chinese programming" in this invention means that during the program development process, users do not need to directly write low-level control code such as ladder diagrams, instruction lists, structured text, or C language. Instead, they complete the control logic configuration through Chinese-named function items, trigger conditions, action outputs, device parameters, and data mapping relationships. The system then converts the corresponding Chinese logic configuration into executable code that the PLC controller can run.
[0077] The "standardized program framework" in this invention refers to a layered, modular program organization structure pre-set in the PLC controller's operating system. It includes at least a program version layer, a common basic processing layer, a multi-task execution layer, a task internal logic layer, and a data interaction structure. The specific business logic of different devices is configured and executed according to this standardized program framework, thereby ensuring that PLC programs developed by different developers have a unified program organization method.
[0078] Example 1: System Overall Structure
[0079] like Figure 2 As shown, this embodiment provides a programmable logic controller system with full Chinese programming, including a server layer, a device layer, and a client layer.
[0080] The server layer is used for user management, device management, program file management, program version management, runtime code generation, and device communication. The server layer can be deployed on an internal enterprise server or a cloud server. It establishes a mapping between users, devices, and programs based on enterprise accounts, ensuring logical isolation between program data and device data for different enterprise accounts.
[0081] The equipment layer is deployed at the site of the controlled machinery and includes a dedicated programmer, a PLC controller, a human-machine interface, motion motors, and the controlled machinery. The dedicated programmer communicates with both the server layer and the PLC controller, receiving operating codes, control commands, and upgrade data from the server layer, and uploading operating data generated by the PLC controller to the server layer.
[0082] As the core of field control, the PLC controller connects to digital input devices, digital output devices, human-machine interfaces, motion motors, and other external devices to execute control logic according to the running code generated and distributed by the server layer.
[0083] The motion motor can be a stepper motor, a servo motor, or both can be connected to the same PLC controller. For stepper motors or servo drivers that use pulse-based position control, the PLC controller can output pulse and direction signals through the corresponding motion motor control interface to perform actions such as positioning, fixed-length feeding, reciprocating motion, or homing.
[0084] The client layer provides users with a fully Chinese interface for programming, device debugging, operation monitoring, and remote maintenance. The client layer can run on mobile phones, PDAs, or desktop computers, and the corresponding terminals can use Windows, HarmonyOS, Android, or macOS operating systems.
[0085] After logging into the enterprise's corresponding cloud account, users can read the device files, program files, program versions, running status and fault information of the devices under the current account, and can access the same program data across different terminals.
[0086] During program development, the client layer provides users with Chinese logic editing capabilities through a fully Chinese programming interface. Users can select the corresponding Chinese function items and configure trigger conditions and action outputs according to the actual process of the equipment. They can also configure the motion parameters of the motion motors and the data mapping relationships of the human-machine interface.
[0087] After the client completes the program configuration, a structured Chinese logic configuration and program file are generated. Based on the Chinese logic configuration, the server layer maps the trigger conditions, action outputs, port parameters, motion motor parameters, human-machine interface communication parameters, and data mapping relationships to a pre-set standardized program framework, and generates executable code that the PLC controller can run.
[0088] The execution code can be encrypted to form encrypted execution code, and sent to the corresponding dedicated downloader based on the device identity of the target PLC controller. The dedicated downloader transmits the encrypted execution code to the PLC controller, which writes it into the corresponding execution storage area and executes it according to a standardized program framework.
[0089] During operation, the PLC controller collects input status, output status, task running status, alarm status, motion motor status, analog data, and communication status to form operational data. This operational data is uploaded to the server layer via a dedicated downloader, where it is displayed on the client layer and used for remote fault analysis and program maintenance.
[0090] Thus, a closed-loop control system is formed between the server layer, device layer, and client layer, encompassing Chinese logic configuration, program generation, program download, on-site operation, operational data acquisition, and remote maintenance.
[0091] Example 2: Server Layer
[0092] This embodiment provides a further explanation of the server layer.
[0093] The server layer includes a database, MQTT communication service, web service, mini-program front-end and H5 front-end, and can also set up a version management module and a program generation module.
[0094] The database is used to store user account data, device information, program files, program version information, and device operation logs.
[0095] Specifically, the database can establish data isolation relationships based on enterprise accounts. User account data is used to record user identity and operation permissions; device information is used to record the device identity, online status, and device files corresponding to PLC controllers and dedicated downloaders; program files and program version information are used to record the Chinese logic configuration and program content of different versions; and device operation logs are used to record device operation status, alarm information, remote download records, and maintenance records.
[0096] For each PLC controller connected to the system, the server layer establishes a corresponding device identity and establishes the association between the PLC controller, the dedicated downloader, and the enterprise account.
[0097] The MQTT communication service is used to establish a bidirectional communication link with the dedicated downloader. The MQTT service can create corresponding communication topics based on the device's identity. After the dedicated downloader comes online, it accesses the corresponding communication topic based on the device's identity, enabling the server layer to send runtime code, control commands, and upgrade data to the specified device, and to receive runtime data uploaded by the specified device.
[0098] For example, when a user selects a target PLC controller for program update on the client, the server layer queries the dedicated downloader bound to the PLC controller based on the device identity of the PLC controller, and sends the program download task to the target dedicated downloader through the corresponding communication topic, thereby reducing the possibility of program errors being sent to other devices.
[0099] The web service provides the client layer with interfaces for program editing, device querying, program version querying, running status querying, and remote operation and maintenance.
[0100] The mini-program frontend and H5 frontend are used to create a fully Chinese-language entry point for programming, device debugging, and device maintenance operations suitable for mobile terminals. In other implementations, the client can also call the interfaces provided by the web service through a desktop application.
[0101] The version management module is used to manage multiple program versions corresponding to the same PLC controller. Each program version must be associated with at least the PLC controller device identity, program version identifier, and program file.
[0102] For example, the initial program for equipment production can be recorded as V1.0, then V1.1 after adding new control functions, and finally V1.2 after further adding equipment linkage logic. Different program versions are saved separately without overwriting each other.
[0103] When the current running version encounters an error, a previously saved program version can be selected, and the corresponding running code can be regenerated and distributed, thereby enabling program version traceability and rollback.
[0104] The program generation module is used to parse the structured Chinese logic configuration generated by the client and convert the Chinese logic configuration into executable code that the PLC controller can execute.
[0105] The Chinese logic configuration may include at least trigger conditions, action output, port parameters, task parameters, motion motor parameters, human-computer interaction interface communication parameters, and human-computer interaction interface data mapping relationships.
[0106] Based on the above configuration, the program generation module determines the standardized program modules and PLC hardware resources that need to be called, writes the corresponding parameters into the corresponding program modules, and thus generates running code suitable for the target PLC controller.
[0107] After generating the runtime code, it can be further encrypted to form encrypted runtime code, which is then sent to the target dedicated downloader via MQTT communication service.
[0108] Through the above structure, the server layer not only undertakes the function of storing program files, but also becomes the conversion node between Chinese logic configuration and PLC underlying running code.
[0109] Example 3: Full Chinese Programming and Chinese Logic Configuration
[0110] This embodiment further explains the all-Chinese programming mechanism of the client layer.
[0111] The client layer may include a Chinese logic editing module, a port and wiring visualization module, and a collaborative editing module.
[0112] The Chinese logic editing module is used to display function items named in Chinese to the user and establish the correspondence between trigger conditions and action outputs.
[0113] Users first establish one or more control tasks based on the equipment process, and then configure the corresponding trigger conditions and action outputs in each control task.
[0114] Triggering conditions may include one or more of the following: input port triggering conditions, time triggering conditions, status triggering conditions, analog threshold triggering conditions, and data interaction triggering conditions.
[0115] The input port trigger conditions can be used to detect the input status of start buttons, stop buttons, limit switches, photoelectric sensors, or other switch sensors.
[0116] Time-triggered conditions can be used to initiate corresponding actions based on preset delay time, hold time, or runtime.
[0117] Status trigger conditions can be used to determine whether the current device status, control task status, or other task status has met specified conditions.
[0118] The analog quantity threshold trigger condition can be used to compare the data acquired by the analog quantity acquisition channel with a preset threshold, and determine whether to execute the corresponding action based on the comparison result.
[0119] Data interaction triggering conditions can be used to determine whether to execute the corresponding action based on the task status, trigger data, or linkage data in the data interaction structure. For example, triggering the next control task based on the task completion data written by the previous control task.
[0120] Action outputs can include output port setting actions, timer start actions, state switching actions, and motion motor actions.
[0121] The output port setting action can be used to control relays, solenoid valves, contactors, or other actuators.
[0122] The timer start action is used to establish the device's runtime sequence.
[0123] State switching actions are used to transition the current task from one running state to another.
[0124] The motion action of the motion motor is used to call the corresponding motion motor control interface to enable the corresponding stepper motor and / or servo motor to perform zero return, positioning, fixed length feeding or other pre-configured motion processes.
[0125] For example, for automatic feeding equipment, "equipment in automatic mode" and "start button valid" can be set as the trigger conditions for the feeding task, and "M1 axis moves a preset distance in the positive direction" can be set as the corresponding action output.
[0126] Throughout the configuration process, users are directly exposed to Chinese function names and parameters such as "Automatic Mode", "Start Button", "Feed Shaft Operation", "Feeding Distance", and "Running Speed", without having to directly input the underlying PLC motion control commands.
[0127] The Chinese logic editing module forms a structured Chinese logic configuration by combining the user-selected function items, trigger relationships, action relationships, and parameter settings.
[0128] The structured Chinese logic configuration can be organized according to control tasks, triggering rules, action outputs, and parameter data. For example, a feeding action can be recorded as follows: the task is a feeding task, the triggering condition is automatic status and valid start input, the action type is a motion motor positioning motion, the target motion motor is M1, the motion direction is positive, and the running speed and displacement are determined by the corresponding Chinese parameter items.
[0129] The port and wiring visualization module establishes the relationship between input ports, output ports, motion motor interfaces, analog acquisition channels, and communication interfaces and their corresponding Chinese names based on the Chinese logic configuration, and generates a port definition table and a visual wiring diagram.
[0130] For example, X1 can be named "Start Button", X2 "Stop Button", X3 "Feeding Front Limit", Y1 "Run Indicator", and M1 "Feeding Shaft".
[0131] When the user uses the "start button" or "feed axis" in the program, the system can automatically associate with the corresponding PLC hardware port, so that the program logic is consistent with the field wiring relationship.
[0132] The collaborative editing module supports multiple client terminals to edit the program files corresponding to the same device based on the same enterprise account.
[0133] When the program content is modified and saved, the server layer can generate a new program version, enabling different developers to continue development and maintenance based on a unified program file, thereby reducing the risk of program loss caused by the program being stored on a single engineer's local computer.
[0134] Example 4: Parametric Configuration and Running Code Generation of Motion Motors
[0135] This embodiment illustrates the parameterized control mechanism for stepper motors and servo motors.
[0136] In traditional PLC applications, when the controller needs to control a stepper motor or a servo motor using pulse position control, the programmer usually needs to understand the high-speed pulse output resources of the PLC and configure control logic such as pulse output, direction control, acceleration / deceleration, homing, limit, and emergency stop according to the controller instruction system.
[0137] For example, for PLCs with PTO, PWM, or similar high-speed pulse output capabilities, developers need to write corresponding pulse control programs based on the specific controller. Different PLC manufacturers use different instruction names and usage methods, making it difficult for ordinary equipment maintenance personnel to directly develop motion control programs.
[0138] This invention establishes a mapping relationship between user configuration data and the preset motion control logic by pre-setting motion control logic in the system and by using a fully Chinese parameter configuration method, so that users do not need to directly write underlying pulse output or motion control commands.
[0139] The client layer provides a motion motor configuration interface through Chinese parameter fields. Users can configure the motor's zero position, reset method, zero return speed, running speed, direction of motion, displacement, number of steps, angle, trapezoidal acceleration / deceleration parameters, limit conditions, limit emergency stop related parameters, and emergency stop response rules.
[0140] The number of steps and angle can be used as motion target parameters according to the type of motion mechanism. The system can convert the number of steps, angle, or displacement into the target number of pulses required by the motion control logic based on pre-configured pulse equivalent, step angle, electronic gear ratio, or other motion conversion parameters. Trapezoidal acceleration and deceleration parameters are used to determine the speed change process of the motion motor during start-up, constant speed operation, and stopping.
[0141] For stepper motors, corresponding stepping motion parameters can be configured according to control requirements. For servo motors using pulse control, the same or compatible position, speed, and direction parameters as those for stepper motors can be configured, and closed-loop control can be performed by the corresponding servo driver.
[0142] In one implementation, the motion motor control interfaces M1 to M4 each have corresponding motion control resources. The system pre-sets pulse generation, direction output, running status judgment, motion completion judgment, reset processing, zero return judgment, limit judgment, trapezoidal acceleration and deceleration, and emergency stop processing logic corresponding to the motion motor control interfaces.
[0143] The "running speed" set by the user in the Chinese interface can be mapped to the pulse output frequency parameter of the motion control logic; the set "displacement", "steps", or "angle" can be converted into the target pulse number based on the pre-set unit pulse to displacement relationship, step distance relationship, or angle conversion relationship; the set "motion direction" can be mapped to the direction output state; the set "zero speed", "zero position", and "reset" parameters can be written into the reset and zero return processing logic; the set "trapezoidal acceleration / deceleration" parameters can be written into the motion acceleration / deceleration processing logic; and the set "limit conditions", "limit emergency stop" related parameters, and "emergency stop response rules" can be written into the motion safety processing logic.
[0144] After receiving the above motion control configuration, the server-layer program generation module does not require the user to input PTO, PWM or other low-level high-speed pulse control instructions on the client. Instead, it writes the motion parameters into the corresponding parameter area of the preset motion control logic and generates the motion control code required for the PLC controller to execute.
[0145] When a certain control task triggers the motion motor to move, the internal logic of the task calls the corresponding motion motor control interface and preset motion control logic, and executes the motion according to the configured running speed, direction and displacement, number of steps or angle.
[0146] For example, users can configure the following in a fully Chinese programming interface:
[0147] "Feed shaft zero return speed = first speed value";
[0148] "Feed shaft running speed = second speed value";
[0149] "The direction of the feed shaft movement = positive";
[0150] "Feeding distance = target distance";
[0151] "Feed shaft trapezoidal acceleration and deceleration = preset acceleration and deceleration parameters";
[0152] "Continue forward movement is prohibited when the front limit is in effect";
[0153] "The feeding shaft will stop immediately when the emergency stop is effective."
[0154] The server layer generates a motion control configuration based on the above Chinese parameters and automatically converts it into the parameters and running code required by the PLC controller to execute motion control.
[0155] For servo motors, when using pulse and direction signals to control the servo driver, the PLC controller outputs position pulses and direction signals to the servo driver through the corresponding motion motor control interface. The servo driver then drives the servo motor according to the corresponding pulse signals. Therefore, the client can still use a unified Chinese motion parameter configuration interface without requiring the user to write a separate program for the servo motor's position pulse output.
[0156] Therefore, in this invention, "parameterized configuration without writing code" is specifically reflected in the fact that users only set motion targets and motion parameters, and the system completes the underlying control resource invocation, pulse output parameter formation, and safety rule combination through preset motion control logic.
[0157] Example 5: Standardized Communication and Data Mapping for Human-Computer Interaction Interfaces
[0158] This embodiment illustrates the parameterized configuration and standardized communication mechanism of the human-computer interaction interface.
[0159] In the process of connecting a traditional PLC with a human-machine interface, developers usually need to set the serial port parameters according to the communication method corresponding to the human-machine interface, and write communication logic such as data frame reception, data frame parsing, address recognition, data writing and response processing.
[0160] When using Modbus-like protocols, it is necessary to configure the corresponding register addresses and data formats; when using free ports or device-defined serial port protocols, it is also necessary to write message parsing logic according to the corresponding frame format. For ordinary device developers or maintenance personnel, the above tasks present a high barrier to entry in communication programming.
[0161] This invention pre-installs a human-machine interface processing module in the common basic processing layer of the PLC standardized program framework, and sets a dedicated human-machine interface interface on the PLC controller.
[0162] The client layer provides users with a configuration interface for human-machine interface parameters. Users can configure the communication protocol, baud rate, data format, and data mapping relationship between the PLC controller's internal data and the human-machine interface controls.
[0163] The communication protocol can be selected from preset protocol templates based on the actual human-computer interaction interface type. For example, a Modbus-type communication protocol template or a predefined free-port communication protocol template can be selected.
[0164] When the Modbus protocol is selected, users can visually select the PLC internal data to be mapped, as well as the corresponding human-machine interface controls or communication addresses. The system will automatically establish the corresponding data mapping relationship based on the configuration.
[0165] When a preset free port protocol template is selected, the system can parse the data sent from the human-machine interface according to the data frame structure, data location and verification method defined by the corresponding protocol template, and write the parsed data into the corresponding PLC internal data.
[0166] Users do not need to directly write programs for serial port reception, message splitting, address identification, and data writing.
[0167] For example, the "equipment operating status" inside the PLC can be mapped to the status display control in the human-machine interface, the "feed axis target displacement" can be mapped to the parameter input control, the "alarm status" can be mapped to the alarm display control, and the "automatic mode selection" can be mapped to the mode selection control.
[0168] After the client completes the configuration, it forms the human-computer interaction interface communication configuration and data mapping relationship.
[0169] The server-layer program generation module generates a corresponding data mapping table based on the human-computer interaction interface communication configuration, and configures the communication protocol type, baud rate, data format, and data mapping table into the human-computer interaction interface processing module.
[0170] When the PLC controller is running, the human-machine interface processing module receives the data sent by the human-machine interface according to the preset communication processing logic, determines the corresponding internal data of the PLC according to the data mapping table, and completes the data update.
[0171] Meanwhile, the human-machine interface processing module can also read the device status, alarm status, task status and motion motor parameters inside the PLC controller according to the data mapping table, and convert them into data that the human-machine interface can recognize according to the corresponding communication protocol before sending them to the human-machine interface.
[0172] For example, when a user inputs a new feeding distance in the human-machine interface, the human-machine interface processing module receives the corresponding data and writes the target displacement parameter of the feeding axis according to the data mapping relationship; when the PLC controller generates an alarm state, the human-machine interface processing module reads the alarm data and sends it to the corresponding alarm display control.
[0173] Therefore, this invention transforms the traditional serial communication program that requires manual writing into a configuration process of communication parameters and data mapping relationships, enabling the human-computer interaction interface adaptation process to be combined with a fully Chinese programming system.
[0174] Example 6: Dedicated Downloader and Remote Upgrade
[0175] This embodiment further explains the dedicated downloader.
[0176] A dedicated downloader may include a network communication unit, a program transmission unit, and a remote upgrade unit.
[0177] The network communication unit is used to establish a communication connection with the server layer via a WiFi network. During communication, a proprietary encryption protocol or other encrypted communication methods suitable for ensuring transmission security can be used.
[0178] After the dedicated downloader goes online, it first sends the device identity information to the server layer, which then confirms the corresponding PLC controller and enterprise account based on the device identity.
[0179] When the client submits a program download task, the server layer determines the corresponding dedicated downloader based on the identity of the target PLC controller device and sends the encrypted execution code through the MQTT communication service.
[0180] The network communication unit can receive encrypted execution code, upgrade instructions, and upgrade data from the server layer based on the device's identity.
[0181] After receiving the encrypted execution code, the program transmission unit further confirms the target PLC controller and the version of the program to be downloaded, and then transmits the encrypted execution code to the corresponding PLC controller.
[0182] After receiving the data, the PLC controller can write the encrypted running code into the corresponding running storage area and run the corresponding program when the program switching conditions are met.
[0183] The remote upgrade unit is used to receive upgrade instructions and upgrade data issued by the server layer.
[0184] For the firmware of the dedicated downloader itself, the corresponding downloader upgrade data can be obtained through the network communication unit, and the downloader firmware update can be completed by the remote upgrade unit.
[0185] For PLC controller firmware, a dedicated programmer can receive upgrade data applicable to the PLC controller, and then transmit the corresponding upgrade data to the PLC controller through the communication interface between the programmer and the PLC controller, so that the PLC controller can perform the firmware update.
[0186] Therefore, remote upgrades of dedicated programmers and PLC controllers can be achieved without engineers having to bring their computers to the site to connect download cables for programming.
[0187] In a specific application scenario, when equipment manufacturers need to add new operational functions to equipment at remote customer sites, maintenance personnel can select the target equipment and target program version on the client side. The server layer sends a program download task to the corresponding dedicated downloader. After receiving the program, the dedicated downloader transmits it to the PLC controller, thus completing the remote program update.
[0188] Example 7: Standardized Procedure Framework
[0189] like Figure 1 As shown, this embodiment further illustrates the standardized program framework in a PLC controller.
[0190] The standardized program framework includes a program version layer, a common basic processing layer, a multi-task execution layer, a task internal logic layer, and a data interaction structure.
[0191] With the fixed program organization structure described above, different developers no longer arbitrarily create the entire PLC program according to their personal habits, but instead configure the specific device business logic in the predefined standardized program structure.
[0192] The program version layer is used to manage one or more program versions and determine the target program version that needs to be run based on the program version identifier.
[0193] When the target program version starts, it performs a power-on initialization process to initialize the digital input / output status, internal register status, motion motor parameters, and communication parameters.
[0194] After initialization, the common basic processing layer continues to run common control logic.
[0195] The common basic processing layer includes a status processing module, a key processing module, an alarm processing module, a service processing module, an emergency stop processing module, a human-machine interface processing module, and a motion motor configuration module.
[0196] The status processing module is used to maintain the standby status, manual status, automatic status, alarm status, emergency stop status, current sequence, and running status of the equipment.
[0197] The current step sequence is used to indicate the execution step of the current control task or equipment control process, and can be updated as the task state changes, for use in task execution, operation monitoring or fault diagnosis.
[0198] For example, when the device completes power-on initialization and there are no alarms or emergency stops, it can enter standby mode; when the user selects automatic mode, it can enter automatic preparation mode; when a control task is running, it can enter running mode; and when a fault is detected, it can enter alarm mode.
[0199] The button processing module is used to read input signals generated by physical buttons or other switch operation devices and convert them into standardized control requests.
[0200] For example, start button input can be converted into start request, stop button input into stop request, and reset button input into reset request, so that different business tasks can read the corresponding button status through a unified control request.
[0201] The alarm processing module is used to generate an alarm state based on pre-configured fault triggering conditions, and to control the audible and visual alarms and corresponding fault processing logic according to the alarm state.
[0202] The service processing module is used to save or read the equipment maintenance cycle and service validity period, and to form the equipment service status according to the corresponding service configuration.
[0203] The emergency stop processing module continuously monitors emergency stop conditions. When an emergency stop condition is met, the emergency stop processing module takes precedence over the normal business control logic and executes the corresponding stop action to stop the digital outputs and motion outputs that need to be stopped.
[0204] The human-machine interface processing module is used to parse the human-machine interface operation data according to the configured communication protocol and data mapping relationship, and to realize the data exchange between the PLC internal data and the human-machine interface control data.
[0205] The motion motor configuration module is used to uniformly configure the motion control parameters corresponding to the motion motor and provide these parameters to the preset motion control logic. The motion control parameters may include the motion motor's zero position, reset, limit and emergency stop related parameters, number of steps, angle, return-to-zero speed, speed operation parameters, motion direction, trapezoidal acceleration / deceleration parameters, limit conditions, and emergency stop parameters. The speed operation parameters may include the running speed or parameters related to the running speed; the reset may include resetting the motion motor state and / or processing the motion mechanism to return to a predetermined initial state; the limit and emergency stop related parameters are used to determine the corresponding motion stop processing method when a limit state or emergency stop state is established.
[0206] The multi-task execution layer is used to organize multiple independent control tasks.
[0207] For example, an automated processing machine can simultaneously create feeding tasks, processing tasks, and inspection tasks. Each control task has its own independent task state and internal logic, and is scheduled in parallel by a multi-task execution layer.
[0208] "Parallel operation" is not limited to all tasks executing instructions at the same physical moment, but rather refers to the fact that under the PLC scanning operation mechanism, each task participates in periodic scheduling according to its independent program state and can maintain its own task state and operating logic.
[0209] The internal logic layer of a task is used to organize each control task according to a unified structure.
[0210] Each control task includes at least task initialization, triggering rules, state switching, and state release.
[0211] Task initialization is used to restore the corresponding task parameters and task state before the task is started or re-executed.
[0212] Triggering rules are used to determine the conditions under which a task begins execution.
[0213] State switching is used to determine the transition conditions between different stages of a task and the corresponding action outputs for each stage.
[0214] State release is used to release the output state and temporary data occupied by the task when the task is completed, stopped, or exited.
[0215] For example, a feeding task can include task states such as "waiting", "feeding preparation", "feeding operation", and "feeding completion". When the triggering rule is met, the system moves from the waiting state to the feeding preparation state; after the motion motor is ready, it moves to the feeding operation state; after the motion reaches the target displacement, it moves to the feeding completion state; and after the state is released, the feeding completion data is output.
[0216] The data interaction structure is used to complete the data flow within a single control task, between multiple control tasks, between control tasks and peripherals, and between control tasks and the server layer.
[0217] When different tasks need to be linked, it is not necessary to directly change the internal program of another task. Instead, task status, trigger data, or linkage data are passed through a data interaction structure.
[0218] For example, after the feeding task is completed, the "feeding completed" status is written to the data interaction structure. The processing task reads this status and then determines whether to enter the processing stage.
[0219] The task status, trigger data, or linkage data in the data interaction structure can also serve as triggering conditions for other control tasks, thereby forming a task linkage triggering relationship based on data interaction.
[0220] The above structure maintains the program boundaries between different control tasks, reducing the impact on the program structure of other tasks when modifying a single task.
[0221] Example 8: PLC Hardware Resources, Motion Control, and Safety Control
[0222] This embodiment further explains the hardware resources of the PLC controller and the corresponding control methods.
[0223] The PLC controller is equipped with 20 digital input ports X1 to X20, 20 digital output ports Y1 to Y20, 4 independent motion motor control interfaces M1 to M4, 4 analog acquisition channels ACD1 to ACD4, a dedicated human-machine interface, and communication interfaces including RS232, RS485, CAN, and TCP interfaces.
[0224] The four independent motion motor control interfaces M1 to M4 can be connected to stepper motors and / or servo motors according to the actual equipment configuration.
[0225] In practice, digital input port X1 can be configured as a start button input, X2 as a stop button input, and X3 and X4 as the front and rear limit inputs of the motion mechanism, respectively.
[0226] Digital output port Y1 can be configured as a run indicator output, Y2 as an alarm output, and other digital output ports can be assigned according to the actuators of the controlled machine equipment.
[0227] The above port usage is only an example; in actual applications, it can be redefined by the user through a fully Chinese programming interface.
[0228] For motion motor control, users can configure the motor's zero position, reset, return-to-zero speed, running speed, direction of motion, displacement, number of steps, angle, trapezoidal acceleration and deceleration parameters, limit conditions, limit emergency stop related parameters, and emergency stop response rules in a fully Chinese programming interface.
[0229] For example, M1 can be configured as a feeding axis, M2 can be configured as a positioning axis, M3 can be configured as a lifting axis, and M4 can be used as a spare axis or other motion axis.
[0230] When M1 is connected to a stepper motor, the feeding motion can be achieved by outputting pulse and direction signals through the corresponding motion motor control interface.
[0231] When M2 is connected to a servo driver that uses pulse position control, it can also output corresponding pulse and direction control signals according to the target position, running speed and direction parameters, so that the servo driver can complete the closed-loop drive of the corresponding servo motor.
[0232] During program generation, the motion parameters configured by the client are written into the preset motion control logic. Users do not need to rewrite the pulse generation, direction output, motion completion judgment, and limit judgment programs in their business tasks.
[0233] The human-machine interface is connected to the PLC controller through a dedicated human-machine interface interface and performs communication through the human-machine interface processing module.
[0234] Users configure the communication protocol, baud rate, and data format on the client side, and then establish a data mapping relationship between the PLC's internal data and the human-machine interface controls.
[0235] The aforementioned data mapping relationship and communication configuration are saved as part of the Chinese logic configuration, and the program generation module generates the configuration data corresponding to the human-computer interaction interface processing module.
[0236] In terms of safety control, the client's fully Chinese programming interface can provide Chinese configuration entries for equipment emergency stop rules, overload alarm rules, limit protection rules, and fault shutdown rules.
[0237] The device emergency stop rule can be set to stop all motion outputs and digital outputs that need to be stopped after the emergency stop input is valid.
[0238] Overload alarm rules can trigger alarms based on the corresponding overload input status and determine whether to stop related control tasks based on the configuration.
[0239] Limit protection rules can establish a relationship between the direction of motion and the corresponding limit input. When the motor moves in a certain direction and the limit condition corresponding to that direction is met, it is prohibited to continue moving in the same direction.
[0240] Fault shutdown rules can stop one or more control tasks based on predefined fault states.
[0241] When the server layer generates runtime code, it maps the above security control configuration to the alarm processing module, emergency stop processing module, motion motor configuration module, motion control logic, and task state switching logic corresponding to the standardized program framework.
[0242] During operation, the PLC controller continuously reads the corresponding safety status and executes the corresponding protection action when the safety conditions are met.
[0243] During operation, the PLC controller also periodically collects digital input data, digital output status, analog data, external communication data, motion motor operating status, alarm information, and task operating status data corresponding to multiple control tasks, and forms operating data.
[0244] Table 1 PLC Controller Hardware Resources and Example Configuration
[0245] project Resource quantity Example configuration Main uses Digital input port Route 20 X1 starts, X2 stops, X3 front limit, X4 rear limit. Get button and sensor on / off status Digital output port Route 20 Y1 Operation Indicator, Y2 Alarm Output Control actuators and indicating devices motion motor control interface Route 4 M1 feeding shaft, M2 positioning shaft, M3 lifting shaft, M4 spare shaft Independent control of stepper motors and / or servo motors Analog signal acquisition channel Route 4 ACD1 to ACD4 Acquiring analog sensor data Human-computer interaction interface 1 set of dedicated interfaces Configure communication protocol, baud rate and data format Achieve data interaction between PLC internal data and human-machine interface controls. Communication interface RS232, RS485, CAN, TCP Configure according to peripheral communication method Interfacing with sensors, actuators and other control devices
[0246] As shown in Table 1, the PLC controller provides digital signal control, analog signal acquisition, motion motor control, human-machine interface communication, and multiple industrial communication interfaces within a unified hardware platform.
[0247] Since the motion motor control logic and human-machine interface communication logic have been encapsulated through standardized program modules, business control tasks can directly call the corresponding hardware resources according to user configuration, without having to rewrite the complete motion control program or serial communication program in each new project.
[0248] Example 9: Software Simulation, Operation Monitoring, and Remote Maintenance
[0249] This embodiment further explains software simulation debugging, operation monitoring, and remote maintenance.
[0250] The client layer can be configured with software simulation and debugging modules as well as operation monitoring and maintenance modules.
[0251] The software simulation and debugging module is used to simulate the operating conditions of the corresponding equipment by virtually inputting states before the program is officially sent to the field PLC controller.
[0252] Users can simulate manual mode, automatic mode, single-step control, reset operation, motion motor action, emergency stop state, limit state, and human-machine interface operation commands through software simulation.
[0253] Taking the automatic feeding task as an example, a reset operation can be simulated first to put the feeding task into a waiting state; then the automatic mode is simulated to activate and trigger the conditions for starting, and the feeding task is checked to see if it enters the feeding preparation, feeding movement and feeding completion states in sequence.
[0254] If the feeding task involves a motion motor, the motion motor can be simulated to start running, complete the motion, and trigger the limit switch.
[0255] When the motion motor is configured as a stepper motor, the corresponding stepping motion state can be simulated; when the motion motor is configured as a servo motor, logic simulation can be performed according to the same target motion state.
[0256] Since software simulation mainly verifies the triggering relationships, state transitions, and action outputs in the control task, it can complete the verification of the main program logic without connecting to the actual motion motor.
[0257] For human-machine interfaces, instructions can be written to the human-machine interface controls, and the internal data of the PLC corresponding to the data mapping relationship can be checked to see if the changes have occurred correctly.
[0258] For example, it can simulate a user inputting a new feeding distance on the human-machine interface and check whether the "feed axis target displacement" parameter inside the PLC changes synchronously.
[0259] The software simulation and debugging module can also detect and diagnose the communication status of the dedicated downloader, PLC controller and corresponding communication interface.
[0260] When the program logic does not execute as expected, the fault node can be located by combining the current task status, current step sequence, input data, analog data, motion motor status and alarm information.
[0261] For example, when a task remains in a waiting state, you can check whether the input port, data interaction status, or previous task status involved in the triggering conditions of the task are met.
[0262] When the motor stops running, you can further check the emergency stop status, limit status, and alarm status to determine whether the stop was triggered by safety control rules.
[0263] When the PLC controller is running normally, it generates operating data by combining digital input data, digital output status, task running status, alarm information, motion motor running status, analog data, and communication status, and uploads it to the server layer in real time or periodically via a dedicated downloader.
[0264] The operation monitoring and maintenance module reads the corresponding operation data from the server layer and displays the device operation process in the form of status page, parameter page or fault page.
[0265] When maintenance personnel confirm, based on operational data, that the triggering logic, action output, motion parameters, or human-machine interface mapping relationship of a certain control task needs to be modified, they can directly open the current program file saved on the server layer for modification.
[0266] After the modifications are completed, the updated Chinese logic configuration will be generated.
[0267] The server layer saves the modified program files and creates an updated program version. Then, it generates updated execution code based on the updated Chinese logic configuration and encrypts it to obtain the updated encrypted execution code.
[0268] The updated encrypted runtime code is sent to the target dedicated downloader via MQTT communication service, and then transmitted by the dedicated downloader to the corresponding PLC controller.
[0269] After the update is complete, the updated program version will remain associated with the previous program version. If the new program malfunctions, you can reselect the previous program version to roll back the program.
[0270] The service processing module can also record the maintenance cycle and service validity period of the equipment.
[0271] For example, the next maintenance milestone can be set based on the maintenance plan agreed upon by the equipment manufacturer and the equipment user. When the corresponding maintenance conditions are met, the service processing module generates a service reminder status, which is then displayed on the client side.
[0272] Table 2. Results of Software Simulation and Remote Operation and Maintenance Examples
[0273] Test Project Input or operation conditions Expected results Example Results Manual mode test Client-side simulation of manual mode selection Allow individual action control As expected Automatic mode test Automatic mode is enabled and simulates startup conditions. Control tasks run in a preset sequence. As expected Single-step control test Each time a single-step trigger signal is generated Only the action corresponding to the current state is executed each time. As expected Emergency stop test The emergency stop rule for the simulated equipment is established. Stop the corresponding motion and output As expected Limit test The simulated motion direction corresponds to the effective limit. Prevent the motion motor from continuing to move in the restricted direction. As expected Motion motor test Simulate the motion conditions of stepper motors or servo motors The corresponding motion state switch is completed according to the configuration. As expected Human-computer interaction interface testing Parameters are sent from the simulated human-computer interaction interface control. PLC internal mapping data changes synchronously As expected Communication detection Simulated communication link anomaly Forming a corresponding communication anomaly state As expected Remote update test Release updated encrypted execution code PLC controller update program As expected
[0274] As shown in Table 2, the software simulation environment can cover the main logic such as manual mode, automatic mode, single-step control, motion control, emergency stop protection, limit protection, human-machine interface data mapping, and communication status, thus completing the verification of the main control process before the running code is officially downloaded to the field PLC controller.
[0275] Example 10: To further illustrate the collaborative relationship between the above-mentioned parts, this example uses a device with automatic feeding, motion positioning, actuator operation, and human-machine interaction functions as an example.
[0276] After the equipment is installed, create a new equipment file in the enterprise cloud account and bind the field PLC controller and dedicated downloader.
[0277] After logging into the client, users create a new program file and configure input / output ports in a fully Chinese programming interface.
[0278] Specifically, the start button, stop button, and motion limit signal are associated with their corresponding digital input ports; the actuator is associated with its corresponding digital output port; the feeding motor is associated with the M1 interface; and the human-machine interface is associated with the dedicated human-machine interface.
[0279] In this embodiment, the feeding motor can be a stepper motor.
[0280] In another embodiment, a servo motor and its servo driver that are position-controlled by pulse and direction signals can also be used.
[0281] Users create material feeding control tasks.
[0282] During the task initialization phase, the task state is restored to the waiting state, and it is confirmed that the motion parameters corresponding to M1 have been initialized.
[0283] The trigger rule is set to the device being in automatic mode and receiving a start signal. In other task-linked scenarios, the task status, trigger data, or linkage data written by other tasks in the data interaction structure can also be used as trigger conditions.
[0284] During the state switching process, the states of material preparation, material feeding operation, and material feeding completion are set sequentially.
[0285] Users can set the zero position of the feed shaft, reset parameters, running speed, direction of motion, feed displacement, number of steps or angle, zero return speed, trapezoidal acceleration and deceleration parameters, limit conditions, and emergency stop response rules through the Chinese parameter configuration interface.
[0286] The above motion parameters form the motion control configuration, which is then written into the preset motion control logic by the server layer.
[0287] When the feeding task enters the feeding operation state, the PLC controller calls the motion control logic corresponding to M1 to execute the feeding action.
[0288] Once the feeding shaft reaches the target position, the motion control logic forms a motion completion state, and the feeding task enters the feeding completion state.
[0289] The state release process removes the temporary state corresponding to the current feeding process and outputs the feeding completion data through the data interaction structure.
[0290] At the same time, processing control tasks are established.
[0291] The processing control task reads the feeding completion data from the data interaction structure, and enters the processing process when the feeding completion data meets the processing start conditions.
[0292] The material feeding task and the processing task maintain independent task structures, and only pass status through the data interaction structure.
[0293] Therefore, when modifying the feeding distance, feeding speed, or feeding status switching logic in the future, there is no need to reorganize the entire processing task.
[0294] The human-machine interface allows you to set controls for device mode selection, start-up, stop, feeding distance parameters, running status display, and alarm display.
[0295] Users configure the communication protocol, baud rate, and data format of the human-machine interface on the client side, and establish the data mapping relationship between each human-machine interface control and the PLC's internal data.
[0296] For example, a mapping can be established between the feeding distance parameter control and the feeding target displacement parameter inside the PLC.
[0297] When the operator modifies the feeding distance on the human-machine interface, the human-machine interface processing module parses the corresponding data according to the configured communication protocol and updates the internal feeding target displacement of the PLC according to the data mapping relationship.
[0298] The new feeding target displacement is used as the target parameter of the motion control logic when the corresponding motion task is executed next.
[0299] Therefore, users can complete the human-machine interface setting and motion execution of the feeding distance without writing additional human-machine interface receiving programs or motion pulse programs.
[0300] After the program is configured, start the software simulation through the client.
[0301] During the simulation, the automatic mode, start signal, feeding completion signal, and processing completion signal are simulated to confirm that the feeding and processing tasks run in the set order.
[0302] Then simulate emergency stop and limit input to confirm that the safety control can stop the corresponding movement or prevent further movement in the restricted direction.
[0303] Finally, simulate the human-computer interaction interface operation commands to confirm that the data mapping relationship is correct.
[0304] After the simulation is completed, the program file is saved to the server layer and the current program version is created.
[0305] Based on the Chinese logic configuration, the server layer maps the trigger conditions, action outputs, motion control configurations, and human-machine interface communication configurations to the standardized program framework, preset motion control logic, and human-machine interface processing module, respectively, to generate executable code that the PLC controller can execute.
[0306] The executable code is encrypted to form encrypted executable code, which is then sent to a dedicated downloader on-site via MQTT communication service.
[0307] After the dedicated downloader receives the data, it transmits the encrypted runtime code to the PLC controller.
[0308] The PLC controller executes the code according to a standardized program framework.
[0309] During operation, the status processing module, button processing module, alarm processing module, service processing module, emergency stop processing module, motion motor configuration module, and human-machine interface processing module in the common basic processing layer operate according to their respective functions; the multi-task execution layer schedules multiple control tasks in parallel; each control task is executed according to task initialization, triggering rules, state switching, and state release, and data interaction is carried out within tasks, between tasks, between tasks and peripherals, and between tasks and the server layer through the data interaction structure.
[0310] During normal operation of the equipment, the PLC controller continuously acquires digital input and output status, analog data, communication data, motion motor status, alarm information, and task operation status data, and uploads them to the server layer through a dedicated downloader.
[0311] Maintenance personnel can remotely read the device status via mobile phone, PDA or computer.
[0312] When an alarm is triggered by the equipment, maintenance personnel can read the current task status, current sequence, input port status, motion motor status, and alarm information to make a preliminary determination of the cause of the fault.
Claims
1. A programmable logic controller system with full Chinese programming, characterized in that, It includes the server layer, device layer, and client layer; The server layer is used to store program files and versions, generate encrypted execution code based on Chinese logical configuration, and communicate with the device layer. The device layer includes a dedicated downloader, a PLC controller, a human-machine interface, motion motors, and controlled machine equipment. The motion motors are stepper motors and / or servo motors. The dedicated downloader is used to receive encrypted running code and firmware upgrade data from the server layer and transmit them to the PLC controller. At the same time, it uploads the running data collected by the PLC controller to the server layer. The PLC controller is connected to the human-machine interface, motion motors, and controlled machine equipment. The client layer is used to configure trigger conditions, action output, human-computer interaction interface data mapping, and motion parameters of the motion motor in a fully Chinese programming interface, forming the Chinese logic configuration and program file. The PLC controller has a built-in standardized program framework, which includes a program version layer, a common basic processing layer, a multi-task execution layer, a task internal logic layer, and a data interaction structure. The program version layer manages multiple program versions and performs power-on initialization upon startup. The common basic processing layer includes a status processing module, a button processing module, an alarm processing module, a service processing module, an emergency stop processing module, a human-machine interface processing module, and a motion motor configuration module. The multi-task execution layer runs multiple control tasks in parallel. The task internal logic layer organizes each control task according to task initialization, triggering rules, state switching, and state release. The data interaction structure, while maintaining the logical independence of each control task, transmits task status and trigger data through a preset data mapping relationship, realizing inter-task linkage triggering and data sharing.
2. The programmable logic controller system with full Chinese programming according to claim 1, characterized in that, The server layer includes a database, MQTT communication service, WEB service, mini-program front-end, and H5 front-end; The database establishes data isolation relationships based on enterprise accounts and is used to store user account data, device information, program files, program version information, and device operation logs. The MQTT communication service establishes a communication topic according to the device identity and establishes a two-way communication link with the dedicated downloader, which is used to send program download tasks, control instructions and upgrade instructions to the corresponding dedicated downloader, as well as to receive device operation data; The WEB service is used to provide the client layer with interfaces for program editing, device query, version query and running status query; The mini-program front-end and the H5 front-end are used to provide client terminals with an operation entry point for full Chinese programming, device debugging, and device maintenance.
3. The programmable logic controller system with full Chinese programming according to claim 1, characterized in that, The client layer includes a Chinese logic editing module, a port and wiring visualization module, and a collaborative editing module; The Chinese logic editing module is used to establish a correspondence between trigger conditions and action outputs through Chinese function items. The trigger conditions include input port trigger conditions, time trigger conditions, state trigger conditions, and analog threshold trigger conditions. The action outputs include output port setting actions, timer start actions, state switching actions, and the motion actions of the motion motor. A structured Chinese logic configuration is formed according to the correspondence. The port and wiring visualization module is used to generate a port definition table and a visual wiring diagram based on the Chinese logic configuration, and to associate the input port, output port, motion motor interface, analog acquisition channel and communication interface with the corresponding Chinese names. The collaborative editing module enables multiple client terminals to edit the program file based on the same enterprise account, and generates a corresponding program version when the program content is modified.
4. The programmable logic controller system with full Chinese programming according to claim 2, characterized in that, The server layer also includes a version management module and a program generation module; The version management module is used to set a program version identifier for the program file, associate and store each program version with the corresponding PLC controller device identity, and perform switching, tracing and rollback between multiple program versions based on the program version identifier. The program generation module is used to parse the Chinese logic configuration, map the correspondence between the triggering conditions and the action output, as well as the port parameters, motion motor parameters and communication parameters, to the corresponding modules and PLC controller hardware resources in the standardized program framework, generate executable running code for the PLC controller, and encrypt the running code to obtain the encrypted running code; The MQTT communication service is used to send the encrypted runtime code to the target PLC controller via a downloader, based on the device identity of the target PLC controller.
5. The programmable logic controller system with full Chinese programming according to claim 1, characterized in that, The dedicated downloader includes a network communication unit, a program transmission unit, and a remote upgrade unit; The network communication unit is used to establish a communication connection with the server layer using an encrypted communication protocol via a WiFi network, and to receive the encrypted running code and upgrade data according to the device identity; The program transmission unit is used to transmit the received encrypted running code to the corresponding PLC controller, and the PLC controller writes the encrypted running code into the running storage area. The remote upgrade unit is used to perform a remote firmware upgrade on the dedicated downloader according to the upgrade command issued by the server layer, and to transmit the upgrade data applicable to the PLC controller to the PLC controller, thereby performing a remote firmware upgrade on the PLC controller.
6. The programmable logic controller system with full Chinese programming according to claim 1, characterized in that, In the aforementioned standardized procedure framework: The program version layer is used to determine the target program version based on the program version identifier, and to complete the power-on initialization of digital input / output status, internal register status, motion motor parameters and communication parameters when the target program version is started. The status processing module is used to maintain the standby status, manual status, automatic status, alarm status, emergency stop status, current sequence, and running status of the device; The button processing module is used to read the input signals of external physical buttons and convert them into corresponding control requests; The alarm processing module is used to determine the fault triggering conditions and execute alarm output and fault processing. The service processing module is used to record the equipment maintenance cycle and service validity period and generate corresponding service status. The emergency stop processing module is used to prioritize stopping the corresponding motion output and digital output when the emergency stop condition is met. The human-machine interface processing module is used to parse the human-machine interface operation data according to the configured data mapping relationship, and to perform data conversion between the data inside the PLC controller and the human-machine interface control data. The motion motor configuration module is used to configure the motion motor's zero position, reset, limit stop, number of steps, angle, zero return speed, speed operation, direction of motion, trapezoidal acceleration and deceleration, limit conditions, and emergency stop, among other operating parameters. The multi-task execution layer is used to maintain the task states of multiple control tasks and schedule the multiple control tasks in parallel. The task initialization in the internal logic layer of the task is used to restore the task parameters and task state, the triggering rule is used to determine the task start conditions, the state switching is used to determine the transition conditions and corresponding actions between different running states of the task, and the state release is used to release the task output state and task data when the task is completed or exited. The data interaction structure is used to transmit task status, trigger data, and linkage data between various control tasks, so that different control tasks can maintain logical isolation and can interact with each other.
7. The programmable logic controller system with full Chinese programming according to claim 4, characterized in that, The PLC controller is equipped with 20 digital input ports X1 to X20, 20 digital output ports Y1 to Y20, 4 independent motion motor control interfaces M1 to M4, 4 analog acquisition channels ACD1 to ACD4, a dedicated human-machine interface, and communication interfaces including RS232, RS485, CAN, and TCP interfaces. The four independent motion motor control interfaces are used to connect stepper motors and / or servo motors respectively; the client layer configures the zero position, homing speed, running speed, direction of motion, displacement, limit conditions and emergency stop response rules of the motion motor through Chinese parameter items to form a motion control configuration; the program generation module maps the motion control configuration to the running parameters of the preset motion control logic and generates motion control code executed by the PLC controller calling the motion motor control interface; The client layer is also used to configure the human-machine interface communication protocol, baud rate, data format, and data mapping relationship between the PLC controller's internal data and the human-machine interface controls, forming a human-machine interface communication configuration. The program generation module generates a data mapping table based on the human-machine interface communication configuration and configures the human-machine interface processing module. The human-machine interface processing module completes the human-machine interface data parsing, PLC internal data updating, and human-machine interface display data updating according to the preset serial communication processing logic.
8. The programmable logic controller system with full Chinese programming according to claim 7, characterized in that, The client layer also includes a software simulation and debugging module and an operation monitoring and maintenance module; The software simulation and debugging module is used to simulate manual mode, automatic mode, single-step control, reset operation, motion motor action, emergency stop and limit state and human-machine interface operation instructions in a virtual input state before the program is sent to the PLC controller. It also verifies the Chinese logic configuration according to the task status, action output status and data interaction status of each control task, and detects and diagnoses the communication status. The PLC controller is used to collect digital input data, digital output status, analog data, communication data, motion motor running status, alarm information, and task running status of each control task and form running data. The dedicated downloader is used to upload the running data to the server layer. The operation monitoring and maintenance module is used to read the operation data and display the equipment operation status and fault information, and to modify the Chinese logic configuration according to the fault information; the server layer is used to establish an update program version and generate updated encrypted operation code according to the modified Chinese logic configuration, and to send the updated encrypted operation code to the PLC controller through the dedicated downloader.
9. A method for implementing a programmable logic controller system with all-Chinese programming, characterized in that, A programmable logic controller (PLC) system comprising a server layer, a device layer, and a client layer, wherein the device layer includes a dedicated downloader, a PLC controller, a human-machine interface, motion motors, and controlled machine equipment, wherein the motion motors are stepper motors and / or servo motors, and the implementation method includes: The client layer's fully Chinese programming interface configures the correspondence between trigger conditions and action outputs, and configures the human-computer interaction interface data mapping relationship and motion parameters of the motion motor, forming a structured Chinese logic configuration and program file; The server layer stores the program file and corresponding program version, parses the structured Chinese logic configuration, and maps the triggering conditions, action outputs, human-machine interface data mapping relationships and motion parameters to the preset PLC standardized program framework, serial communication processing logic and motion control logic, respectively, to generate executable running code for the PLC controller, and encrypts the running code to form encrypted running code; The encrypted execution code is sent to the corresponding dedicated downloader through the server layer, and the dedicated downloader transmits the encrypted execution code to the corresponding PLC controller. The standardized program framework is run through the PLC controller. The standardized program framework includes a program version layer, a common basic processing layer, a multi-task execution layer, a task internal logic layer, and a data interaction structure. The common basic processing layer runs a status processing module, a button processing module, an alarm processing module, a service processing module, an emergency stop processing module, a motion motor configuration module, and a human-machine interface processing module. The multi-task execution layer runs multiple control tasks in parallel. Each control task is executed through the task internal logic layer according to task initialization, triggering rules, state switching, and state release. Data interaction is performed within tasks, between tasks, between tasks and peripherals, and between tasks and the server layer through the data interaction structure. The PLC controller calls preset motion control logic to control the motion motor according to the motion parameters, and calls the human-machine interface processing module to execute the interaction between the PLC internal data and the human-machine interface control data according to the human-machine interface data mapping relationship. The PLC controller collects equipment operation data, which is then uploaded to the server layer via the dedicated downloader. The client layer then performs operation monitoring, fault diagnosis, and remote program updates based on the equipment operation data.
10. The implementation method of the programmable logic controller system with full Chinese programming according to claim 9, characterized in that, The structured Chinese logic configuration and program files are generated through the fully Chinese programming interface of the client layer, including: The control task is established through Chinese function items, and the triggering condition is configured as at least one of input port triggering condition, time triggering condition, state triggering condition, analog threshold triggering condition and data interaction, and the action output is configured as at least one of output port setting action, timer start action, state switching action and motion motor movement action. Configure the zero position, return-to-zero speed, running speed, direction of motion, displacement, limit conditions, and emergency stop response rules of the motion motor through Chinese parameter items, and form the motion control configuration with the configuration results; Configure the communication protocol, baud rate, and data format of the human-machine interface through Chinese parameter items, and establish the data mapping relationship between the internal data of the PLC controller and the human-machine interface controls to form the human-machine interface communication configuration. The triggering conditions, action output, motion control configuration, and human-computer interaction interface communication configuration are structured and stored in the Chinese logic configuration. The server layer then uses the Chinese logic configuration to call the preset task logic, motion control logic, and serial communication processing logic to generate the corresponding running code. Based on the Chinese logical configuration, a port definition table and a visual wiring diagram are generated synchronously, and the program file is saved in the server storage space corresponding to the enterprise account.
