From 849442e4f63a5fd7ae154ef6bc77c967a82f40b8 Mon Sep 17 00:00:00 2001
From: ZengTao <2773468879@qq.com>
Date: 星期四, 26 六月 2025 08:46:01 +0800
Subject: [PATCH] 删除改S7通讯时注释的原opc代码
---
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/job/OpcHollowRemoveTask.java | 40 ----------------------------------------
1 files changed, 0 insertions(+), 40 deletions(-)
diff --git a/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/job/OpcHollowRemoveTask.java b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/job/OpcHollowRemoveTask.java
index 0c22324..78e634c 100644
--- a/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/job/OpcHollowRemoveTask.java
+++ b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/job/OpcHollowRemoveTask.java
@@ -119,23 +119,11 @@
}
String glassIdEntitys = readString(modbusTcp, 42003 - offset);
log.info("闄よ啘{}鑾峰彇褰撳墠鐨勭幓鐠僫d锛歿}", cell, glassIdEntitys);
-// byte[] res = CMJ1ModbusTcp.readHoldRegister(1, 42003, 14);
-// String glassId1 = ByteReadBuff.newInstance(res, 0, false, EByteBuffFormat.CD_AB).getString(10);
-// String glassId2 = ByteReadBuff.newInstance(res, 0, false, EByteBuffFormat.AB_CD).getString(10);
-// String glassId3 = ByteReadBuff.newInstance(res, 0, false, EByteBuffFormat.BA_DC).getString(10);
-// String glassId4 = ByteReadBuff.newInstance(res, 0, false, EByteBuffFormat.DC_BA).getString(10);
-// log.info("鑾峰彇{}褰撳墠鐨勭幓鐠僫d1锛歿}", cell, glassId1);
-// log.info("鑾峰彇{}褰撳墠鐨勭幓鐠僫d2锛歿}", cell, glassId2);
-// log.info("鑾峰彇{}褰撳墠鐨勭幓鐠僫d3锛歿}", cell, glassId3);
-// log.info("鑾峰彇{}褰撳墠鐨勭幓鐠僫d4锛歿}", cell, glassId4);
Integer requestEntity = modbusTcp.readUInt16(42001 - offset);
-// ReadWriteEntity requestEntity = miloService.readFromOpcUa(cell + "mesControl");
-// if ("0".equals(requestEntity.getValue() + "")) {
if (0 == requestEntity) {
log.info("褰撳墠闄よ啘鏈轰负鍗曟満鐘舵��");
return;
}
-// int request = Integer.parseInt(requestEntity.getValue() + "");
int request = requestEntity;
int flagRequest = request & 3;
if (flagRequest != 3) {
@@ -143,24 +131,12 @@
return;
}
-
-// String glassIdEntity = modbusTcp.readString(42003 - offset, 20);
String glassIdEntity = readString(modbusTcp, 42003 - offset);
-// String glassIdEntity = ByteReadBuff.newInstance(res, 0, false, EByteBuffFormat.CD_AB).getString(10);
- //浣犲垹浜嗭紵
log.info("闄よ啘{}鑾峰彇褰撳墠鐨勪俊鍙蜂负锛歿},鐜荤拑id:{}", cell, flagRequest, glassIdEntity);
if (null == glassIdEntity || StringUtils.isBlank(glassIdEntity)) {
-// ReadWriteEntity glassIdEntity = miloService.readFromOpcUa(cell + "glassId");
-// if (null == glassIdEntity.getValue() || StringUtils.isBlank(glassIdEntity.getValue() + "")) {
log.info("褰撳墠鏈敹鍒扮幓鐠僫d鏁版嵁锛岀粨鏉熶换鍔�");
return;
}
-
-// log.info("闄よ啘{}鑾峰彇褰撳墠鐨勭幓鐠僫d锛歿}", cell, glassIdEntity);
-// if (null == glassIdEntity.getValue() || StringUtils.isBlank(glassIdEntity.getValue() + "")) {
-// log.info("褰撳墠鏈敹鍒扮幓鐠僫d鏁版嵁锛岀粨鏉熶换鍔�");
-// return;
-// }
log.info("褰撳墠闇�瑕侀櫎鑶滅殑鐜荤拑id涓猴細{}", glassIdEntity);
//鎸夌収鐜荤拑id鑾峰彇瀵瑰簲鐨勪换鍔d
HollowGlassFormulaVO detailsVO = hollowFormulaDetailsService.queryFormulaDetailsByGlassId(glassIdEntity, null, null);
@@ -170,14 +146,11 @@
}
//鎸夌収浠诲姟id鑾峰彇瀵瑰簲鐨勯厤鏂逛俊鎭�
int Id = 0;
- List<ReadWriteEntity> ualist = new ArrayList<>();
- List<ReadWriteEntity> wordlist = new ArrayList<>();
log.info("闄よ啘{}鑾峰彇鐜荤拑{},鏄惁闄よ啘锛歿}", cell, requestEntity, detailsVO.getFilmRemove());
if (detailsVO.getFilmRemove() == 0) {
// 10111011
int sendId = request & 63;
Id = sendId + 4;
-// wordlist.add(opcPlcStorageCageHollowTask.generateReadWriteEntity(cell + "mesControl", sendId));
modbusTcp.writeUInt16(42001 - offset, sendId);
} else {
// 鍏堝皢瀵瑰簲鐨勪綅缃负0锛岃幏寰楄姹傜殑鐜荤拑鏁版嵁锛� 鐒跺悗灏嗗搴斾綅鍊� 110111011
@@ -188,21 +161,11 @@
modbusTcp.writeUInt32(42021 - offset, detailsVO.getTopRemove());
modbusTcp.writeUInt32(42023 - offset, detailsVO.getTopRemove());
modbusTcp.writeUInt32(42025 - offset, detailsVO.getTopRemove());
-// wordlist.add(opcPlcStorageCageHollowTask.generateReadWriteEntity(cell + "mesControl", sendId));
-// ualist.add(opcPlcStorageCageHollowTask.generateReadWriteEntity(cell + "glassTop", detailsVO.getTopRemove()));
-// ualist.add(opcPlcStorageCageHollowTask.generateReadWriteEntity(cell + "glassBottom", detailsVO.getBottomRemove()));
-// ualist.add(opcPlcStorageCageHollowTask.generateReadWriteEntity(cell + "glassLeft", detailsVO.getLeftRemove()));
-// ualist.add(opcPlcStorageCageHollowTask.generateReadWriteEntity(cell + "glassRight", detailsVO.getRightRemove()));
}
modbusTcp.writeUInt32(42013 - offset, (int) (detailsVO.getThickness() * 10));
modbusTcp.writeUInt32(42015 - offset, (int) (Math.max(detailsVO.getWidth(), detailsVO.getHeight())) * 10);
modbusTcp.writeUInt32(42017 - offset, (int) (Math.min(detailsVO.getWidth(), detailsVO.getHeight())) * 10);
modbusTcp.writeUInt16(42001 - offset, Id);
-// ualist.add(opcPlcStorageCageHollowTask.generateReadWriteEntity(cell + "thickness", (int) (detailsVO.getThickness() * 10)));
-// ualist.add(opcPlcStorageCageHollowTask.generateReadWriteEntity(cell + "firstLength", (int) (Math.max(detailsVO.getWidth(), detailsVO.getHeight())) * 10));
-// ualist.add(opcPlcStorageCageHollowTask.generateReadWriteEntity(cell + "secondLength", (int) (Math.min(detailsVO.getWidth(), detailsVO.getHeight())) * 10));
-// miloService.writeToOpcWord(wordlist);
-// miloService.writeToOpcUa(ualist);
return;
}
@@ -243,9 +206,6 @@
//鍚戠數姘斿彂閫佹竻妤氫俊鍙�
int sendId = request & 251;
log.info("{}鏀跺埌闄よ啘鏈篒D鎺ユ敹瀹屾垚淇″彿锛屽皢鍐欏叆鏁版嵁瀹屾垚缃�0,鍙戦�佹暟鎹负锛歿}", cell, sendId);
-// List<ReadWriteEntity> list = new ArrayList<>();
-// list.add(opcPlcStorageCageHollowTask.generateReadWriteEntity(cell + "mesControl", sendId));
-// miloService.writeToOpcWord(list);
modbusTcp.writeUInt16(42001 - offset, sendId);
}
--
Gitblit v1.8.0