omron plc

master
erzhongxmu 2023-03-08 15:19:57 +08:00
parent 779226ae1d
commit be53ce8c33
2 changed files with 12 additions and 1 deletions

View File

@ -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);

View File

@ -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<byte[]> d1111 = omronHostLinkOverTcp.Read("D1111", (short) 1);
omronHostLinkOverTcp.Write("D1111",1);
// yyUtil.getProduct();
// Map<String, Object> paramMap = new HashMap<String, Object>();
// paramMap.put("formDate","2017-01-01");