Equipment modeling method, equipment-oriented programming method, equipment control method and equipment state reporting method

By adopting equipment modeling methods in the building automatic control system, establishing object models and programming, the problem of high programming complexity of PLC controllers is solved, and programming efficiency and consistency is improved, maintenance costs are reduced and system availability is improved.

CN120103774APending Publication Date: 2025-06-06CHINA NANHU ACAD OF ELECTRONICS & INFORMATION TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311646725.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-04
Publication Date
2025-06-06

Smart Images

  • Figure CN120103774A_ABST
    Figure CN120103774A_ABST
Patent Text Reader

Abstract

The invention discloses an equipment modeling, object-model-based equipment-oriented programming, equipment control and equipment state reporting method, and the equipment-oriented programming method comprises the steps: building an object model object through an object model, and endowing the object model object with personalized attributes; the object model objects are connected and an object model object network is constructed in a line connection mode to form a configuration file FileA, so that cooperative control on physical equipment is realized; generating a port configuration file FileB through a port configuration function, wherein the port configuration file FileB is used for describing a mapping relation between an actual wiring condition of physical equipment and the object model object network in S102; an equipment information configuration file FileC is generated through an equipment information input function and is used for informing the PLC of equipment information controlled by the equipment information configuration file FileC; through a configuration issuing function, a configuration file FileA, a port configuration file FileB and an equipment information configuration file FileC are uploaded to a file server, and an instruction is adopted to inform a PLC to carry out configuration updating.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of automatic control, and in particular relates to the intelligentization of building automatic control systems. Background Art

[0002] The core controllers of the building automation system include direct digital controller (DDC) and programmable logic controller (PLC). Depending on the complexity of the control system functions and its requirements for stability and reliability, PLC is used for higher requirements and DDC is used for lower requirements.

[0003] The core controller (PLC) mainly collects the working status of the terminal equipment (including various sensors and execution equipment, etc.) at high speed through digital quantity (DI), analog quantity (AI) and serial communication (RS485), and controls the terminal execution equipment according to a certain logic through digital quantity (DO), analog quantity (AO) and serial communication (RS485).

[0004] The core controller (PLC) is programmed using methods including ladder diagrams and function blocks, and programming uses register / memory values ​​as the basis and target of operations. The user directly operates the register / memory values ​​(including physical ports) through the program to operate the device's status acquisition or control the device's execution.

[0005] The programming quality of the core controller (PLC) will directly affect the system's operating capabilities, and its maintenance threshold will determine the basic ability requirements of maintenance personnel, thus affecting the system's operating capabilities.

[0006] In the field of automatic control technology, especially involving the intelligent building automation system, the use of the core controller (PLC) determines the operating quality of the system. The use of register / memory values ​​as the operation object has very high threshold requirements for programmers, high programming costs (high labor costs, long programming and debugging time), poor consistency due to differences in programming quality, and difficulty in accumulating programming experience, which makes it difficult to form expert experience or industry standards, resulting in uneven system operation results. Some operating logics cannot give full play to the inherent capabilities of the terminal equipment, and the system availability is poor. After delivery and operation and maintenance, there are high threshold requirements for operation and maintenance personnel, which will cause huge cost waste (the cost of programmers is high, and the coverage of capabilities is very narrow, resulting in very poor talent reusability), and maintenance is difficult. The equipment operation effect is not ideal and the operation and maintenance personnel cannot correct it, and the control logic is lost after a fault, etc., which leads to the system being abandoned by the operation and maintenance personnel after it is built (some systems are changed from automatic control of the system to manual control by the operation and maintenance personnel), and the application value is lost. Summary of the invention

[0007] To this end, the present invention proposes a device modeling method, which is applied to a PLC controller of a building automation system. The method comprises the following steps:

[0008] Step 11, extracting the properties and behaviors of the physical device according to the operation mechanism of the physical device, and using a series of input and output variables and an algorithm containing the input and output variables to characterize the physical model of the physical device;

[0009] Step 12, programming the physical model with computer executable code, and storing the coded physical model in a database;

[0010] Step 13, recording the properties and behaviors of the coded object model in the database;

[0011] Step 14: Generate a unique ID for each object model for use in device-oriented programming.

[0012] Furthermore, in step 11, the object model includes at least the following attributes: name, port information, icon, and category attribute.

[0013] Furthermore, the port information includes a port name, a port category, a value category, and a port index, wherein:

[0014] Port categories are divided into input ports and output ports;

[0015] The value categories are divided into digital and analog.

[0016] Furthermore, in step 11, the behavior of the object model includes: on / off; enable / stop; increase / decrease.

[0017] The present invention also provides a method for device-oriented programming of a physical model based on the device modeling method as described above, comprising the following steps:

[0018] Step 21, creating a physical model object through the physical model, and giving personalized attributes to the physical model object;

[0019] Step 22, connecting the physical model objects by wires, building a physical model object network, forming a configuration file FileA, and realizing collaborative control of the physical devices;

[0020] Step 23, generating a port configuration file FileB through a port configuration function to describe the mapping relationship between the actual wiring situation of the physical device and the object network of the object model described in S102;

[0021] Step 24, generate a device information configuration file FileC through the device information input function to inform the PLC of the device information it controls;

[0022] Step 25, through the configuration delivery function, upload the configuration file FileA, the port configuration file FileB, and the device information configuration file FileC to the file server, and use instructions to notify the PLC to update the configuration.

[0023] Furthermore, the personalized attributes of the physical model object include: physical model object name and unique ID.

[0024] Furthermore, in step 22, the configuration file FileA includes: at least one request Request, a specific request action, and request parameters.

[0025] Furthermore, only output type ports can be used as the connection start end, and only input type ports can be used as the connection end. One output port can be used as the start end of multiple input ports, and one input port can only correspond to one output port.

[0026] Furthermore, in step 24, the device information includes at least control instruction information supported by the device and a status reporting threshold.

[0027] The present invention also provides a device control and device status reporting method programmed based on the device-oriented programming method as described above, comprising the following steps:

[0028] Step 31, PLC obtains object network information of physical model by parsing configuration file FileA, and realizes automatic collaborative control of equipment;

[0029] Step 32, PLC obtains the status information of each device port configuration by parsing the device information configuration file FileB, and actively reports when the port status value reaches the threshold;

[0030] Step 33, the PLC obtains the mapping relationship between the PLC port and the physical model object pin by parsing the device port configuration file FileC, and realizes automatic control and manual control of the physical device by writing the port value of the physical model object or the received superior control instruction value to the corresponding PLC port.

[0031] The solution provided by the present invention models the terminal controlled device and implements it through hardware, communication and platform integration. Users do not need to care about the hardware underlying resources and working logic of the terminal controlled device, and can focus on applications and control strategies. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 It is a flowchart of the device modeling method of the present invention;

[0033] Figure 2 A schematic diagram of the operating mechanism of a common lamp according to an embodiment of the present invention;

[0034] Figure 3 It is a flowchart of the device-oriented programming method of the present invention;

[0035] Figure 4 It is a schematic diagram of connecting the model objects of the present invention;

[0036] Figure 5 A schematic diagram of the mapping relationship between the actual wiring situation of the physical device of the present invention and the object network of the physical model;

[0037] Figure 6 This is a flowchart of the device control and device status reporting method of the present invention. DETAILED DESCRIPTION

[0038] The following will be combined with the accompanying drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. The following description of at least one exemplary embodiment is actually only illustrative and is by no means intended to limit the present invention and its application or use.

[0039] Figure 1 The device modeling method flow of the present invention is shown. Figure 1 As shown, the device modeling method of the present invention can be applied to a PLC controller of a building automation system, and the method comprises the following steps:

[0040] Step S1, extracting the properties and behaviors of the physical device according to the operation mechanism of the physical device, and using a series of input and output variables and an algorithm containing the input and output variables to characterize the physical model of the physical device.

[0041] In addition, the object model has attributes such as name, port information, icon, category, etc. The port information should include port name, port category, value category, port index, etc. The port category is divided into input port and output port, and the value category is divided into digital quantity and analog quantity.

[0042] The behaviors of the physical model include but are not limited to: switching (such as lamps), starting and stopping (such as water pump equipment), raising / lowering the temperature (such as air conditioning equipment), etc.

[0043] Step S2, programming the physical model with computer executable code, and storing the coded physical model in a database.

[0044] Step S3: Record the properties and behaviors of the coded object model in the database.

[0045] Step S4, generating a unique ID for each object model for use in device-oriented programming.

[0046] The following takes an ordinary lamp as an example to explain the implementation of the above device modeling method:

[0047] Step S1, extract the properties (on, off) and behavior (on, off) of the physical device according to the operating mechanism of the ordinary lamp, wherein the behavior (on, off) is output by a digital quantity, i.e. DO, and the property (on, off) is input by a digital quantity, i.e. DI. By setting the value of DO (0, 1), the behavior (on, off) of the ordinary lamp can be controlled; by reading the value of DI (0, 1), the property (on, off) of the ordinary lamp can be obtained.

[0048] Step S2, realizing the operation mechanism of the common lamp model through computer executable code, generating corresponding execution files, and storing them in a database.

[0049] Figure 2 The state machine is used to describe the operation mechanism of a common lamp, such as Figure 2 As shown, three states are defined: initial state scm_nStateSTART, on state scm_nStartOn and off state scm_nStateOff. EI represents an event, and DI1_1 represents the input data corresponding to the PLC reading the event. The logic of ordinary light state transfer is as follows:

[0050] 1. When the current state is the initial state, when the event EI arrives and DI1_1=1, the state is transferred to the on state scm_nStateOn; when the event EI arrives and DI1_1=0, the state is transferred to the off state scm_nStateOff.

[0051] 2. When the current state is the open state, execute the open action and unconditionally transfer to the initial state scm_nStateSTART.

[0052] 3. When the state is off, execute the off action and transfer to the initial state scm_nStateSTART unconditionally.

[0053] The C++ implementation code is as follows:

[0054]

[0055]

[0056]

[0057] Step S3, storing the attributes and behaviors of the lamp model in a database;

[0058] Step S4, and generate unique ID (367477396326060032), name (ceiling lamp), port information, icon, category and other attributes. The port information should include port name, port category, value category, port index, etc. The port category is divided into input port and output port, and the value category is divided into digital quantity and analog quantity to complete the modeling of ordinary lamp.

[0059] Figure 3 The flow chart of the device-oriented programming method of the present invention is shown. Figure 3 As shown, the device-oriented programming method of the present invention adopts Figure 1 The coded physical model established by the device modeling method shown, the device-oriented programming method comprises the following steps:

[0060] Step S101, create a physical model object through the physical model. In addition to all the features of the physical model, the physical model object may also include the personalized attributes of the object, such as the physical model object name, unique ID, etc. Specifically, according to the ID of the physical model, call the running code of the physical model in the database and its corresponding physical model attribute usage method. Creating a physical model object specifically reads the information of the physical model from the database and displays its icon on the interface for the user to perform the next operation.

[0061] Step S102, connect the physical model objects described in step S2 by means of wires, build a physical model object network, form a configuration FileA, and realize the coordinated control of the physical device, such as Figure 4 As shown, Figure 4 The left side is the model after the PLC completes modeling, and the right side is the model after the lamp completes modeling; the model connections include: (1) device control terminal wiring, the control terminal DO1_1 of the lamp device is connected to the output terminal DO1_0 of the PLC, indicating that the PLC controls the switch of the lamp device through the DO1_0 port; (2) the status feedback terminal DI1_1 of the lamp device is connected to the input terminal DI1_0 of the PLC, indicating that the PLC determines the status of the lamp device by reading the value of the DI1_0 port.

[0062] The contents of FileA are as follows:

[0063] FileA consists of multiple requests ( <request>Tag), the Action attribute expresses the specific request action, followed by tags related to request parameters, for example:

[0064] <RequestID="1"Action="CREATE"><FBName="CFBPLC8In8Out_365982858772221952_369904406100971520"Type="CFBPLC8In8Out" / >< / request>

[0065] <RequestID="2"Action="CREATE"><FBName="CommonLed_2_369904406100971522"Type="CommonLed" / >

[0066] <RequestID="3"Action="CREATE"><ConnectionSource="CFBPLC8In8Out_365982858772221952_369904406100971520.DI1_0"Destination="CommonLed_2_369904406100971522.DI1_1" / >

[0067] The first request (ID=1) is a CREATE request, and the request content is to create a function block instance object corresponding to the PLC model; the second request (ID=2) is to create a function block instance object corresponding to the ordinary lamp model. The third request (ID=3) is to create a connection between the PLC model and the ordinary lamp model, with the starting end of the connection being the DI_0 port of the PLC and the end of the connection being the DI1_1 of the ordinary lamp. By analogy, the content of the FileA file generated by the above model object connection diagram is as follows:

[0068] <RequestID="0"Action="CREATE"><FBName="runtime369904406100971522"Type="EMB_RES" / >

[0069] runtime369904406100971522; <RequestID="1"Action="CREATE"><FBName="CFBPLC8In8Out_365982858772221952_369904406100971520"Type="CFBPLC8In8Out" / >

[0070] runtime369904406100971522; <RequestID="2"Action="CREATE"><FBName="CommonLed_2_369904406100971522"Type="CommonLed" / >

[0071] runtime369904406100971522; <RequestID="3"

[0072] Action="CREATE"><ConnectionSource="CFBPLC8In8Out_365982858772221952_369904406100971520.DI1_0"Destination="CommonLed_2_369904406100971522.DI1_1" / >

[0073] runtime369904406100971522;<RequestID="4"

[0074] Action="CREATE"><ConnectionSource="CFBPLC8In8Out_365982858772221952_369904406100971520.EO1_0"Destination="CommonLed_2_369904406100971522.EI1_1" / >

[0075] runtime369904406100971522;<RequestID="5"

[0076] Action="CREATE"><ConnectionSource="CommonLed_2_369904406100971522.DO1_1"

[0077] Destination="CFBPLC8In8Out_365982858772221952_369904406100971520.DO1_0" / >

[0078] runtime369904406100971522;<RequestID="6"

[0079] Action="CREATE"><ConnectionSource="CommonLed_2_369904406100971522.EO1_1"

[0080] Destination="CFBPLC8In8Out_365982858772221952_369904406100971520.EI1_0" / >

[0081] runtime369904406100971522;<RequestID="7"

[0082] Action="CREATE"> <ConnectionSource="START.COLD"

[0083] Destination="CFBPLC8In8Out_365982858772221952_369904406100971520.START_INIT" / >

[0084] runtime369904406100971522;<RequestID="8"Action="START" / >

[0085] Only output type ports can be used as the starting end of a connection, and only input type ports can be used as the end of a connection. One output port can be used as the starting end of multiple input ports, but one input port can only correspond to one output port.

[0086] Step S103, a port configuration file is generated through a port configuration function (configured by the project implementation personnel) to describe the mapping relationship between the actual wiring situation of the physical device and the object network of the physical model described in S102, such as Figure 5 As shown, the upper part is the configuration of the PLC for the specifications and operating frequency of the IO port, and the lower part is the configuration of the correspondence between the actual IO port of the PLC and the virtual port of the model.

[0087] Step S104, generating a device information configuration file through a device information input function (configured by the project implementation personnel) to inform the PLC of the device information it controls.

[0088] Device information should include control command information supported by the device, status reporting threshold, etc.

[0089] Step S105, through the configuration delivery function (configured by the project implementation personnel), the object model network information, port configuration file, and device information configuration file are uploaded to the file server, and the PLC and other hardware devices are informed to update the configuration.

[0090] Step S106, after receiving the configuration update message, the hardware device such as the PLC downloads the configuration file from the file server and restarts to make the new configuration take effect.

[0091] Step S107, completing device-oriented programming to implement different control strategies (generating all configuration files FileA, FileB, FileC).

[0092] Take an ordinary lamp as an example (the controller model id is 367477396326060030 and the name is 8-way PLC controller) as an example. Figure 3The following table shows the wiring instructions for the physical environment and logical environment of the device. Figure 3 The device shown in the figure, the steps of the device-oriented programming method are:

[0093] Step S101, taking out the ceiling lamp model (id: 367477396326060032) and the 8-way PLC controller model (id: 367477396326060030) from the database;

[0094] Step S102, connecting the ceiling lamp model (DI_A, DO_A) and the 8-channel PLC controller model (DI_7, DO_3) by wiring, and generating a configuration file FileA.

[0095] Step S103, according to the physical wiring situation of the ceiling lamp and the 8-way PLC controller (connect DI_A with DI_1, and connect DO_A with DO_1), configure the port wiring situation of the ceiling lamp model and the 8-way PLC controller model (that is, the physical port DI_1 corresponds to DI_7 of the model, and the physical port DO_1 corresponds to DO_3 of the model), and generate the configuration file FileB.

[0096] Step S104, using the device information input function, the switch control instruction (switch: 0, 1) of the ceiling lamp is converted into a device information configuration file FileC for use when the 8-way PLC controller is executed.

[0097] Step S105, through the configuration sending function, the files FileA, FileB and FileC generated by the programming results are uploaded to the file server FileServer, and instructions are used to notify the 8-way PLC controller and other hardware devices to update the configuration.

[0098] Step S106, after receiving the configuration update message, the 8-way PLC controller downloads the configuration files FileA, FileB and FileC from the file server FileServer, and restarts to make the new configuration take effect.

[0099] Step S107, completing device-oriented programming to implement different control strategies.

[0100] Figure 6 The device control and device status reporting method of the present invention is shown in FIG. Figure 6 As shown, the device control and device status reporting method of the present invention comprises the following steps:

[0101] In step S201, the PLC obtains the object network information of the physical model by parsing the configuration file FileA to realize automatic collaborative control of the equipment (the physical model already contains the code of its operating mechanism, equipment operating status query instructions and equipment control instructions; when the PLC receives the corresponding query instruction, it reads the corresponding value from the stored equipment status instruction table and reports it; when the PLC receives the corresponding control instruction, it executes the code corresponding to the instruction).

[0102] Step S202, the PLC obtains the status information of each device port configuration by parsing the device information configuration file, and actively reports when the port status value reaches a threshold.

[0103] In step S203, the PLC parses the device port configuration file to obtain the mapping relationship between the PLC port and the physical model object pin, and writes the port value of the physical model object or the received superior control instruction value to the corresponding PLC port to realize automatic control and manual control of the physical device.

[0104] Step S204, completing device control and device status reporting.

[0105] Example: Still taking the ceiling lamp as an example,

[0106] In step S201, the 8-way PLC controller implements automatic coordinated control of the ceiling lamps by parsing FileA.

[0107] In step S202, the 8-channel PLC controller obtains the status information of the physical port DI_1 of the ceiling lamp by parsing FileB, and actively reports the status of the port to the upper application when the status of the port changes.

[0108] In step S203, the 8-way PLC controller parses FileC to obtain the mapping relationship between the 8-way PLC controller ports (DI_1, DO_1) and the model object pins (DI_7, DO_3), and writes the port (DO_3) value of the physical model object or the received superior control instruction value to the corresponding 8-way PLC controller port (DO_1) to achieve automatic control and manual control of the physical device.

[0109] Step S204, completing device control and device status reporting.

[0110] The above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the specific implementation methods of the present invention can still be modified or some technical features can be replaced by equivalents without departing from the spirit of the technical solution of the present invention, which should be included in the scope of the technical solution for protection of the present invention.

Claims

1. A device modeling method for PLC controllers in building automation systems. It is characterized in that The method comprises the following steps: Step 11, extracting the properties and behaviors of the physical device according to the operation mechanism of the physical device, and using a series of input and output variables and an algorithm containing the input and output variables to characterize the physical model of the physical device; Step 12, programming the physical model with computer executable code, and storing the coded physical model in a database; Step 13, recording the properties and behaviors of the coded object model in the database; Step 14: Generate a unique ID for each object model for use in device-oriented programming.

2. The device modeling method according to claim 1, It is characterized in that In step 11, the object model includes at least the following attributes: name, port information, icon and category attributes.

3. The device modeling method according to claim 2, It is characterized in that The port information includes the port name, port category, value category and port index, among which: Port categories include input ports and output ports; The value categories include digital and analog.

4. The device modeling method according to claim 1, It is characterized in that In step 11, the behaviors of the object model include: on / off, enable / stop, and increase / decrease.

5. A method for device-oriented programming based on a physical model constructed by the device modeling method according to any one of claims 1 to 4, It is characterized in that The method comprises the following steps: Step 21, creating multiple physical model objects through the physical model, and giving personalized attributes to the physical model objects; Step 22, connecting the created multiple physical model objects by means of wires, constructing a physical model object network, forming a configuration file FileA, and realizing collaborative control of physical devices; Step 23, generating a port configuration file FileB through a port configuration function to describe the mapping relationship between the actual wiring situation of the physical device and the object network of the object model described in S102; Step 24, generating a device information configuration file FileC through the device information input function to inform the PLC controller of the device information it controls; Step 25, through the configuration delivery function, upload the configuration file FileA, the port configuration file FileB, and the device information configuration file FileC to the file server, and use instructions to notify the PLC controller to update the configuration.

6. The device-oriented programming method according to claim 5, It is characterized in that The personalized attributes of the object model include: the object model name and the unique ID of the object model.

7. The device-oriented programming method according to claim 5, It is characterized in that In step 22, the configuration file FileA includes: at least one request Request, a specific request action and request parameters.

8. The device-oriented programming method according to claim 7, It is characterized in that Only output type ports can be used as the starting end of a connection, and only input type ports can be used as the end of a connection. One output port can be used as the starting end of multiple input ports, and one input port can only correspond to one output port.

9. The device-oriented programming method according to claim 5, It is characterized in that In step 24, the device information includes at least control instruction information supported by the device and a status reporting threshold.

10. A device control and device status reporting method programmed by the device-oriented programming method according to any one of claims 5 to 9, It is characterized in that The method comprises the following steps: Step 31, the PLC controller obtains the object network information of the physical model by parsing the configuration file FileA, and realizes automatic collaborative control of the equipment; Step 32, the PLC controller obtains the status information of each device port configuration by parsing the device information configuration file FileB, and actively reports when the port status value reaches the threshold; Step 33, the PLC controller parses the device port configuration file FileC to obtain the mapping relationship between the PLC controller port and the physical model object pin, and writes the port value of the physical model object or the received superior control instruction value to the corresponding PLC controller port to realize automatic control and manual control of the physical device.