From 2ebd28d93d5097666a18845b937942ddf0dc3b05 Mon Sep 17 00:00:00 2001
From: whycq <913841844@qq.com>
Date: 星期五, 05 一月 2024 08:09:24 +0800
Subject: [PATCH] #
---
src/main/webapp/static/js/common.js | 2
src/main/java/com/zy/core/thread/SiemensDevpThread.java | 39 ++++++-------------
src/main/resources/application.yml | 30 +++++++-------
3 files changed, 28 insertions(+), 43 deletions(-)
diff --git a/src/main/java/com/zy/core/thread/SiemensDevpThread.java b/src/main/java/com/zy/core/thread/SiemensDevpThread.java
index 17a5521..4eb37f7 100644
--- a/src/main/java/com/zy/core/thread/SiemensDevpThread.java
+++ b/src/main/java/com/zy/core/thread/SiemensDevpThread.java
@@ -166,42 +166,27 @@
// updateIoMode();
ArrayList<Integer> staNos = getStaNo();
int staNoSize = staNos.size();
- OperateResultExOne<byte[]> result = siemensS7Net.Read("DB100.0", (short) (staNoSize*4));
+ OperateResultExOne<byte[]> result = siemensS7Net.Read("DB101.0", (short) (staNoSize*8));
if (result.IsSuccess) {
for (int i = 0; i < staNoSize; i++) {
+ if (staNoSize==13){
+// System.out.println(i);
+ }
Integer siteId = staNos.get(i); // 绔欑偣缂栧彿
+// if(siteId==206){
+// System.out.println(1);
+// }
StaProtocol staProtocol = station.get(siteId);
if (null == staProtocol) {
staProtocol = new StaProtocol();
staProtocol.setSiteId(siteId);
station.put(siteId, staProtocol);
}
- staProtocol.setWorkNo(siemensS7Net.getByteTransform().TransInt16(result.Content, i*4)); // 宸ヤ綔鍙�
+ staProtocol.setStaNo( siemensS7Net.getByteTransform().TransInt16(result.Content, i*8 + 4 )); // 鐩爣绔�
+ Thread.sleep(300);
+ staProtocol.setWorkNo((short) siemensS7Net.getByteTransform().TransInt32(result.Content, i * 8)); // 宸ヤ綔鍙�
- staProtocol.setStaNo(siemensS7Net.getByteTransform().TransInt16(result.Content, i*4 + 2)); // 鐩爣绔�
- }
- }
-// Thread.sleep(200);
-// OperateResultExOne<byte[]> result0 = siemensS7Net.Read("DB101.0", (short) 186);
-// if (result0.IsSuccess) {
-// for (int i = 0; i < 93; i++) {
-// Integer siteId = staNos.get(i); // 绔欑偣缂栧彿
-// StaProtocol staProtocol = station.get(siteId);
-// if (null == staProtocol) {
-// staProtocol = new StaProtocol();
-// staProtocol.setSiteId(siteId);
-// station.put(siteId, staProtocol);
-// }
-// staProtocol.setStaNo(siemensS7Net.getByteTransform().TransInt16(result0.Content, i*2)); // 鐩爣绔�
-// }
-// }
- Thread.sleep(200);
- OperateResultExOne<byte[]> result1 = siemensS7Net.Read("DB102.", (short) (staNoSize * 2));
- if (result1.IsSuccess) {
- for (int i = 0; i < staNoSize; i++) {
- Integer siteId = staNos.get(i); // 绔欑偣缂栧彿
- boolean[] status = siemensS7Net.getByteTransform().TransBool(result1.Content, i*2, 1);
- StaProtocol staProtocol = station.get(siteId);
+ boolean[] status = siemensS7Net.getByteTransform().TransBool(result.Content, i*8+6, 2);
staProtocol.setAutoing(status[0]); // 鑷姩
staProtocol.setLoading(status[1]); // 鏈夌墿
staProtocol.setInEnable(status[2]); // 鍙叆
@@ -262,7 +247,7 @@
- if (result.IsSuccess && result1.IsSuccess) {
+ if (result.IsSuccess) {
OutputQueue.DEVP.offer(MessageFormat.format("銆恵0}銆慬id:{1}] <<<<< 瀹炴椂鏁版嵁鏇存柊鎴愬姛",DateUtils.convert(new Date()), slave.getId()));
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index 6ae339c..47ee984 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -48,7 +48,7 @@
# 鍫嗗灈鏈�1
crn[0]:
id: 1
- ip: 10.10.10.110
+ ip: 10.10.10.100
port: 102
rack: 0
slot: 0
@@ -100,7 +100,7 @@
# 鍫嗗灈鏈�2
crn[1]:
id: 2
- ip: 10.10.10.120
+ ip: 10.10.10.110
port: 102
rack: 0
slot: 0
@@ -152,7 +152,7 @@
# 鍫嗗灈鏈�3
crn[2]:
id: 3
- ip: 10.10.10.130
+ ip: 10.10.10.120
port: 102
rack: 0
slot: 0
@@ -204,7 +204,7 @@
# 杈撻�佺嚎1妤�
devp[0]:
id: 1
- ip: 10.10.10.30
+ ip: 10.10.10.130
port: 102
rack: 0
slot: 0
@@ -256,7 +256,7 @@
# 杈撻�佺嚎2妤�
devp[1]:
id: 2
- ip: 10.10.10.30
+ ip: 10.10.10.140
port: 102
rack: 0
slot: 0
@@ -308,7 +308,7 @@
# 杈撻�佺嚎3妤�
devp[2]:
id: 3
- ip: 10.10.10.30
+ ip: 10.10.10.150
port: 102
rack: 0
slot: 0
@@ -360,47 +360,47 @@
# 鏉$爜鎵弿浠�1
barcode[0]:
id: 1
- ip: 10.10.10.55
+ ip: 10.10.10.133
port: 51236
# 鏉$爜鎵弿浠�2
barcode[1]:
id: 2
- ip: 10.10.10.55
+ ip: 10.10.10.134
port: 51236
# 鏉$爜鎵弿浠�3
barcode[2]:
id: 3
- ip: 10.10.10.55
+ ip: 10.10.10.135
port: 51236
# 鏉$爜鎵弿浠�4
barcode[3]:
id: 4
- ip: 10.10.10.55
+ ip: 10.10.10.143
port: 51236
# 鏉$爜鎵弿浠�5
barcode[4]:
id: 5
- ip: 10.10.10.55
+ ip: 10.10.10.144
port: 51236
# 鏉$爜鎵弿浠�6
barcode[5]:
id: 6
- ip: 10.10.10.55
+ ip: 10.10.10.145
port: 51236
# 鏉$爜鎵弿浠�7
barcode[6]:
id: 7
- ip: 10.10.10.55
+ ip: 10.10.10.153
port: 51236
# 鏉$爜鎵弿浠�8
barcode[7]:
id: 8
- ip: 10.10.10.55
+ ip: 10.10.10.154
port: 51236
# 鏉$爜鎵弿浠�9
barcode[8]:
id: 9
- ip: 10.10.10.55
+ ip: 10.10.10.155
port: 51236
# LED1
led[0]:
diff --git a/src/main/webapp/static/js/common.js b/src/main/webapp/static/js/common.js
index 92f2008..d52ef33 100644
--- a/src/main/webapp/static/js/common.js
+++ b/src/main/webapp/static/js/common.js
@@ -1,4 +1,4 @@
-var baseUrl = "/phpswcs";
+var baseUrl = "/pswcs";
// 璧嬪��
function setVal(el, val) {
--
Gitblit v1.9.1