Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the service-driven method of SuperIO secondary development?

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the relevant knowledge of what the SuperIO secondary development service-driven method is, the content is detailed and easy to understand, the operation is simple and fast, and has a certain reference value. I believe you will gain something after reading this SuperIO secondary development service-driven method. Let's take a look.

1.1 the role of service interfaces

Around the data collected by the device driver module, provide a variety of application services according to the demand, such as: data upload service, data request service, 4-20mA service, short message service, LED service and OPC service and so on. Under the premise of ensuring the real-time and stability of data, the service interface can provide rich functional service mechanism, which is convenient for developers to carry out secondary development.

1.2 functional description of the interface

The development of the device output interface mainly takes into account the output of various data formats in the integration project, during the integration process or during the integration process. You need to inherit the SuperIO.Export.IExportData API, which includes:

1) StartService

When the service startup mode (IsAutoStart) is "Auto start", this interface function is automatically called when the platform loads the service.

2) ReleaseService

Release the service resource interface.

3) OnClick

When the service type (ServiceType) is "display mode", the name of the service is displayed in the "service" menu. When the service menu item is clicked, the click interface function is called, and the form can be called in this interface function.

4) WriteLogHandler

Log event interface, through which log information can be displayed in the "running Monitor".

5) ServiceType

Service types, which are divided into display mode and hidden mode. The service of the display module will display the service name in the Services menu; the hidden mode will not appear in the menu, you can set this kind of service to start automatically, and the software will start the service automatically during loading.

6) IsAutoStart

The type of service startup that identifies whether it starts automatically.

7) ThisKey

Returns the form ID, and it is unique. If the same form exists, it will not be displayed again.

8) ThisName

Form name.

9) UpdateDevice

Update the device data to receive the object instance passed in by the device OnDeviceObjectChangedHandler event.

10) RemoveDevice

Remove the device, and this function interface is called when the device is deleted.

11) Dispose

Release the resource function.

1.3 Development Service driver

1) add references to SuperIO components.

2) create a new class, inherit the SuperIO.Services.AppService abstract class, and implement the interface function.

3) the cached data of the device can be updated through the UpdateDevice interface function.

1.4 Debug service driver

Interface mode testing has a window interface, which must inherit the "SuperIO.UI .MainForm" class, and set the software platform to debug mode "SuperIO.Device.DebugDevice.IsDebug = true;" with code, as shown in the figure:

Initialize the instance in Form_Load, and load the debug graphics display module, mainly to create an instance, such as: this.DebugAppService ((SuperIO.Services.IAppService) _ service) statement. As shown below:

1.5 Mount service driver

Find the [ConfigTool.exe] application under the "Industrial Serial Port and Network Software Communication platform _ SuperIO" directory, select the "Service configuration" tab, click the "Mount Service" button, and mount the service driver module you just developed to the platform. As shown below:

1.6 run under the software platform

The service type is used in conjunction with the startup type, and the service type is in display mode, both manual start mode and automatic start mode; the service type is hidden mode, which is set to automatic start mode, so that the service can be started automatically during the program loading process.

As shown below:

This is the end of the article on "what is the service-driven method of SuperIO secondary development?" Thank you for reading! I believe that everyone has a certain understanding of the knowledge of "what is the service-driven method of SuperIO secondary development". If you want to learn more knowledge, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report