优化日志,方便后续分析

This commit is contained in:
caixiang
2023-08-18 14:22:53 +08:00
parent 72aae5c439
commit 1704b2c37b
28 changed files with 3273 additions and 574 deletions

View File

@@ -36,5 +36,6 @@
</dependency>
<!-- retry 结束 -->
</dependencies>
</project>

View File

@@ -27,7 +27,10 @@ public enum S7Client {
// S7_1200("192.168.0.52",0,1,1,PlcVarActual.HeartBeatFor1200),
// S7_15001("192.168.0.51",0,1,1),
// S7_1500("192.168.0.51",0,1,1),
S7_KUKA("10.10.3.158",0,1,2),
S7_DDJ1("10.10.3.158",0,1,2),
S7_DDJ2("10.10.3.158",0,1,2),
S7_DDJ3("10.10.3.158",0,1,2),
S7_DDJ4("10.10.3.158",0,1,2),
//1500 机架-0 插槽-1
//后续 在这里扩展 多PLC应用。
;

View File

@@ -27,6 +27,7 @@ import java.util.Map;
*/
public enum S7ParamErrorCode {
ERROR_0x0000((short) 0x0000, "No error"),
ERROR_0x0110((short) 0x0110, "Invalid block number"),
ERROR_0x0111((short) 0x0111, "Invalid request length"),

View File

@@ -15,6 +15,8 @@ limitations under the License.
*/
package com.cnbm.s7.s7connector.exception;
import io.swagger.models.auth.In;
/**
* The Class S7Exception is an exception related to S7 Communication
*/
@@ -23,6 +25,17 @@ public final class S7CheckResultException extends RuntimeException {
/** The Constant serialVersionUID. */
private static final long serialVersionUID = -4761415733559374116L;
public static void main(String[] args) {
try {
String str = null;
str.substring(0,17);
}catch (Throwable e){
e.printStackTrace();
System.out.println("标签打印Event--- 出现异常 :"+e.toString());
}
}
/**
* Instantiates a new s7 exception.
*/