Multi-point communication control method for programmable controller
By establishing a Boolean array for each control object in a programmable controller and analyzing and assigning values through the upper computer, the problem of configuration errors and poor traceability when adding control points in the prior art is solved, and higher scalability and traceability are achieved.
Patent Information
- Application Number
- CN202311853839.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-29
- Publication Date
- 2025-07-01
AI Technical Summary
The existing technology is prone to configuration errors when adding control points. Communication messages require both parties to test and verify. It is difficult to capture and resolve bugs during the interaction, resulting in poor system scalability and poor traceability.
A Boolean array is established for each control object in a programmable controller, and the control command is sent through the upper computer and its specific content is parsed, the Boolean array is assigned, and the actual control object data is mapped to the actual control object data to perform actions.
It saves the number of register usage during the interaction between the PLC and the upper computer, increases the scalability of control commands and traceability of the interaction process, and improves the efficiency of control program writing.
Smart Images

Figure CN120233733A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of PLCs, and particularly to a multi-point communication control method for a programmable controller. Background Art
[0002] Reference Figure 1 , as the types and quantities of devices increase, it is necessary to continuously add control points. When programmable controller and host computer technicians add points, it is easy to misconfigure the points. Moreover, for the underlying communication messages corresponding to each point, both parties need to conduct certain test validations. If a BUG occurs during the interaction process, it is necessary to capture and analyze the data of the underlying communication messages, which requires relatively high technical skills for general engineers.
[0003] In addition, the more points there are in the human-machine interface and configuration software, the more expensive the price will be. Moreover, the increase in interactive points means that the data addresses of the underlying communication codes of the host computer are different, with a relatively low error tolerance, and the content of the communication message entries needs to be increased. The increase in interactive points on the PLC side will lead to an increase in the number of register usages of the PLC, reducing the available space of the PLC registers. When new points need to be added to the system, it is necessary for the host computer and the PLC to redefine a new batch of point addresses, resulting in poor scalability. Also, in the traditional interaction method, when the system needs to trace control records, it is difficult to capture control commands at the PLC side due to different point addresses, resulting in poor traceability.
[0004] Therefore, it is necessary to provide a new technical solution. Summary of the Invention
[0005] To solve the technical problems existing in the prior art, the present invention discloses a multi-point communication control method for a programmable controller, and the specific technical solution is as follows:
[0006] The present invention provides a multi-point communication control method for a programmable controller, including the following steps:
[0007] S1, establish a group of boolean arrays corresponding to each control object in the programmable controller;
[0008] S2, clear the values in the boolean arrays of each control object;
[0009] S3, the host computer sends a control command to the programmable controller, and the programmable controller parses the control command and extracts the specific content of the control command;
[0010] S4, after obtaining the specific content of the control command, the programmable controller assigns values to the boolean arrays of each control object, and the data with a value of true indicates that the data corresponds to the current control command;
[0011] S5. After mapping the boolean array of each control object with the actual control object data, the control object performs corresponding actions.
[0012] Further, the boolean array of the control object includes four contents: area number, device type, device number, and device attribute.
[0013] Further, in step S2, the values in the boolean array of the control object are cleared in each scan cycle.
[0014] Further, the control command includes three words, and after parsing, five contents can be extracted: area number, device type, device number, device attribute, and command value.
[0015] Further, the low byte of the first word of the control command represents the area number, the high byte of the first word represents the device type, the low byte of the second word represents the device number, the high byte of the second word represents the device attribute, and the two bytes of the third word represent the command value.
[0016] Further, the area number is used to distinguish each module or each area in the entire control system, and its range is 0 - 255;
[0017] The device type represents the types of different control objects, and its range is 0 - 255;
[0018] The device number represents the number of the control object, and its range is 0 - 255;
[0019] The device attribute represents different attribute values of the control object, and different attribute values indicate different actions to be performed by the control object, and its range is 0 - 255;
[0020] The command value represents the state or degree of each individual action performed by the control object, and its range is -32768 to 32767 or 0 to 65535.
[0021] Further, the three words of the control command respectively correspond to three points on the programmable controller.
[0022] Further, the control command word is separately transmitted to another group of data record arrays for recording for subsequent convenient query, and the control command word is cleared while recording.
[0023] The present invention has the following beneficial effects:
[0024] 1. The programmable controller multi-point communication control method provided by the present invention saves the number of registers used in the interaction process between the programmable logic controller (PLC) and the host computer control.
[0025] 2. The programmable controller multi-point communication control method provided by the present invention increases the extensibility of control commands.
[0026] 3. The programmable controller multi-point communication control method provided by the present invention increases the traceability of the control interaction process.
[0027] 4. The programmable controller multi-point communication control method provided by the present invention improves the efficiency of writing control programs.
[0028] 5. The programmable controller multi-point communication control method provided by the present invention reduces the difficulty of the interaction protocol of the host computer.
[0029] The additional aspects and advantages of the present invention will be partially given in the following description, partially become apparent from the following description, or be understood through the practice of the present invention. Brief Description of the Drawings
[0030] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0031] Figure 1 It is a schematic diagram of one point corresponding to one control object in the existing PLC.
[0032] Figure 2 It is a schematic diagram of a control command definition provided by an embodiment of the present invention.
[0033] Figure 3 It is for Figure 2 The schematic diagram after assigning values to the control commands.
[0034] Figure 4 It is another schematic diagram of a control command definition provided by an embodiment of the present invention.
[0035] Figure 5 It is for Figure 4 The schematic diagram after assigning values to the control commands. Detailed Description of the Embodiments
[0036] The following will describe in detail the embodiments of the present invention. The examples of the embodiments are shown in the drawings, where the same or similar reference numerals represent the same or similar elements or elements with the same or similar functions throughout. The embodiments described below with reference to the drawings are exemplary and are intended to explain the present invention, and should not be construed as limiting the present invention.
[0037] In the description of the present invention, it should be understood that the orientation or positional relationship indicated by the terms "upper", "lower", "top", "bottom", "inner", "outer", etc. is based on the orientation or positional relationship shown in the drawings. It is 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 therefore should not be construed as a limitation to the present invention. In the description of the present invention, "a plurality of" means two or more unless otherwise specifically defined.
[0038] In the present invention, unless otherwise clearly specified and limited, the terms "install", "connect", "couple", "fix", 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 communication inside two elements or the interaction relationship between two elements. 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.
[0039] The present invention provides a programmable controller multi-point communication control method, including the following steps:
[0040] S1, establish a set of Boolean arrays in the programmable controller corresponding to each control object;
[0041] S2, clear the values in the Boolean arrays of each control object;
[0042] S3, the host computer sends a control command to the programmable controller, and the programmable controller parses the control command and extracts the specific content of the control command;
[0043] S4, after obtaining the specific content of the control command, the programmable controller assigns values to the Boolean arrays of each control object, and the data with the value of true indicates that the data corresponds to the current control command;
[0044] S5, after mapping the Boolean arrays of each control object to the actual control object data, the control object performs corresponding actions.
[0045] The Boolean array of the control object includes four contents: area number, device type, device number, and device attribute.
[0046] In step S2, the values in the Boolean arrays of the control objects are cleared in each scan cycle.
[0047] In one embodiment, the control command includes 3 words, and after parsing, five contents can be extracted: area number, device type, device number, device attribute, and command value. The 3 words of the control command respectively correspond to 3 points on the programmable controller.
[0048] The low byte of the first word of the control command represents the area number, the high byte of the first word represents the device type, the low byte of the second word represents the device number, the high byte of the second word represents the device attribute, and the two bytes of the third word represent the command value.
[0049] The area number is used to distinguish each module or area in the entire control system, and its range is 0 - 255; the device type represents the type of different control objects, and its range is 0 - 255; the device number represents the number of the control object, and its range is 0 - 255; the device attribute represents different attribute values of the control object, and different attribute values indicate different actions to be performed by the control object, and its range is 0 - 255; the command value represents the state or degree of each individual action performed by the control object, and its range is -32768 to 32767 or 0 to 65535.
[0050] The control command word will be separately passed to another group of data record arrays for recording for subsequent convenient query, and the control command word will be cleared while recording.
[0051] Embodiment 1
[0052] Reference Figure 2 , three points are set in the PLC: D100, D101, and D102. Among them, the low byte of D100 represents the area number, the high byte of D100 represents the device type, the low byte of D101 represents the device number, the high byte of D101 represents the device attribute, and D102 represents the command value. Reference Figure 3 , for example, for frequency converter 02, an example of setting the rotation speed. If the area number is not mentioned, the default attribute value is 1. If the device type is a frequency converter, the attribute value is 2. If the device number is the number of the frequency converter, the attribute value is 2. If the device attribute is setting the rotation speed, the attribute value is 1. If the command value is not set, it is not displayed.
[0053] Embodiment 2
[0054] Region Name Region Number Value PMA 1 PMB 2 PMC 3 PMD 4 PMZ 5
[0055] Table 1
[0056] Refer to Table 1, the area number is set to 1 - 5, reference Figure 4 The device type, device number, device attribute, and command value are re - defined. Reference Figure 5 In the 5th example in : Set the Z cavity, the concentration of ozone generator No. 1 is 35. Among them, if the area number is the Z cavity, it is assigned the value of 5. If the device type is an ozone generator, it is assigned the value of 20. If the device number is ozone generator No. 1, it is assigned the value of 1. If the device attribute is the concentration of the ozone generator, it is assigned the value of 2. If the command value is the concentration of 35, it is assigned the value of 35.
[0057] The working principle of the present invention is as follows: In this application, the same set of 3 points is used for communication and interaction between the host computer and the programmable logic controller. By customizing the meaning and content of each data area address, automatic mapping is performed within a certain program framework. Since the same set of points is involved in the interaction, regardless of how many devices and control interactions of actions are added, the point addresses and quantities remain unchanged and can be traced.
[0058] In the description of this specification, the description referring to terms such as "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means 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 expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in a suitable manner in any one or more embodiments or examples. In addition, those skilled in the art can combine and combine the different embodiments or examples described in this specification.
[0059] Although the embodiments of the present invention have been shown and described above, it can be understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those of ordinary skill in the art can make changes, modifications, and variations to the above embodiments within the scope of the present invention.
Claims
1. A multi-point communication control method for a programmable controller, characterized in that It includes the following steps: S1. Establish a set of Boolean arrays in the programmable logic controller for each control object; S2. Clear the values in the Boolean arrays of each control object; S3. The host computer sends a control command to the programmable logic controller, and the programmable logic controller parses the control command and extracts the specific content of the control command; S4. After obtaining the specific content of the control command, the programmable logic controller assigns values to the Boolean arrays of each control object. The data with the value of true indicates that the data corresponds to the current control command; S5. After mapping the Boolean arrays of each control object to the actual control object data, the control object performs corresponding actions.
2. The programmable controller multi-point communication control method according to claim 1, wherein The Boolean array of the control object includes four contents: area number, device type, device number, and device attribute.
3. The programmable controller multi-point communication control method according to claim 1, characterized in that, In step S2, the values in the Boolean arrays of the control objects are cleared in each scan cycle.
4. The programmable controller multi-point communication control method according to claim 2, wherein The control command includes three words. After parsing, five contents can be extracted: area number, device type, device number, device attribute, and command value.
5. The programmable controller multi-point communication control method according to claim 4, characterized in that, The low byte of the first word of the control command represents the area number, the high byte of the first word represents the device type, the low byte of the second word represents the device number, the high byte of the second word represents the device attribute, and the two bytes of the third word represent the command value.
6. The programmable logic controller multi-point communication control method according to claim 5, wherein The area number is used to distinguish each module or each area in the entire control system, and its range is 0 - 255; The device type represents the types of different control objects, and its range is 0 - 255; The device number represents the number of the control object, and its range is 0 - 255; The device attribute represents different attribute values of the control object. Different attribute values indicate different actions to be performed by the control object, and its range is 0 - 255; The command value represents the state or degree of each individual action performed by the control object, and its range is -32768 to 32767 or 0 to 65535.
7. The programmable controller multi-point communication control method according to claim 4, characterized in that The three words of the control command respectively correspond to three points on the programmable logic controller.
8. The programmable controller multi-point communication control method according to claim 1, characterized in that, The control command word is separately transmitted to another set of data record arrays for recording for subsequent convenient query, and the control command word is cleared while recording.