From 1d0a4978574e2b67b4ed04783465710978dbdaba Mon Sep 17 00:00:00 2001
From: wu <731351411@qq.com>
Date: 星期三, 19 三月 2025 09:17:56 +0800
Subject: [PATCH] 导入S7JAR包,更改数据库连接
---
nglib/src/builder/ThreadHttpServer.java | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/nglib/src/builder/ThreadHttpServer.java b/nglib/src/builder/ThreadHttpServer.java
index 49be5e1..5a3e1f1 100644
--- a/nglib/src/builder/ThreadHttpServer.java
+++ b/nglib/src/builder/ThreadHttpServer.java
@@ -4,15 +4,21 @@
import java.net.InetSocketAddress;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
-
+
+import S7.S7control;
+import com.github.xingshuangs.iot.protocol.s7.enums.EPlcType;
import com.sun.net.httpserver.*;
public class ThreadHttpServer {
//启动端口8080
+
private static final int port=8880;
private static final String Httpcontext="/demo";
private static final int nThreads=8;
public static void mains() {
+ System.out.println("S7链接");
+ S7control s7=new S7control(EPlcType.S1500, "192.168.30.14", 102, 0, 0);
+ System.out.println("S7:"+s7.readByte("DB34.0", 2));
HttpServer httpServer;
try {
httpServer=HttpServer.create(new InetSocketAddress(port),0);
--
Gitblit v1.8.0