


Network communication controller grouping to improve interactive load balancing capabilities example tutorial
20.1 Overview
ServerSuperIO originally had only one network controller in the network communication mode. In the automatic control mode, concurrent mode and singleton mode, the returned data is processed asynchronously, and there will be no performance. question. However, in polling mode, a network controller must operate the sending and receiving of the device driver one by one in sequence, so the polling cycle may be too long and the frequency of reading data cannot be reached.
In order to solve the above problems, the network controller grouping function is now added to the device driver parameters. The network controller will control the device driver according to the group name set by the device parameters. For example, in polling mode, there are 1,000 device drivers, and the same group name can be set for every 10 device drivers. These 10 device drivers are controlled by the same network controller. If data is read every 1 second, then each The polling cycle of the device driver is 10 seconds, which is similar to other network controllers.
20.2 Network controller diagram
According to the ControllerGroup that sets the device driver network parameters, the device driver can be assigned to run in different network controls, and is applicable For polling, automatic control, concurrency and singleton control modes.
20.3 Serial port controller diagram
By the way, the serial port controller can be assigned to different serial port controllers by setting the serial port number of the device driver. This controller can only be used in polling control mode.
20.4 Device driver network controller grouping sample code
static void Main(string[] args) { string deviceID = "2"; DeviceDriver dev3 = new DeviceDriver(); dev3.DeviceParameter.DeviceName = "设备2"; dev3.DeviceParameter.DeviceAddr = 0; dev3.DeviceParameter.DeviceID = deviceID; dev3.DeviceParameter.DeviceCode = deviceID; dev3.DeviceDynamic.DeviceID = deviceID; dev3.DeviceParameter.NET.RemoteIP = "127.0.0.1"; dev3.DeviceParameter.NET.RemotePort = 9600; dev3.DeviceParameter.NET.ControllerGroup = "G2"; dev3.CommunicateType = CommunicateType.NET; dev3.DeviceParameter.NET.WorkMode = WorkMode.TcpServer; dev3.Initialize(deviceID); deviceID = "3"; DeviceDriver dev4 = new DeviceDriver(); dev4.DeviceParameter.DeviceName = "设备3"; dev4.DeviceParameter.DeviceAddr = 0; dev4.DeviceParameter.DeviceID = deviceID; dev4.DeviceParameter.DeviceCode = deviceID; dev4.DeviceDynamic.DeviceID = deviceID; dev4.DeviceParameter.NET.RemoteIP = "127.0.0.1"; dev4.DeviceParameter.NET.RemotePort = 9600; dev4.DeviceParameter.NET.ControllerGroup = "G3"; dev4.CommunicateType = CommunicateType.NET; dev4.Initialize(deviceID); IServer server = new ServerManager().CreateServer(new ServerConfig() { ServerName = "服务1", ComReadTimeout = 1000, ComWriteTimeout = 1000, NetReceiveTimeout = 1000, NetSendTimeout = 1000, ControlMode = ControlMode.Loop, SocketMode = SocketMode.Tcp, StartReceiveDataFliter = false, ClearSocketSession = true, StartCheckPackageLength = false, CheckSameSocketSession = false, }); server.AddDeviceCompleted += server_AddDeviceCompleted; server.DeleteDeviceCompleted += server_DeleteDeviceCompleted; server.SocketConnected+=server_SocketConnected; server.SocketClosed+=server_SocketClosed; server.Start(); server.AddDevice(dev3); server.AddDevice(dev4); while ("exit"==Console.ReadLine()) { server.Stop(); } }
The above is the detailed content of Network communication controller grouping to improve interactive load balancing capabilities example tutorial. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Since Windows has become the gaming platform of choice, it's even more important to identify its gaming-oriented features. One of them is the ability to calibrate an Xbox One controller on Windows 11. With built-in manual calibration, you can get rid of drift, random movement, or performance issues and effectively align the X, Y, and Z axes. If the available options don't work, you can always use a third-party Xbox One controller calibration tool. Let’s find out! How do I calibrate my Xbox controller on Windows 11? Before proceeding, make sure you connect your controller to your computer and update your Xbox One controller's drivers. While you're at it, also install any available firmware updates. 1. Use Wind

PHP is a very popular programming language, and CodeIgniter4 is a commonly used PHP framework. When developing web applications, using frameworks is very helpful. It can speed up the development process, improve code quality, and reduce maintenance costs. This article will introduce how to use the CodeIgniter4 framework. Installing the CodeIgniter4 framework The CodeIgniter4 framework can be downloaded from the official website (https://codeigniter.com/). Down

Learning Laravel from scratch: Detailed explanation of controller method invocation In the development of Laravel, controller is a very important concept. The controller serves as a bridge between the model and the view, responsible for processing requests from routes and returning corresponding data to the view for display. Methods in controllers can be called by routes. This article will introduce in detail how to write and call methods in controllers, and will provide specific code examples. First, we need to create a controller. You can use the Artisan command line tool to create

In laravel, a controller (Controller) is a class used to implement certain functions; the controller can combine related request processing logic into a separate class. Some methods are stored in the controller to implement certain functions. The controller is called through routing, and callback functions are no longer used; the controller is stored in the "app/Http/Controllers" directory.

In the Laravel learning guide, calling controller methods is a very important topic. Controllers act as a bridge between routing and models and play a vital role in the application. This article will introduce the best practices for controller method calling and provide specific code examples to help readers better understand. First, let's understand the basic structure of controller methods. In Laravel, controller classes are usually stored in the app/Http/Controllers directory. Each controller class contains multiple

How to implement data grouping and statistical functions in PHP. In the actual development process, we often encounter the need to group and count data. Whether it is grouping statistics on data in a database or operating data in an array, PHP provides a wealth of functions and methods to meet our needs. The following will demonstrate how to group and count database and array data in PHP. Data grouping and statistics in the database Suppose we have a student performance table with the following table structure: CREATETABLE`s

In the Yii framework, controllers play an important role in processing requests. In addition to handling regular page requests, controllers can also be used to handle Ajax requests. This article will introduce how to handle Ajax requests in the Yii framework and provide code examples. In the Yii framework, processing Ajax requests can be carried out through the following steps: The first step is to create a controller (Controller) class. You can inherit the basic controller class yiiwebCo provided by the Yii framework

Symfony framework is a popular PHP framework designed based on MVC (Model-View-Controller) architecture. In Symfony, controllers are one of the key components responsible for handling web application requests. Parameters in controllers are very useful when processing requests. This article will introduce how to use controller parameters in the Symfony framework. Basic knowledge of controller parameters Controller parameters are passed to the controller through routing. Routing is a mapping of URIs (Uniform Resource Identifiers) to controllers and
