Method for configuring programmable input / output port based on automation

By using the method of automatically configuring programmable input and output ports in the diesel generator set controller, users can configure and download the required functions in the upper computer module to the controller, solving the problems of inconvenient function customization and high maintenance costs in the prior art, and achieving convenience and cost reduction of function management.

CN120044869APending Publication Date: 2025-05-27ZHENGZHOU FOGUANG ELECTRIC POWER EQUIPMENT CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510041902.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-10
Publication Date
2025-05-27

AI Technical Summary

Technical Problem

The existing diesel generator set controllers have problems such as inconvenient code management, high development and maintenance costs, and inconvenient product traceability and maintenance in terms of user custom functions.

Method used

Using the method of automatically configuring programmable input and output ports, through the communication connection between the upper computer and the controller, the user configures the required functions in the upper computer module and downloads them to the controller. The controller realizes the functions according to the user configuration.

Benefits of technology

It realizes convenient customization and management of user functions, reduces development and maintenance costs, and simplifies product traceability and maintenance processes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120044869A_ABST
    Figure CN120044869A_ABST
Patent Text Reader

Abstract

The invention discloses a method for configuring a programmable input / output port based on automation, an upper computer is in communication connection with a controller, the controller obtains control data through the upper computer, and the method comprises the following steps: hardware connection: the controller is connected with the upper computer; downloading a program, selecting a control program on a control interface of the upper computer, and downloading the control program into the controller; and the controller successfully downloads the program and executes related control operation. According to the method for configuring the programmable input / output port based on the automation, all functions which a user wants to customize are written in the controller, the user only needs to configure the upper computer module into a desired result and download the result into the controller, and the controller can realize the functions according to the configuration of the user. All functions of a user can be completed through the upper computer and the lower computer, management is convenient, and the midway development period is shortened.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of automatic control methods. More specifically, the present invention relates to a method for automatically configuring programmable input / output ports. Background Art

[0002] For current diesel generator set controllers, there are many user-defined functions. Each time, the user's customized functions are written into the code, and then it is marked what function is customized by which user. This code is downloaded into the corresponding controller.

[0003] Such controllers mainly have the following problems: 1. When adding new functions, the code needs to be modified, which is not convenient for code management. For the current situation where there are many user-defined functions, developers need to perform secondary development, and the development and maintenance costs are relatively high; 2. It is not convenient for product traceability and maintenance. Summary of the Invention

[0004] In view of the deficiencies of the prior art, the present invention innovatively provides a method for automatically configuring programmable input / output ports, which can solve the technical problem of inconvenient programming of controller function customization in the prior art.

[0005] To achieve the above technical objectives, the present invention discloses a method for automatically configuring programmable input / output ports. The controller is communicatively connected to a host computer, and the controller obtains control data through the host computer. The method includes:

[0006] Hardware connection, connecting the controller to the host computer;

[0007] Download program, select a control program on the host computer control interface and download it into the controller;

[0008] When the controller successfully downloads the program, perform relevant control operations.

[0009] Further, the hardware connection further includes selecting the port number, baud rate, and check code of the serial port, and after selection, click Connect on the host computer.

[0010] Further, the host computer includes a control screen, and the control program is displayed on the control screen in the form of icons, and the control program is selected by dragging the icons.

[0011] Further, the control program includes a conditional program and an action program.

[0012] Further, the controller downloading the program includes:

[0013] The controller receives the control program of the host computer;

[0014] The control determines whether the control program is correct.

[0015] When the control program is judged to be correct, the controller can execute control actions.

[0016] When the control program is judged to be incorrect, the control program of the host computer is received again.

[0017] Further, after receiving the control program, the controller parses it. When the parsed program is the same as the program issued by the host computer, the control program is executed.

[0018] Further, the data format of the control program issued by the host computer is a structure, including: unsigned char plcsumnum and unsigned char data[index]

[16] , where

[0019] plcsumnum is the total number of plcs, data[index]

[16] is the data content in each plc, and index is the number of plcs.

[0020] The beneficial effects of the present invention are:

[0021] The method for automatically configuring programmable input / output ports provided by the present invention writes all the functions that the user wants to customize in the controller. The user only needs to configure the host computer module into the result they want and download it to the controller. The controller will implement its functions according to the user's configuration. In this way, all the functions of the user can be completed through the host computer + lower computer, which is convenient for management and reduces the intermediate development cycle. Description of the Drawings

[0022] Figure 1 Shows the overall control flow diagram of the embodiment of the present invention;

[0023] Figure 2 Shows the flowchart of the controller receiving the control program in the embodiment of the present invention. Detailed Embodiment

[0024] The following combines the description of the drawings to explain and illustrate in detail the method for automatically configuring programmable input / output ports provided by the present invention.

[0025] The method for automatically configuring programmable input / output ports provided by the present invention writes all the functions that the user wants to customize in the controller. The user only needs to configure the host computer module into the result they want and download it to the controller. The controller will implement its functions according to the user's configuration. In this way, all the functions of the user can be completed through the host computer + lower computer, which is convenient for management and reduces the intermediate development cycle.

[0026] In some embodiments, the present invention provides a method for automatically configuring programmable input / output ports. The controller communicates with the host computer, and the controller obtains control data through the host computer, such as Figure 1 shown, the method includes:

[0027] Hardware connection, the controller is connected to the host computer;

[0028] Download the program, select the control program on the host computer control interface and download it to the controller;

[0029] When the controller successfully downloads the program, execute the relevant control operations.

[0030] Optionally, the specific method includes:

[0031] Step 1: The host computer configures its functions according to user requirements;

[0032] Step 2: Send the configured functions to the controller through the serial port;

[0033] Step 3: After receiving the data, the controller parses and processes the data;

[0034] Step 4: After processing, determine whether it is consistent with the settings of the controller. If it is consistent, the controller executes this configuration function; if not, it does not execute;

[0035] Step 5: When the next instruction is updated, the controller executes the updated function.

[0036] In some embodiments, as Figure 2 shown, the controller downloading the program includes:

[0037] The controller receives the control program from the host computer;

[0038] Control to determine whether the control program is correct,

[0039] When the control program is judged to be correct, the controller can execute the control action,

[0040] When the control program is judged to be incorrect, receive the control program from the host computer again.

[0041] In some embodiments, the host computer is a PLC (Programmable Logic Controller), as Figure 1 shown, the specific method includes:

[0042] Step 1: Hardware connection: Open the host computer (PLC) interface and connect the controller to the host computer through the serial port.

[0043] The host computer includes a control screen, i.e., a control interface. Multiple icons are displayed on the control screen, and the icons can be dragged on the control screen to achieve the setting and output of different functions. Optionally, the control screen is a touch screen, and the icons can be dragged by touching the screen with a finger. Alternatively, the icons can also be dragged by using an external control device such as a mouse.

[0044] Step 2: Select the model and click "Connect" on the interface. Check whether the connection button of the host computer is green. Green indicates connection, and red indicates no connection.

[0045] Before the host computer is connected to the controller, select the port number, baud rate, parity bit, etc. of the serial port on the control screen of the host computer. After the selection is completed, click "Connect". When this port number is not occupied, the connection is successful.

[0046] Step 3: After connection, drag the small icons on the interface to complete its simple functions with conditions + actions + settings.

[0047] After the host computer is successfully connected to the controller, the condition icons and action icons on the control screen of the host computer can be dragged. The control program includes a condition program and an action program. Optionally, the condition can be the 3rd day in the date, and the action can be to set Flag 1 to 1 (associated with Output Port 1).

[0048] Step 4: After the settings are completed, the host computer has a simple simulation interface, where the effect can be simulated to check whether it is correct.

[0049] Step 5: After it is correct, download the set program to the controller.

[0050] The control program (conditions + actions) set in the host computer is downloaded to the controller. After receiving the instruction, the controller starts to parse. When it is found that the condition is the 3rd day and the action is to set the flag to 1 (associated with Output Port 1), the date in the real-time time read by the controller's RTC (Real-Time Clock) is compared with the one sent from the host computer. When the conditions are the same, the corresponding action is executed.

[0051] Optionally, the data format of the control program sent to the controller is a structure: the members are unsigned char plcsumnum and unsigned char data[index]

[16] ; plcsumnum is the total number of plcs, data[index]

[16] is the data content in each plc, and index is the number of plcs. In this way, the data sent from the host computer is received through this structure, and the controller can parse the command sent from the host computer by judging the content in the structure and then judge and execute it.

[0052] Among them, the host computer is configured with condition (3 days) + action flag 1 set to 1 (associated with output port 1). Then plcsumnum is 4 (condition + action + end + end bit), a total of 65 unsigned char data. The total data content is: one-bit plcsumnum + condition bit content of 16 unsigned char data + action bit content of 16 data + 16 ends + end bit content of 16 data.

[0053] Step 6: After downloading the program to the controller, check the result and execute the corresponding action when the condition is met. When the condition is satisfied, download the program to the controller, and it can be seen that output port 1 of the controller is set to 1.

[0054] The method for automatically configuring programmable input / output ports provided by the present invention can implement all customized functions of users through the host computer and the controller, without the need for secondary development of customized functions, facilitating code management and maintenance, and reducing development costs. Moreover, the operation method of the automatically programmable input / output port is simple, and the operation method can be recorded as a video and sent to users. Technicians and operators can simply operate the configuration requirements through the recorded video, download them to the controller, and verify its configuration function.

[0055] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "transverse", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", "axial", "radial", "circumferential", etc. indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus should not be construed as a limitation of the present invention.

[0056] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed", etc. should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or integrated; it can be a mechanical connection or an electrical connection; it can be directly connected or indirectly connected through an intermediate medium, and it can be the internal communication of two components or the interaction relationship between two components, unless otherwise clearly limited. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0057] In the description of this specification, the descriptions referring to terms such as "this embodiment", "one embodiment", "some embodiments", "examples", "specific examples", or "some examples", etc., mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in a suitable manner in any at least one embodiment or example. In addition, without contradiction, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.

[0058] In addition, the terms "first" and "second" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include at least one of such features. In the description of the present invention, the meaning of "a plurality" is at least two, such as two, three, etc., unless otherwise specifically and clearly defined.

[0059] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, and simple improvements made to the substantial content of the present invention shall be included within the protection scope of the present invention.

Claims

1. A method for automatically configuring programmable input and output ports, characterized in that: The controller obtains control data through the host computer through communication connection with the host computer, and the method includes: Hardware connection, the controller is connected to the host computer; Download the program, select the control program on the host computer control interface, and download it to the controller; The controller successfully downloads the program and executes relevant control operations.

2. The method according to claim 1, characterized in that The hardware connection also includes selecting the port number, baud rate and check code of the serial port, and after the selection is completed, click the connection on the host computer.

3. The method according to claim 2, characterized in that The host computer includes a control screen, and the control program is displayed on the control screen in the form of an icon, and the control program is selected by dragging the icon.

4. The method according to claim 3, characterized in that The control program includes a condition program and an action program.

5. The method according to claim 4, characterized in that The controller download program includes: The controller receives the control program of the host computer; The control determines whether the control program is correct. When the control program is judged to be correct, the controller can execute the control action. When the control program is judged to be wrong, the control program of the host computer is received again.

6. The method according to claim 5, characterized in that The controller parses the received control program, and executes the control program when the parsed program is the same as the program sent by the host computer.

7. The method according to claim 6, characterized in that The data format of the control program sent by the host computer is a structure, including: unsigned char plcsumnum and unsigned char data[index][16], where: plcsumnum is the total number of PLCs, data[index][16] is the data content in each PLC, and index is the number of PLCs.