From b4ff04d7dd22f0e48bf386cd422e885aef08fed7 Mon Sep 17 00:00:00 2001 From: ZengTao <2773468879@qq.com> Date: 星期四, 22 五月 2025 15:03:10 +0800 Subject: [PATCH] OPC通讯修改为S7通讯 --- hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/config/S7Config.java | 17 +++++++++++++++-- 1 files changed, 15 insertions(+), 2 deletions(-) diff --git a/hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/config/S7Config.java b/hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/config/S7Config.java index 889333c..411cd2c 100644 --- a/hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/config/S7Config.java +++ b/hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/config/S7Config.java @@ -13,9 +13,22 @@ */ @Configuration public class S7Config { - @Bean - public S7Serializer s7Serializer() { + + @Bean(name = "s7SerializerCC") + public S7Serializer s7SerializerCC() { S7PLC s7PLC = new S7PLC(EPlcType.S1200, "192.168.10.80"); return S7Serializer.newInstance(s7PLC); } + + @Bean(name = "s7SerializerSPOne") + public S7Serializer s7SerializerSPOne() { + S7PLC s7PLC = new S7PLC(EPlcType.S1200, "192.168.10.15"); + return S7Serializer.newInstance(s7PLC); + } + + @Bean(name = "s7SerializerSPTwo") + public S7Serializer s7SerializerSPTwo() { + S7PLC s7PLC = new S7PLC(EPlcType.S1200, "192.168.10.21"); + return S7Serializer.newInstance(s7PLC); + } } -- Gitblit v1.8.0