Share this

Intelligent meter software system based on software component technology

2026-04-06 05:42:59 · · #1
Abstract: The software system of field intelligent instruments is developed directly on bare metal without any supporting software, which increases the difficulty of software development and makes it extremely difficult to ensure the software's continuity and maintainability. This paper proposes the application of software functional components in field intelligent instruments based on software component technology, and details the development basis of the software system functional modules, module configuration technology, and how to exchange data with the real-time database in the field intelligent instrument. This effectively solves the problems mentioned above. Keywords : Software component module; Field intelligent instrument; Software system LU Tan, QIAO Yi, YUAN Yun-fei (Dalian Jiaotong University, Dalian 116028, China) This paper proposes a software function component based on software component technology in the CAN main line for scene intelligent measuring appliances. It introduces in detail the software system's function module development foundation, module configuration technology, and how it works with scene intelligent measuring appliances through a solid database for data exchange, providing a very good solution to the aforementioned problems. Keywords : software module; field intelligent instrument; software system 0 Introduction The inheritance and maintainability of software systems for field intelligent instruments, like other large and complex software, are objectively existing and urgently needed. Firstly, with the continuous improvement of user demands and technological advancements, software needs to be gradually improved and updated to maintain strong market competitiveness; secondly, software systems in a series of products share many similarities and commonalities. Good inheritance and maintainability of the software system can well adapt to the development of a series of products. The software module is a software component with object concepts, encapsulation forms, and information hiding functions; it has excellent maintainability and a certain degree of inheritance. The configuration sequence reflects the interaction between modules and has the essential characteristics of a message sequence. This method of "component modules plus configuration sequences to form software solutions" is largely similar to object-oriented, component-based programming methods, thus possessing good inheritance and maintainability. 1. Real-time Multitasking Operating System The real-time multitasking operating system consists of system execution, ready, and sleep states. It features preemptive priority task scheduling, microcontroller on-chip resource management, interrupt management, and clock management. It includes primitives such as time slice creation, semaphore P operations, and semaphore V operations. Data transmission is achieved through the data sharing function of a real-time database. The real-time multitasking operating system implements hardware resource management, hardware detail information hiding, and task-level support for application software systems. It also ensures parallel design, parallel debugging, and parallel operation of the software system, enabling each task to fully utilize all microcontroller resources and automatically complete coordination and management functions during design, debugging, and operation. 2. Task Allocation and Management The software system has four task-level subsystems, and the overall structure is shown in Figure 1. 3. Configuration Principles, Configuration Sequences, and Configuration Sequence Decoding Programs Configuration software is based on a functional module library and configuration sequences, satisfying diverse automation industry needs and various application requirements. A configuration sequence is the set of functions the application software needs to complete in each specific processing cycle and the message passing sequence between modules. It also represents the selection of functions and their sequential execution. The core of configuration software is the configuration sequence and the real-time database. When a functional module responds to a configuration sequence call to serve an application task, it first calls the module from the functional module library, then retrieves data from the real-time database according to the data interface defined by the module, completes the corresponding operations and calculations within the module, and then sends the results back to the real-time database according to the defined data interface. (See Figure 2). The decoding programs for functional modules are distributed across two tasks managed by the real-time multitasking operating system. The two tasks have identical structures. These two tasks have identical structures. The configuration data for each functional module consists of 16 single-byte parameters. The first parameter is the module function number, which is the status word for calling the corresponding functional module's operation process. The second to sixteenth parameters are: input data (from the real-time database) address pointer (occupying two parameters: the group number and the sequence number within the group), single-byte unsigned constants, output data (sent to the real-time database) address pointer, and address pointers for the module's private data (or data table). The meaning of these 15 single-byte parameters is not uniformly defined and is determined by the corresponding functional module. See Figure 3 for the configuration sequence interpretation flowchart . 4. Component Modules and Encapsulation Component modules consist of service function numbers, input data address pointers, input constants (constant table), and output data address pointers. Each component module has 16 single-byte parameters. The first parameter is the service function number (0# indicates the end of the configuration sequence), and the second to sixteenth parameters are input data address pointers, input constants, and output data address pointers. An address pointer (excluding bit switch addresses) consists of two parameters: the first parameter represents the row number (group number) of the data in the database arrangement, and the second parameter represents the column number (sequence number within the group). An input constant or bit switch address uses only one parameter; the input constant can only be a single-byte unsigned integer. A component module may have no defined parameters other than its service function number. Such component modules are often closely related to the system or are special component modules of some dedicated systems. In the configuration software, each module has three interfaces: interface 1 is used to set the module's default parameter values; interface 2 is used to set the initial values ​​of the working parameters at startup; only interface 3 is the entry point for implementing the functional module. In each processing cycle, interface 3 must implement all defined functions. 5 Real-time Database The database consists of data groups with 16 data items per row. A specific data item in the database can be uniquely identified by the row number and column number pointing to that data. The data pair formed by the row number and column number is the address pointer of the data in the database. Data elements in the database can be floating-point numbers, double-byte integers, byte switches, and bit switches. Once the configuration sequence is formed, the properties of the data elements in the database are determined. However, the data content can change at any time. The combination of system data, component module-specific data, and data registers forms the rich content of the database. System data consists of data units used to support the software, including A/D, D/A, digital I/O, and digital display pointers. Component module-specific data are the private data members of component module objects. When a component module appears in the configuration sequence, its private data works together to complete the corresponding function; when the component module does not appear in the configuration sequence, these private data members are undefined and can be used as general data registers. Data registers are specifically designed to serve component module configuration; unused data registers are undefined. When using data registers, it is important to ensure that the properties of the data used by the module match the properties of the data register (e.g., floating-point numbers cannot be placed in integer or byte switch registers). Additionally, the byte length of the data register should be considered to avoid conflicts between excessively long data and other data. [b]6 Configuration Software Engineering Implementation 6.1 Real-time Performance[/b] The configuration function of the software can be summarized into two main parts: operation and calculation of switch quantities and analog quantities, which includes the contents of conventional PLC and loop regulator. However, in practical applications, the real-time performance requirements of these two parts are not exactly the same. If they are processed in the same cycle, the speed will be too fast, which will limit the amount of work completed, while the speed will be too slow, which will impair the performance of switch quantity processing. Therefore, the configuration software separates these two parts into different tasks to solve this contradiction. However, if the configuration sequence is also separated, it will bring inconvenience to the configuration process and the editing and downloading of the configuration sequence. For this reason, the configuration software has specially designed the function module Fun2 to set the dividing point between task 1 and task 2. The module queue before Fun2 runs in task 1 with a processing cycle of 20 ms and the highest priority; the module queue after Fun2 runs in task 2 with a processing cycle of 100 ms and the highest priority. 6.2 Configuration Sequence Editing The configuration sequence is managed by the configuration database. The configuration database contains 1600 single-byte parameters, designed as 100 rows × 16 columns, with each row representing the configuration of one module. The configuration database can accommodate a maximum of 100 modules. Local configuration is performed directly on the field instrument's operating keyboard. The configuration software has a dedicated password for accessing the configuration database. When the configuration password is entered to enter the configuration database editing state, the operating keyboard is redefined as the configuration database editing key, enabling its editing function. Editing the configuration database involves reconstructing the control and calculation functions of the field instruments and reallocating the register units. To ensure safe operation of the system during online configuration, the configuration software employs the following protection measures when the data in the configuration database changes: freezing the magnitude of analog output values ​​and the output status of digital signals; automatically resetting upon exiting the configuration database editing state, restarting the software system, and resetting the default values ​​of the modules used in the configuration queue. 6.3 Configuration Operating Parameters Some complex functional modules (such as PID control, automatic tuning, etc.) have many attributes, methods, and events similar to the concept of "objects," which can be expressed as parameter values ​​and switch states. Since the configuration data of a functional module only contains 16 single-byte parameters, it is impossible to set all parameter address pointers for the functional module. Therefore, in the real-time database of this configuration software, many units are specifically designed to serve certain functional modules. When these functional modules appear in the configuration queue, these specific data items are defined, reflecting the module's attributes, methods, and events. When these functional modules do not appear in the configuration queue, these specific data items lose their definition (but can be used as general-purpose register units for other modules, and the meaning of the data items changes with the redefinition of the using module). 6.4 Method for Downloading to Intelligent Instruments The software system uses the self-developed configuration module download and debugging software MDCSCFG for downloading and online debugging of configuration modules. Through the CAN bus, it can configure, edit parameters, download, upload, manage, and monitor and debug each MDCS component on the fieldbus control system in real time. The main functions of MDCS-CFG include: (1) configuring 82 component modules in 14 categories of the component module library, with a maximum configuration sequence length of up to 250 lines; (2) setting, modifying, managing, and monitoring 1,600 control operation parameters in 100 groups of the real-time database; (3) downloading/uploading all or part of the configuration data at once; (4) downloading/uploading all or part of the real-time database parameters at once; (5) monitoring the changes of up to 16 control operation parameters in real time; (6) managing multiple projects or subsystems consisting of 8 serial ports, 14 MDCS categories, and 256 MDCS; (7) constructing automatic testing systems, automatic calibration systems, and debugging support systems; (8) automatically detecting fault states during transmission and attempting multiple transmissions according to the set number of retransmissions. 7 Conclusion The application of software component technology has effectively solved the difficulties in the development of field intelligent instrument software, such as excessive development difficulty, poor software inheritance, and difficulty in maintenance. This provides a convenient and effective method for those engaged in the development of field intelligent instrument software, reducing the workload of software developers. References: [1] Yang Xianhui. Fieldbus technology and its application. Beijing: Tsinghua University Press, 1999. [2] Liu Shuanggang. Automatic control of intermittent production process. Mechanical and Electrical Engineering. 2000, 17(3): 94-96. [3] Yuan Aijin. Research on software integration technology of field intelligent measurement and control instrument. Journal of Instrumentation, 2001(3): 269-276. [4] Yuan Aijin. MDC-2001 micro distributed control system manual. Dalian Jiaotong University Sanhe Instrument Company, 2001. [5] Li Zheng. Application of OPC technology and configuration software in remote monitoring and maintenance. Instrumentation Technology and Sensors. 2006(5): 24-26. [6] SHCAN2000 distributed control system intelligent measurement and control component system configuration user manual. Dalian Sanhe Instrument Development Company, 2000. [7] SHCAN2000 Distributed Control System System Setup and Download Debugging Program User Manual. Dalian Sanhe Instrument Development Co., Ltd., 2000.
Read next

CATDOLL 128CM Nanako Silicone Doll

Height: 128 Silicone Weight: 21kg Shoulder Width: 30cm Bust/Waist/Hip: 57/52/63cm Oral Depth: N/A Vaginal Depth: 3-15cm...

Articles 2026-02-22