diff --git a/DMS.Core/Enums/CpuType.cs b/DMS.Core/Enums/CpuType.cs
index 165b4dd..1a9c4ea 100644
--- a/DMS.Core/Enums/CpuType.cs
+++ b/DMS.Core/Enums/CpuType.cs
@@ -10,6 +10,8 @@ public enum CpuType
S71500,
[Description("S7-300")]
S7300,
+ [Description("S7-300")]
+ S7200,
[Description("S7-400")]
S7400
}
diff --git a/DMS.Infrastructure/Extensions/S7ServiceExtensions.cs b/DMS.Infrastructure/Extensions/S7ServiceExtensions.cs
new file mode 100644
index 0000000..3ccd511
--- /dev/null
+++ b/DMS.Infrastructure/Extensions/S7ServiceExtensions.cs
@@ -0,0 +1,32 @@
+using DMS.Application.Interfaces;
+using DMS.Infrastructure.Interfaces;
+using DMS.Infrastructure.Interfaces.Services;
+using DMS.Infrastructure.Services;
+using Microsoft.Extensions.DependencyInjection;
+
+namespace DMS.Infrastructure.Extensions
+{
+ ///
+ /// S7服务扩展方法
+ ///
+ public static class S7ServiceExtensions
+ {
+ ///
+ /// 添加S7服务
+ ///
+ public static IServiceCollection AddS7Services(this IServiceCollection services)
+ {
+ // 注册服务
+ services.AddSingleton();
+ services.AddSingleton();
+
+ // 注册后台服务
+ services.AddHostedService();
+
+ // 注册优化的后台服务(可选)
+ // services.AddHostedService();
+
+ return services;
+ }
+ }
+}
\ No newline at end of file
diff --git a/DMS.Infrastructure/Interfaces/IChannelBus.cs b/DMS.Infrastructure/Interfaces/IChannelBus.cs
new file mode 100644
index 0000000..dc0e3fc
--- /dev/null
+++ b/DMS.Infrastructure/Interfaces/IChannelBus.cs
@@ -0,0 +1,43 @@
+using System;
+using System.Threading.Channels;
+using System.Threading.Tasks;
+
+namespace DMS.Infrastructure.Interfaces
+{
+ ///
+ /// 通道总线接口,用于在不同组件之间传递数据
+ ///
+ public interface IChannelBus
+ {
+ ///
+ /// 获取指定名称的通道写入器
+ ///
+ /// 通道中传递的数据类型
+ /// 通道名称
+ /// 通道写入器
+ ChannelWriter GetWriter(string channelName);
+
+ ///
+ /// 获取指定名称的通道读取器
+ ///
+ /// 通道中传递的数据类型
+ /// 通道名称
+ /// 通道读取器
+ ChannelReader GetReader(string channelName);
+
+ ///
+ /// 创建指定名称的通道
+ ///
+ /// 通道中传递的数据类型
+ /// 通道名称
+ /// 通道容量
+ void CreateChannel(string channelName, int capacity = 100);
+
+ ///
+ /// 关闭指定名称的通道
+ ///
+ /// 通道中传递的数据类型
+ /// 通道名称
+ void CloseChannel(string channelName);
+ }
+}
\ No newline at end of file
diff --git a/DMS.Infrastructure/Interfaces/IMessenger.cs b/DMS.Infrastructure/Interfaces/IMessenger.cs
new file mode 100644
index 0000000..e7d762d
--- /dev/null
+++ b/DMS.Infrastructure/Interfaces/IMessenger.cs
@@ -0,0 +1,38 @@
+using System;
+
+namespace DMS.Infrastructure.Interfaces
+{
+ ///
+ /// 消息传递接口,用于在不同组件之间发送消息
+ ///
+ public interface IMessenger
+ {
+ ///
+ /// 发送消息
+ ///
+ /// 消息类型
+ /// 要发送的消息
+ void Send(T message);
+
+ ///
+ /// 注册消息接收者
+ ///
+ /// 消息类型
+ /// 接收者
+ /// 处理消息的动作
+ void Register(object recipient, Action action);
+
+ ///
+ /// 取消注册消息接收者
+ ///
+ /// 接收者
+ void Unregister(object recipient);
+
+ ///
+ /// 取消注册特定类型消息的接收者
+ ///
+ /// 消息类型
+ /// 接收者
+ void Unregister(object recipient);
+ }
+}
\ No newline at end of file
diff --git a/DMS.Infrastructure/Interfaces/Services/IS7Service.cs b/DMS.Infrastructure/Interfaces/Services/IS7Service.cs
new file mode 100644
index 0000000..9cf47c9
--- /dev/null
+++ b/DMS.Infrastructure/Interfaces/Services/IS7Service.cs
@@ -0,0 +1,59 @@
+using System;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using S7.Net;
+
+namespace DMS.Infrastructure.Interfaces.Services
+{
+ ///
+ /// S7服务接口,定义了与S7 PLC进行通信所需的方法
+ ///
+ public interface IS7Service
+ {
+ ///
+ /// 获取当前连接状态
+ ///
+ bool IsConnected { get; }
+
+ ///
+ /// 异步连接到S7 PLC
+ ///
+ /// 表示异步操作的任务
+ Task ConnectAsync(string ipAddress, int port, short rack, short slot, S7.Net.CpuType cpuType);
+
+ ///
+ /// 异步断开与S7 PLC的连接
+ ///
+ /// 表示异步操作的任务
+ Task DisconnectAsync();
+
+ ///
+ /// 异步读取单个变量的值
+ ///
+ /// S7地址
+ /// 表示异步操作的任务,包含读取到的值
+ Task