Development of MACSV DCS Translation Simulation Software

Development of MACSVDCS Translation Simulation Software 1 Virtual DCS

The virtual DCS will directly input the configuration data of the DCS to the simulator or convert to the format that the simulator can recognize, so that it can simulate the calculation function of the DCS distributed processing unit (DPU).

The translation-type simulator realizes the automatic conversion from the DCS to the simulation platform through programming, which makes the simulator separate from the software and hardware system of the DCS, and reproduces the logic and screen configuration of the DCS in a general-purpose computer environment, including logic configuration and operation screen conversion.

2 Logic Configuration Conversion The DCOSE simulation support platform adopts Microsoft Visio as the modeling platform. Therefore, the conversion process mainly transplants the logical configuration of DCS to Visio and generates the corresponding virtual DPU. The conversion is divided into four parts: the arranging of functional block molds, the implementation of control algorithms, the translation of configuration files, and the loading and running of virtual DPUs.

2.1 Arrangement of function block mold Usually, the logic configuration of DCS is to control the algorithm module as the minimum configuration unit. In order to reproduce the control logic basically consistent with the DCS configuration on Visio, the adopted module must be exactly the same as the DCS module. External features, including port name, quantity, default values ​​for each parameter, etc. According to the description of the basic algorithm module, the fixed format algorithm resource XLML file (Figure 1) is organized and generated, and converted to the Visio mold by the DCOSE module conversion tool. This file defines the name, type, default value, etc. of each module port and coefficient, and provides the binding information of the port and the simulation platform data type for use in the control algorithm.
2.2 The realization of control algorithm The implementation of control algorithm mainly through the study of the functional block description document, according to the generated XML file, use MicrosoftVisualC++ to write the corresponding code, to achieve the function of each function block, and compile and generate the algorithm dynamic link library DLL file for Simulation platform call.

2.3 Configuration File Translation MACS VDCS is configured using the CoDeSys environment and exported from the DPU through the configuration environment as an EXP file in an independent text format. The interpreter takes the EXP text file as the data source, and reads the name, type, location, calling sequence of each function block, the connection relation of the input output, the default value of the coefficient, etc., and classifies the read information and automatically classifies it through the Visio SDK. The corresponding Visio file is generated to form a logical relationship that is completely consistent with the logical configuration of the DCS. In this process, according to the tag name given in the source file, the data points required by all modules are added to the DCOSE database as the data source for simulating and running the real-time database.

MACSVDCS allows a combination of modules (connecting several modules into groups) to form more complex custom algorithm modules, ie macro modules. For the macro processing, in the past, by understanding the internal logic operation mechanism of the macro, a manual method was used to construct the corresponding basic module to implement the algorithm. In this way once the logic inside the macro changes, the corresponding module must be repackaged and the algorithm updated.

In the translation program, the automatic conversion of the macro module is realized, ie, all the internal modules of the macro module are uniformly instantiated in the translation process according to the information of the macro module instance in the source file, and the same will be included in the final call sequence. The logic corresponding to the macro module is replaced with the logic page where it is located, so as to realize the macro module operation function.

2.4 Loading of Virtual DPUs The virtual DPU operation of MACSVDCS is implemented by sequentially calling a series of algorithm modules within the cycle (Figure 2). Using the automated modeling assistance tool (Cambench) provided by the DCOSE simulation platform, relevant module information is extracted from the converted VSD file, and a sequence file (RTE) called by the DCOSE loading operation algorithm is established. The file stores the corresponding algorithm call entry list according to the module order in the VSD, and sequentially stores the list of parameters (offsets of corresponding data points in the real-time database) called by each algorithm. The RTE file can be loaded and run directly at the trainer station. DCOSE provides the execution mode of the two RTE files for threads and processes. The virtual DPUs running in thread mode will be uniformly deployed and managed by the real-time engine (RTSrv) of the simulation platform; virtual DPUs running in the process mode have independent processes and do not interfere with each other.

Generally, the virtual DCS operation needs to complete the execution of all the virtual DPU algorithms in the same cycle. Therefore, the host running the virtual DPU should have a Pentium processor with a frequency of 2.8 GHz or more and a memory capacity of 2G or more.

3 Logic Screen Conversion In order to obtain the same operation screen as MACS VDCS, various operation screen graphic files are converted into SVG graphic files, and are described by extended SVG graphic attributes. Some of their attributes are visible (displayed by variable control primitives). And hidden), dynamic-fill (dynamic fill, change of fill color by variable control primitives), dynamic-fill-value (dynamically filled one or more colors, color selected by dynamically filled function values), text- Value (dynamic text display, corresponding to text dynamics, converting text to a real-time database point value or time), text-value-format (dynamic text display format).

In order to define the data source, the two keywords of variable (variable definition) and women's ction (function definition) are also defined. Variable describes the name, type, and length of a variable by attributes such as name, type, and size; function describes the function's expression and return value type through attributes such as expression and type. Combined with dynamic attributes and variables, function definitions can describe the dynamic properties of graphics.

3.1 File Parsing Different DCS generated graphics file format will have a big difference, but the effective information contained is basically induced, that is, it contains static graphic elements and their dynamic characteristics. The overall structure of the MACSVDCS file is composed of a file header and a plurality of graphic element information. The graphic element information includes information such as static, dynamic, interactive, and character personality.

Static elements consist of basic geometric shapes such as points, lines, circles, ellipses, polygons, and polylines, each of which is accompanied by attributes such as color and fill. The dynamic characteristics of primitives are divided into dynamic and interactive two characteristics. Dynamic features include display hidden, blinking, zooming, panning, filling, discoloration, text and other features that affect the graphics primitives; interactive features such as the launch window, Tip display, switch basemap, increase or decrease the value of the entire screen.

3.2 The translation of picture files Object-oriented construction of file class, picture element class, dynamic class, interaction class 4 objects. Among them, the file class defines one STL container to store multiple meta-class objects. Similarly, each meta-object has two STL containers to store dynamic and interaction class objects. Using the polymorphic shared inheritance programming method, each primitive, dynamic, and interactive features inherit their parent class. Since the base class of graph elements, dynamics, and interactions has roughly the same relationship with its derived class, taking the primitive class as an example, the generalization relationship between the primitive class and the derived class is shown (Figure 3).

After reading and classifying each element information of the file, according to the characteristics of the SVG file format, the information is written into the corresponding node attributes. The static features of the rectangular pixel mainly include the coordinates of the left upper point and the coordinates of the lower point, and the characteristics of the closed area. For the upper left point coordinate, width, width, and fill attributes of the rectangle object (rect) node, the width and height attributes can be calculated directly from the coordinates. The fill attribute is determined based on the information such as the filling method and fill color of the closed area feature.
The MACSVDCS screen can have up to five color changes to the picture element. Each color change is controlled by one or more conditions. Combining the conditions of each change into a function definition, according to the program function of each color to change the I priority:

The smaller the index value of X1, X2, the higher the priority. When the value of X1 is non-zero, the function value is 1; if and only if X1 is 0, that is, the item with the highest priority does not satisfy 吋, and then the color change of X2 is considered.

When the dynamic characteristics of the respective sub-entities in the combinational elements are processed according to the text file parsing, the dynamic information of the sub-elements is sometimes collectively stored in the primitive commonality library of the combinational elements. In order to reduce the extended attributes of the SVG graphics file, it is convenient for secondary development. The composite graphics element is decomposed into multiple sub-graphic elements. The sub-graphic elements inherit the dynamic characteristics of the combined graphics elements. When dealing with dynamic properties that contain conditional properties, add corresponding function definition methods. In order to avoid duplication of functions definition, we first define that the priority of the combined graphics element is higher than the priority of each sub-pixel element, and then separately process the dynamic characteristics of the combined element element, and store the processed dynamic information into the combined class library separately. Define one combined class pointer in the primitive base library (only valid for sub-entities in the composite primitive), copy the dynamic information of the pointer when the combined pointer value of the primitive is non-zero, and add it to the sub-graph The meta-meta-virtual-element-interaction-interaction feature processing method is the same as above.

The discoloration characteristics of the combined graphics elements are relatively complex, and the combined graphics elements generate a three-dimensional effect through the color differences of the respective sub-graphic elements. According to the distribution of red, green, and blue colors, R, G, and B color variables of the discoloration characteristics are extracted, and the color of each sub-pixel is processed: when the color variable is 0, the color value corresponding to the true color is filtered; When the variable is 255, the corresponding color value in the true color is not converted; when the color variable is other values, the value is reduced proportionally to the corresponding color value in the true color after being divided by 255 to obtain the proportional value.

3.3 Simulation of the operator station The MACS VDCS operation screen is converted to DCOSE: a dynamic graphic file that can be processed. By setting the source path of the simulation platform operator station as the converted graphics directory and specifying the name of the first operation screen, the simulation of the operator station can be automatically implemented. Since the translation process must be based on the complete data on the original surface, the virtual DCS translation scope is limited to the DCS operation with the original file. The DCOSE simulation platform provides the corresponding functions for functions such as scrolling alarms and event sequence recording (SOE) that are not supported by the file in the DCS.

Tube Doors

Danyang Weisheng Automotive Technology Co., Ltd , https://www.dywizsinparts.com

Posted on