1.1 Schema structure Figure 1.1.1 levels
1.1.2 Model Objects
1.2 IO Manager
IO Manager is the management and dispatch of serial port and network communication link. For the characteristics of serial port and network communication link, the serial port management and network management are derived on the basis of IO Manager interface.
1.2.1 Serial port management
Serial port management for the creation of serial IO instance, the opening of serial IO, the shutdown of serial IO and release of resources to make timely response, as well as the management of IO operation instances.
1.2.2 Network Management
When the device uses network communication mode, the working mode of the device is divided into: TCP server and TcpClient.
When the operating mode is tcpserver, the communication platform listens to the network connection, the client connects to the server side, and the connection instance is placed in the IO Manager in the form of IO interface.
When the operating mode is tcpclient, the communication platform will actively connect to the remote server, when the connection is successful, the connection instance will be placed in the form of IO interface to the IO Manager.
Heartbeat detection is timed for all network connection instances, and the resources for network connection instances are actively released in response to spurious connections, dead connections, remote disconnects, and hardware link disconnects.
The Network IO Manager responds promptly to events such as receiving data, sending data, connecting operations, and disconnecting operations.
1.3 Device Manager
The main function of the Device Manager is to manage the serial device, network equipment, virtual equipment, and to provide the interface of external operable equipment. The main implementation functions, such as:
1.3.1 Device Main interface
The device has a unified interface, and this interface is used as an operational instance during the communication platform operation. Interface includes: event class interface, function class interface, attribute class interface. Such as:
The following describes the functions of the main components of the equipment, as well as the function responsibilities.
1.3.1.1 Command Cache
Each device has a command cache, you can put the instructions sent by the device into the command cache, when the communication platform is polling communication mode or concurrent communication mode, will be actively called to obtain the instruction data interface, and determine whether the current command cache has data information, when the command buffers the data, the command cache will be sent data, Otherwise the call obtains the real-time data instruction interface, sends the real-time data instruction. Such as:
1.3.1.2 Protocol Driver
Protocol driver is divided into: Send data protocol driver and receive data protocol driver, in the device instance as two necessary attributes, in order to make the communication platform call.
The Send data protocol driver uses the command interface to drive different function functions, package the command data, and then send the data through the IO interface.
The receiving data protocol drives different function functions by parsing the command interface, parses the data information by the command-state word, and returns the actionable object for business processing.
1.3.1.3 Data hold
Data remains divided into two types of data: real-time data, parameter data. Both types of data are stored in an XML file format through a serialized interface.
When the device initializes, the XML file is loaded, deserialized into an instance object, and used as the device's attribute interface for the communication platform to perform the necessary operations on the parameters and real-time data of the device.
In addition, two of times developers can also inherit the serialization interface, custom data persistence, such as: the database as a carrier, to avoid the high-real-time causes of file corruption.
1.3.1.4 Virtual Appliance Interface
You can develop corresponding virtual devices for the same type of device, set up virtual formulas for virtual devices, and handle the business logic for the corresponding data of multiple devices of the same type.
1.3.1.5 Run Authorization
Each device has an authorization attribute that does not operate on the IO interface for unauthorized devices, and the device cannot communicate effectively. During the two development process, the developer can make authorization settings.
1.3.1.6 Video Interface
Each device has a video properties operating interface, for the field of equipment can choose to configure the video server, on the server side of the file data and video data fusion display.
1.3.1.7 Channel Monitoring
You can monitor device IO to send data and receive data, the data is displayed in 16, and the source data of the 16 binary is saved to facilitate the debugging of the device.
1.3.1.8 Priority level
Priority levels for two types: high and normal levels, you can prioritize devices and commands individually, and the IO Control Manager prioritizes the device and command.
1.4 Control Manager
IO Control Manager is mainly to the communication mechanism scheduling, serial port and network communication mechanism is not the same,
So the control manager is not the same, but for the communication platform interface is unified.
1.4.1 Serial Control
IO Control Manager has a plurality of serial controller, each serial controller has a separate thread, is responsible for the installation of the serial port device polling communication mechanism scheduling. Such as:
1.4.2 Network control
There is only one network controller in the IO Control Manager, there is a separate thread in the network controller, which is responsible for polling, concurrency, auto-control mode communication scheduling for all network devices, and asynchronous listening to the IO channel, and distributing the received data to the corresponding device driver. Such as:
1.5 Module Debug 1.5.1 Debug interface
The Debug interface defines the debugging device, debugging interface view, debugging data export, debugging application services and other interfaces, which can be used to debug two of development program modules.
Definition of Debug Interface:
void Debugdevice (Irundevice dev);
void Debuggraphicsshow (Igraphicsshow show);
void Debugexportdata (Iexportdata export);
void Debugappservice (Iappservice appservice);
1.5.2 Debug Mode 1.5.2.1 interface mode debugging
You can inherit the MainForm form, and the form instance provides a debug interface, You can also define whether it is debug mode through the SuperIO.Device.DebugDevice.IsDebug property, and if this property is True, you can debug by dynamically loading the program module through the debug interface, and if this property is False, the program will load the program module in the directory configuration file and will not be able to enter Line tracking, debugging work.
1.5.2.2 Command Console mode debugging
Debug instance can be obtained through debugdevice.getdebuginstance (), this debugging instance does not have the interface display function, but it can be more convenient and quick to debug the program module.
1.6 Component Controller
The main function of the platform controller is to assemble the main components of each part and coordinate the orderly work between the components, as well as providing external accessible interfaces, debugging interfaces, etc.
1.7 Running Device
The runner is primarily responsible for monitoring the operating status of all devices, including: device name, address, type of communication, IO parameters, channel status, communication status, device status, alarm status, device type, etc.
At the same time, also includes: running the monitor, responsible for displaying the log display device running, serial port status monitoring, responsible for the serial control status display, network status monitoring, responsible for the network connection status display.
1.8 Monitor
The monitor mainly monitors the log information generated during the operation of the Platform software and displays it in the running monitor as well as monitoring unknown exception information.
1.9 External interface
Mainly through the form of configuration files, mount the assembly, the communication platform through the configuration file to dynamically load the assembly, external to provide accessible interface services.
1.9.1 Mounting Equipment
The device driver module that inherits the Irundevice interface can save the device-driven information to the configuration file by means of the configuration form, including: Program module file, assembly ID (auto-generated), file name, device type (normal device, virtual device), instance name (namespace and class name), Device name, memo information, and so on.
After the device is mounted successfully, you can add the corresponding device in the Device Management menu of the communication platform, and you can choose serial port or network communication mode when adding the device.
1.9.2 Interface Display
The view display module that inherits the Igraphicsshow interface can be saved to the configuration file by the configuration form, including: Program module file, file name, instance name, title name, etc.
Mount a successful view display module, which displays the item in the Interface View menu, and when clicked, displays the corresponding View in tab form.
1.9.3 external Programs
You can configure the executable application to be used as a tool in the external Tools menu as a communication platform.
1.9.4 Data Export
The data export module that inherits the Iexportdata interface can be saved to the configuration file by the configuration form, including: Program module file, file name, instance name, title name, etc.
Mount the successful data export module, will not be displayed in the interface, the platform software will automatically load the Export module instance.
1.9.5 Application Services
The application module that inherits the Iappservice interface can be saved to the configuration file by the configuration form, which includes: Program module file, file name, instance name, title name, service type and startup type.
Service types include: Display mode and stealth mode. The service that displays the model can display the service item in the menu, can invoke the corresponding service form interface by clicking the event, the service can be configured, manage and so on, it is possible to start and stop the service manually through this mode, the service of the hidden mode does not display the service item in the menu, this type of service is used with the startup type. Set the startup type to start automatically, and the service will start automatically when the platform software starts.
Startup types include: Manual start and auto start. Manual start mode, the service will not start automatically when the communication platform starts, auto-start mode, the service will start automatically when the communication platform starts.
Author qq:504547114
QQ Group: 54256083
Official website: http://www.bmpj.net
Source Article address: http://www.bmpj.net/index.php?m=article&f=view&id=2
Two. Superio Architecture and Components