diff --git a/src/main/java/com/zzjee/plc/controller/WmsPlcController.java b/src/main/java/com/zzjee/plc/controller/WmsPlcController.java index fcccaaa8..1ba03753 100644 --- a/src/main/java/com/zzjee/plc/controller/WmsPlcController.java +++ b/src/main/java/com/zzjee/plc/controller/WmsPlcController.java @@ -1,6 +1,8 @@ package com.zzjee.plc.controller; import HslCommunication.Core.Types.OperateResult; +import HslCommunication.Profinet.Omron.OmronCipNet; +import HslCommunication.Profinet.Omron.OmronHostLinkOverTcp; import HslCommunication.Profinet.Siemens.SiemensPLCS; import HslCommunication.Profinet.Siemens.SiemensS7Net; import com.zzjee.plc.entity.WmsPlcEntity; @@ -222,7 +224,6 @@ public class WmsPlcController extends BaseController { } if (wmsPlc != null) { long start = System.currentTimeMillis(); - SiemensPLCS siemensPLCS = SiemensPLCS.S200Smart; SiemensS7Net siemensS7Net = null; siemensS7Net = new SiemensS7Net(siemensPLCS); diff --git a/src/test/java/org/jeecgframework/test/demo/ControllerTestDemo.java b/src/test/java/org/jeecgframework/test/demo/ControllerTestDemo.java index 3f3736e4..8c83b54e 100644 --- a/src/test/java/org/jeecgframework/test/demo/ControllerTestDemo.java +++ b/src/test/java/org/jeecgframework/test/demo/ControllerTestDemo.java @@ -5,6 +5,9 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. import static org.springframework.test.web.servlet.setup.MockMvcBuilders.webAppContextSetup; +import HslCommunication.Core.Types.OperateResult; +import HslCommunication.Core.Types.OperateResultExOne; +import HslCommunication.Profinet.Omron.OmronHostLinkOverTcp; import org.jeecgframework.AbstractUnitTest; import org.junit.Before; import org.junit.Test; @@ -29,6 +32,13 @@ public class ControllerTestDemo extends AbstractUnitTest{ //测试登录 @Test public void testLogin() throws Exception { + + OmronHostLinkOverTcp omronHostLinkOverTcp = new OmronHostLinkOverTcp(); + omronHostLinkOverTcp.setIpAddress("172.17.140.51"); + omronHostLinkOverTcp.setPort(9600); + OperateResult operateResult = omronHostLinkOverTcp.ConnectServer(); + final OperateResultExOne d1111 = omronHostLinkOverTcp.Read("D1111", (short) 1); + omronHostLinkOverTcp.Write("D1111",1); // yyUtil.getProduct(); // Map paramMap = new HashMap(); // paramMap.put("formDate","2017-01-01");