CN109085424B - Intelligent meter display parameter reading and writing method - Google Patents
Intelligent meter display parameter reading and writing method Download PDFInfo
- Publication number
- CN109085424B CN109085424B CN201810692847.9A CN201810692847A CN109085424B CN 109085424 B CN109085424 B CN 109085424B CN 201810692847 A CN201810692847 A CN 201810692847A CN 109085424 B CN109085424 B CN 109085424B
- Authority
- CN
- China
- Prior art keywords
- read
- write
- parameter
- class
- upper computer
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01R—MEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
- G01R22/00—Arrangements for measuring time integral of electric power or current, e.g. electricity meters
Landscapes
- Engineering & Computer Science (AREA)
- Power Engineering (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Digital Computer Display Output (AREA)
- Controls And Circuits For Display Device (AREA)
Abstract
A smart meter display parameter reading and writing method is characterized in that: it comprises the following steps: (1) waiting for the upper computer to send a display parameter read/write data frame, if the electric meter MCU receives the display parameter read/write data frame, entering the next step, otherwise, continuing waiting; (2) calling a read-write function class for executing the corresponding class name by the electric meter MCU according to the class name in the display parameter read/write data frame sent by the upper computer, inquiring a preset table in the electric meter MCU by the read-write function class through a table look-up method to obtain a corresponding parameter read-write function pointer and a corresponding parameter operation address, and executing a corresponding parameter read-write function according to the corresponding parameter read-write function pointer. The intelligent meter display parameter reading and writing method is simple in algorithm, high in efficiency and convenient for display function expansion.
Description
Technical Field
The invention relates to the technical field of intelligent electric meters, in particular to a method for reading and writing display parameters of an intelligent meter.
Background
The intelligent meter display module is used for displaying in real time according to display items and parameters set by a client through an upper computer and various states of the electric meter, and obtaining various current data and states of the electric meter according to the most intuitive data and information of the client.
With the gradual improvement of the power grid construction, the functions of the intelligent meter are more and more, and the display content of the intelligent meter is more and more complex. However, the current method for reading and writing the display parameters of the smart meter is not simple enough, the read-write function of the corresponding display parameters can be entered through a complex algorithm, the efficiency is low, and when the display function needs to be expanded, the algorithm needs to be redesigned, which is not convenient for the expansion of the display function.
Disclosure of Invention
The technical problem to be solved by the invention is as follows: the intelligent meter display parameter reading and writing method is simple in algorithm, high in efficiency and convenient for display function expansion.
The technical solution of the invention is as follows: a smart meter display parameter reading and writing method is characterized in that: it comprises the following steps:
(1) waiting for the upper computer to send a display parameter read/write data frame, if the electric meter MCU receives the display parameter read/write data frame, entering the next step, otherwise, continuing waiting;
(2) calling a read-write function class for executing the corresponding class name by the electric meter MCU according to the class name in the display parameter read/write data frame sent by the upper computer, inquiring a preset table in the electric meter MCU by the read-write function class through a table look-up method to obtain a corresponding parameter read-write function pointer and a corresponding parameter operation address, and executing a corresponding parameter read-write function according to the corresponding parameter read-write function pointer.
The reading and writing functions of the corresponding parameters in the method for reading and writing the display parameters of the intelligent meter are entered by acquiring the pointers of the reading and writing functions of the corresponding parameters through a table look-up method, a complex algorithm is not needed, the efficiency is high, the table look-up method is adopted, the display function can be expanded only by correspondingly modifying and increasing the table contents, and the expansion is very convenient.
Preferably, the table in step (2) includes at least one class, and at least one object identifier, and a parameter read-write function pointer and a parameter operation address corresponding to each object identifier are provided under each class; the display parameter reading data frame sent by the upper computer in the step (1) comprises a class, an object identifier, an attribute under the object identifier and a reading identifier; the display parameter write data frame sent by the upper computer in the step (1) comprises a class, an object identifier, an attribute under the object identifier, a write identifier and pre-write data; the reading-writing function class in the step (2) acquires the corresponding parameter reading-writing function pointer and the corresponding parameter operation address through a table look-up method, and the parameter reading-writing function pointer and the corresponding parameter operation address corresponding to the class and the object identifier are searched in a table according to the class and the object identifier sent by the upper computer; the execution of the read-write function of the corresponding parameters in the step (2) comprises the following steps: the corresponding parameter read-write function judges whether the read operation or the write operation is carried out according to the read/write identification in the read/write data frame, if the read operation is carried out, a read program part in the corresponding parameter read-write function is entered, and a related program is executed according to the attribute so as to obtain the display parameter corresponding to the attribute from the corresponding parameter operation address and store the display parameter in the data cache; and if the attribute is write operation, entering a write program part in the corresponding parameter read-write function, and executing a relevant program according to the attribute so as to write the pre-written data sent by the upper computer into a corresponding parameter operation address of the display parameter corresponding to the attribute. The method comprises the steps of finding a corresponding parameter read-write function pointer in a table through a class and object identifier sent by an upper computer, so as to quickly enter a corresponding parameter read-write function, then executing a part of programs related to the attribute in the corresponding parameter read-write function by utilizing the read/write identifier and the attribute sent by the upper computer, and acquiring a parameter operation address of the read operation or the write operation from the table through a table look-up method, so that the corresponding parameter read-write function can be quickly entered through the table look-up method, and the part of programs related to the attribute in the corresponding parameter read-write function can be quickly positioned and executed according to the attribute and the parameter operation address given by the upper computer and the table in the corresponding parameter read-write function, so that the execution efficiency is very high.
Preferably, in the step (2), when the write-in operation is executed, the electric meter MCU reads back the data written in the corresponding parameter operation address and judges whether the data type and the length are correct, if the data type and the length are correct, the electric meter MCU returns a write-in operation success to the upper computer, and if not, the electric meter MCU returns a write-in operation failure to the upper computer. The setting can check whether the writing result is correct or not, and the writing result is returned to the upper computer by the electric meter MCU.
Description of the drawings:
FIG. 1 is a table diagram of a method for reading and writing display parameters of an intelligent meter according to the present invention;
Detailed Description
The invention is further described with reference to the following embodiments in conjunction with the accompanying drawings.
Example (b):
a method for reading and writing display parameters of an intelligent meter comprises the following steps:
(1) waiting for the upper computer to send a display parameter read/write data frame, if the electric meter MCU receives the display parameter read/write data frame, entering the next step, otherwise, continuing waiting;
(2) calling a read-write function class for executing the corresponding class name by the electric meter MCU according to the class name in the display parameter read/write data frame sent by the upper computer, inquiring a preset table in the electric meter MCU by the read-write function class through a table look-up method to obtain a corresponding parameter read-write function pointer and a corresponding parameter operation address, and executing a corresponding parameter read-write function according to the corresponding parameter read-write function pointer.
The reading and writing functions of the corresponding parameters in the method for reading and writing the display parameters of the intelligent meter are entered by acquiring the pointers of the reading and writing functions of the corresponding parameters through a table look-up method, a complex algorithm is not needed, the efficiency is high, the table look-up method is adopted, the display function can be expanded only by correspondingly modifying and increasing the table contents, and the expansion is very convenient.
Preferably, the table in step (2) includes at least one class, and at least one object identifier, and a parameter read-write function pointer and a parameter operation address corresponding to each object identifier are provided under each class; the display parameter reading data frame sent by the upper computer in the step (1) comprises a class, an object identifier, an attribute under the object identifier and a reading identifier; the display parameter write data frame sent by the upper computer in the step (1) comprises a class, an object identifier, an attribute under the object identifier, a write identifier and pre-write data; the reading-writing function class in the step (2) acquires the corresponding parameter reading-writing function pointer and the corresponding parameter operation address through a table look-up method, and the parameter reading-writing function pointer and the corresponding parameter operation address corresponding to the class and the object identifier are searched in a table according to the class and the object identifier sent by the upper computer; the execution of the read-write function of the corresponding parameters in the step (2) comprises the following steps: the corresponding parameter read-write function judges whether the read operation or the write operation is carried out according to the read/write identification in the read/write data frame, if the read operation is carried out, a read program part in the corresponding parameter read-write function is entered, and a related program is executed according to the attribute so as to obtain the display parameter corresponding to the attribute from the corresponding parameter operation address and store the display parameter in the data cache; and if the attribute is write operation, entering a write program part in the corresponding parameter read-write function, and executing a relevant program according to the attribute so as to write the pre-written data sent by the upper computer into a corresponding parameter operation address of the display parameter corresponding to the attribute. The method comprises the steps of finding a corresponding parameter read-write function pointer in a table through a class and object identifier sent by an upper computer, so as to quickly enter a corresponding parameter read-write function, then executing a part of programs related to the attribute in the corresponding parameter read-write function by utilizing the read/write identifier and the attribute sent by the upper computer, and acquiring a parameter operation address of the read operation or the write operation from the table through a table look-up method, so that the corresponding parameter read-write function can be quickly entered through the table look-up method, and the part of programs related to the attribute in the corresponding parameter read-write function can be quickly positioned and executed according to the attribute and the parameter operation address given by the upper computer and the table in the corresponding parameter read-write function, so that the execution efficiency is very high.
Preferably, in the step (2), when the write-in operation is executed, the electric meter MCU reads back the data written in the corresponding parameter operation address and judges whether the data type and the length are correct, if the data type and the length are correct, the electric meter MCU returns a write-in operation success to the upper computer, and if not, the electric meter MCU returns a write-in operation failure to the upper computer. The setting can check whether the writing result is correct or not, and the writing result is returned to the upper computer by the electric meter MCU.
As shown in fig. 1, in this embodiment, it is assumed that the table includes three classes, i.e., class 1, class 3, and class 7, where class 1 represents a display format read-write function class, class 3 represents a display time read-write function class, and class 7 represents a display item number read-write function class; the display format read-write function class comprises, for example, decimal digits, integer digits, leading zeros and the like of display; the display time read-write function class includes, for example, display time in a wheel display mode, display time in a key display mode, display time in a test mode, and the like; the display item number read-write function class comprises the number of parameter items displayed on each screen; the display parameters are reasonably classified, so that the writing of the table can be facilitated; additionally, object identification, i.e., OBIS code; taking a display time read-write function class as an example, the display time read-write function class corresponds to class 3, an object identifier corresponding to display time in a display-in-turn mode is 0-0:94.71.2.255, a parameter operation address corresponding to the object identifier is assumed to be 0X0040, 4 attributes are assumed to be under the object identifier, an attribute 1 corresponds to a logic name, an attribute 2 corresponds to a numerical value, an attribute 3 corresponds to a unit, and an attribute 4 corresponds to a dimension, as long as an upper computer sends a read/write data frame comprising the class name of 3 and the object identifier of 0-0:94.71.2.255, a corresponding parameter read-write function pointer corresponding to display time in the display-in-turn mode can be found in a table, so that the corresponding parameter read-write function pointer enters a corresponding parameter read-write function, and the upper computer sends a read identifier and the attribute of 3, a read program part in the corresponding parameter read-write function is entered, and a program part related to the attribute 3 in the read program part is executed, to read the unit of the display parameter from the parameter operation address 0X 0040.
Claims (2)
1. A smart meter display parameter reading and writing method is characterized in that: it comprises the following steps:
(1) waiting for the upper computer to send a display parameter read/write data frame, if the electric meter MCU receives the display parameter read/write data frame, entering the next step, otherwise, continuing waiting;
(2) calling a read-write function class for executing a corresponding class name by the electric meter MCU according to the class name in the display parameter read/write data frame sent by the upper computer, inquiring a preset table in the electric meter MCU by the read-write function class through a table look-up method to obtain a corresponding parameter read-write function pointer and a corresponding parameter operation address, and executing a corresponding parameter read-write function according to the corresponding parameter read-write function pointer;
the table in the step (2) comprises at least one class, and at least one object identifier, a parameter read-write function pointer and a parameter operation address corresponding to each object identifier are arranged under each class;
the display parameter reading data frame sent by the upper computer in the step (1) comprises a class, an object identifier, an attribute under the object identifier and a reading identifier; the display parameter write data frame sent by the upper computer in the step (1) comprises a class, an object identifier, an attribute under the object identifier, a write identifier and pre-write data;
the reading-writing function class in the step (2) acquires the corresponding parameter reading-writing function pointer and the corresponding parameter operation address through a table look-up method, and the parameter reading-writing function pointer and the corresponding parameter operation address corresponding to the class and the object identifier are searched in a table according to the class and the object identifier sent by the upper computer;
the execution of the read-write function of the corresponding parameters in the step (2) comprises the following steps: the corresponding parameter read-write function judges whether the read operation or the write operation is carried out according to the read/write identification in the read/write data frame, if the read operation is carried out, a read program part in the corresponding parameter read-write function is entered, and a related program is executed according to the attribute so as to obtain the display parameter corresponding to the attribute from the corresponding parameter operation address and store the display parameter in the data cache; and if the attribute is write operation, entering a write program part in the corresponding parameter read-write function, and executing a relevant program according to the attribute so as to write the pre-written data sent by the upper computer into a corresponding parameter operation address of the display parameter corresponding to the attribute.
2. The method according to claim 1, wherein the method comprises the following steps: and (2) when the writing operation is executed, the electric meter MCU reads back the data written into the corresponding parameter operation address and judges whether the data type and the length are correct, if so, the electric meter MCU returns the success of the writing operation to the upper computer, and if not, the electric meter MCU returns the failure of the writing operation to the upper computer.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810692847.9A CN109085424B (en) | 2018-06-29 | 2018-06-29 | Intelligent meter display parameter reading and writing method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810692847.9A CN109085424B (en) | 2018-06-29 | 2018-06-29 | Intelligent meter display parameter reading and writing method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109085424A CN109085424A (en) | 2018-12-25 |
CN109085424B true CN109085424B (en) | 2021-03-09 |
Family
ID=64834830
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810692847.9A Active CN109085424B (en) | 2018-06-29 | 2018-06-29 | Intelligent meter display parameter reading and writing method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109085424B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114238232B (en) * | 2021-12-15 | 2024-04-02 | 南方电网电力科技股份有限公司 | Intelligent ammeter file reading and writing system, method, equipment and medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101424941A (en) * | 2007-10-31 | 2009-05-06 | 北京北方微电子基地设备工艺研究中心有限责任公司 | Control implementing method and system |
CN104574901A (en) * | 2014-12-17 | 2015-04-29 | 深圳市银河表计股份有限公司 | Meter reading method and meter reading system for electric meter |
CN105204779A (en) * | 2015-09-14 | 2015-12-30 | 北京鲸鲨软件科技有限公司 | Double-control-based SCSI (Small Computer System Interface) TARGET access control method and device |
CN105374124A (en) * | 2014-08-26 | 2016-03-02 | 上海裕沛电子科技有限公司 | Electronic prepayment ammeter system |
CN206075418U (en) * | 2016-08-31 | 2017-04-05 | 王开全 | A kind of flow association association control electric energy meter |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8341614B2 (en) * | 2008-06-06 | 2012-12-25 | Apple Inc. | Memory management for closures |
-
2018
- 2018-06-29 CN CN201810692847.9A patent/CN109085424B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101424941A (en) * | 2007-10-31 | 2009-05-06 | 北京北方微电子基地设备工艺研究中心有限责任公司 | Control implementing method and system |
CN105374124A (en) * | 2014-08-26 | 2016-03-02 | 上海裕沛电子科技有限公司 | Electronic prepayment ammeter system |
CN104574901A (en) * | 2014-12-17 | 2015-04-29 | 深圳市银河表计股份有限公司 | Meter reading method and meter reading system for electric meter |
CN105204779A (en) * | 2015-09-14 | 2015-12-30 | 北京鲸鲨软件科技有限公司 | Double-control-based SCSI (Small Computer System Interface) TARGET access control method and device |
CN206075418U (en) * | 2016-08-31 | 2017-04-05 | 王开全 | A kind of flow association association control electric energy meter |
Also Published As
Publication number | Publication date |
---|---|
CN109085424A (en) | 2018-12-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107391744B (en) | Data storage method, data reading method, data storage device, data reading device and equipment | |
CN108388598B (en) | Electronic device, data storage method, and storage medium | |
US8938720B2 (en) | Trace visualization for object oriented programs | |
CN101996131A (en) | Automatic test method and automatic test platform for graphic user interface (GUI) based on x extensive makeup language (XML) packaging key word | |
CN108280119A (en) | Page generation method, device and user terminal | |
CN108241720B (en) | Data processing method, device and computer readable storage medium | |
CN109085424B (en) | Intelligent meter display parameter reading and writing method | |
CN113032275A (en) | Method and device for testing field, electronic equipment and storage medium | |
US20240037084A1 (en) | Method and apparatus for storing data | |
CN104375814A (en) | Generation method and device of an interface document | |
CN114185874A (en) | Big data based modeling method and device, development framework and equipment | |
US20190220549A1 (en) | Analysis model preparing system, programming apparatus, and analysis model preparing method | |
CN113687825A (en) | Software module construction method, device, equipment and storage medium | |
CN113687827A (en) | Data list generation method, device and equipment based on widget and storage medium | |
US10241899B2 (en) | Test input information search device and method | |
CN102866985B (en) | For data formatter and the method for on-line analysing processing system | |
CN111881660A (en) | Report generation method and device, computer equipment and storage medium | |
CN105824684B (en) | A kind of implementation method of multi-mode big data software simulator | |
CN111159991A (en) | Report modeling design device and method | |
CN115758002A (en) | Method, device, equipment and program product for displaying electronic map POI | |
CN114385155A (en) | vue project visualization tool generation method, device, equipment and storage medium | |
CN111580791A (en) | Method and device for generating window | |
CN111309623A (en) | Coordinate data classification test method and device | |
US9471569B1 (en) | Integrating information sources to create context-specific documents | |
CN109857991A (en) | Date storage method, device and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |