Technical Route of C# Industrial IoT and Integration Systems Solutions

Introduction

After 2000, the internet has developed vigorously across China, and the competition in this industry is about speed. I clearly remember a passage in “The World is Flat”: In Africa, when an antelope wakes up every morning, it knows it must run faster than the fastest lion, or it will be eaten; the lion, on the other hand, knows it must catch up with the slowest antelope, or it will starve. Whether you are a lion or an antelope, when the sun rises, you better start running! Over these past ten years, internet technology has driven the development of various industries while sweeping through them.

In 2006, the industrial sector was still widely using telephone lines for data transmission and remote assistance. Network technology gradually spread across various industries, and the industrial sector also progressed, with local area networks, fiber optic Ethernet, Wi-Fi, 3G, and 4G becoming widely used. While internet technology has promoted the development of manufacturing, it has also pushed many companies to keep pace with the times, upgrading technology and providing better services.

We ponder how the post-internet era will develop. It will be a process of deep integration between the internet and various industries, such as the Internet of Things (IoT), which I believe is essentially the Industrial Internet, a seamless connection between manufacturing technology and internet technology. Whether we call it IoT or Industrial Internet, the future interactions between objects and objects, and between objects and people, will be inevitable. The collaborative development of hardware and software has accelerated this process, with advancements in smart chips, embedded operating systems, and smart sensors.

Big data, distributed systems, and cloud computing are also developing at an astonishing speed. Some may think these technologies are still far from our daily lives. However, that is not the case; it has only been about ten years since 2006, and the current development is unimaginable compared to the past. This acceleration means that two years of development may equal ten years of previous progress. Regardless of whether these technologies can be implemented now, this trend is unchangeable.

The flow of data can be monetized, and the flow of cash can increase GDP. Technological advancement is an enhancement of productivity, and in the future, organizational structures and relationships will inevitably change. Regardless of technical knowledge or management skills, a failure to change one’s mindset will surely lead to obsolescence.

The following introduces the technical route for solutions involving IoT and integration systems, focusing only on technology selection and system processes, without detailing architectural evolution or which technology is superior. This is for reference only!

Chapter 1 System Architecture

The architecture diagram primarily expresses a general structural idea and may not be very accurate; I hope everyone can understand. As a system, it also includes a network deployment framework diagram, which varies according to different application scenarios and network environments, so it will not be discussed further in this article.

1.1 Hardware Architecture Diagram

Technical Route of C# Industrial IoT and Integration Systems Solutions

1.2 Component Architecture Diagram

Technical Route of C# Industrial IoT and Integration Systems Solutions

Chapter 2 Technology Selection and Introduction

This article does not introduce code sections, as there is complete code and comments in the demo examples that can be downloaded and debugged.

2.1 Development Environment

Development Language: All using C#, with a small amount of JS code.

Development Tools: Except for the App part, all components are developed using VS2012, while the App program is developed using VS2015. VS2015 is a super development tool factory that can also develop IoT embedded programs on Windows 10 without issues.

Operating System: Windows 8.1, which is also fine if you are used to it. I heard it will stop service soon, but there are still people using XP, so no need to worry.

2.2 Data Sources

Data sources are the entities that generate data; some refer to this area as sensors, but I believe this terminology is not entirely accurate, so I generally refer to this area as data sources.

Data sources encompass many things, such as various sensors, large, medium, and small devices, hardware circuits, software components, etc. Different data sources have different communication protocols, communication links, and communication mechanisms. Without a unified standard, this part of the work is very important. Because once you have data, your business system has application value.

I wrote a small program module for data sources, including serial port communication and network communication. As for the communication protocol, please refer to “C# Communication (Serial and Network) Framework Design and Implementation (SuperIO) – 12. Secondary Development and Application”.

2.3 Data Collection

The data collection part uses the SuperIO framework, as it supports unified plug-in device driver development for both serial and network communication, meaning that developing one driver can support both serial and network communication. Additionally, its scalability is strong, which can significantly reduce workload.

I developed a driver program, adding two driver instances under the SuperIO platform to handle serial and network communication with the data source program.

2.4 Data Upload Service

The data upload service is developed on the SuperIO platform, allowing for plugin services developed by inheriting the IAppService interface, which can be mounted to run under the SuperIO platform. After the device driver collects data, it can be passed to the service plugin via the interface for in-memory data interaction. If complete data integrity is involved, data interaction can occur via media, such as databases, text files, etc.

The data upload service interacts directly with the message middleware (ActiveMQ) for message forwarding. The data upload service essentially acts as a message producer.

2.5 Message Middleware

Message middleware uses ActiveMQ, which requires the deployment of a Java runtime environment. There are many available message middleware options, such as RabbitMQ, ZeroMQ, etc.

Depending on the application scenario, different technical solutions and routes can be chosen. This area of message middleware can also completely be replaced by communication components, such as Netty and SuperSocket.

2.6 Data Reception Service

The data reception service is developed on the SuperIO platform, allowing for plugin services developed by inheriting the IAppService interface, which can be mounted to run under the SuperIO platform.

The data reception service interacts directly with ActiveMQ to receive messages forwarded by ActiveMQ, effectively acting as a message consumer.

2.7 Data Storage

The data storage uses MongoDB, which I prefer over bulky options, and it eliminates the need for ORM. It is easy to deploy and can be managed using the MongoVUE tool. For experts, they can directly use cmd.

2.8 Data Interface

The data interface uses Web API, adhering to the RESTful style of HTTP protocol, making operations simple and convenient. It has discarded the SOAP protocol of WebService and has not chosen the WCF framework.

This section does not implement permission or security management.

2.9 Web Business System

The business system uses the MVC framework, but the frontend does not interact with the backend controller; instead, it interacts with the data interface’s Web API. The frontend and backend are completely separated.

2.10 Mobile Terminal App

The mobile end is developed using VS2015 and the Xamarin framework, which supports cross-platform development. Xamarin is a great tool; its only downside is that it requires payment, but this should not be a barrier for IT personnel in China.

Chapter 3 Demo Introduction

3.1 Directory Introduction

The project directory is as follows:

ClientService: Data upload and interaction component.

DeviceDemo: Device driver responsible for data collection.

DeviceExport: Data output component, not used in the demo.

DeviceShowUI: Data display view component responsible for showing collected data information.

FormTest: Main project testing all parts.

ProtocolPackage: Common protocol package.

ServerService: Data reception and interaction component.

SuperIO_App: Mobile app, needs to be opened with VS2015.

SuperOPCClient: OPC client component.

SuperOPCServer: OPC server component.

TestDevice: Simulated client testing program.

WebAPI: WebAPI and web business data display.

3.2 Demo Debugging

Download address: http://pan.baidu.com/s/1pJ7lZWf

(1) Download DEMO and Tools

Download SuperIO v2.2.7\SuperIO_Demo v2.rar; download MongoDB database; download ActiveMQ message middleware.

(2) Start Services and Programs

Start MongoDB, mongodb-win32-x86_64-2008plus-3.0.3-1\start.bat, default listening port: 2222.

Start ActiveMQ service, apache-activemq-5.12.0\bin\win64\activemq.bat, requires JAVA runtime environment.

Start SuperIO_Demo.sln solution, requires VS2012 development IDE, can also be converted to VS2015 project and recompiled.

Start SuperIO_App.sln solution, requires VS2015 development IDE. If using the built-in emulator of VS, you need to execute to successfully deploy the program to the emulator and debug it; otherwise, the VS tool will remain in the deployment stage.

(3) Running Effect Diagram

Technical Route of C# Industrial IoT and Integration Systems Solutions

(4) Debugging Video

The Youku video is not very clear; please download the high-definition debugging video at: http://pan.baidu.com/s/1pJ7lZWf in the 【Video Demonstration】 section.

Original article address: http://www.cnblogs.com/lsjwq/p/5122612.html

.NET Community News, In-Depth Articles, Search fordotNET Cross-Platformin WeChat or scan the QR code to follow

Technical Route of C# Industrial IoT and Integration Systems Solutions

Leave a Comment