| | |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | byte[] getplcvlues = S7control.getinstance().ReadByte(plcParameterObject.getPlcAddressBegin(), plcParameterObject.getPlcAddressLength()); |
| | | plcParameterObject.setPlcParameterList(getplcvlues); |
| | | // int index = plcParameterObject.getPlcParameter("conveyorVelocity(AutoFAST)").getAddressIndex(); |
| | | byte[] getplcvlues = S7control.getinstance().ReadByte(plcParameterObject.getPlcAddressBegin(), plcParameterObject.getPlcAddressLength()); |
| | | |
| | | //byte[] getplcvlues = {0x01, 0x02, 0x03, 0x04,0x01, 0x02, 0x03, 0x04,0x01, 0x02, 0x03, 0x04,0x01, 0x02}; |
| | | |
| | | plcParameterObject.setPlcParameterList(getplcvlues); |
| | | |
| | | int index = plcParameterObject.getPlcParameter("A01ID").getAddressIndex(); |
| | | System.out.println(index); |
| | | plcParameterObject.getPlcParameter("A01ID").getAddress(index); |
| | | System.out.println(plcParameterObject.getPlcParameter("A01ID").getAddress(index)); |
| | | |
| | | // S7control.getinstance().WriteWord(plcParameterObject.getPlcParameter("conveyorVelocity(AutoFAST)").getAddress(index), (short) 100); |
| | | |
| | | List<String> addresses = new ArrayList<>(); |
| | | |
| | | addresses.add("conveyorVelocity(AutoFAST)"); |
| | | addresses.add("conveyorVelocity(AutoSLOW)"); |
| | | addresses.add("conveyorVelocity(Manual)"); |
| | | addresses.add("A01A02TURNJOGVelocity"); |
| | | addresses.add("A01A02TRAVELJOGVelocity"); |
| | | addresses.add("A01ID"); |
| | | //addresses.add("conveyorVelocity(AutoSLOW)"); |
| | | // addresses.add("A01A02TURNJOGVelocity"); |
| | | // addresses.add("A01A02TRAVELJOGVelocity"); |
| | | |
| | | |
| | | System.out.println(plcParameterObject.getPlcParameterValues(addresses)); |
| | |
| | | |
| | | jsonObject.append("params", plcParameterObject.getPlcParameterValues(addresses)); |
| | | jsonObject.append("fanzhuan", plcParameterObject.getPlcParameter("conveyorVelocity(AutoFAST)").getValue()); |
| | | jsonObject.append("xiaoche", plcParameterObject.getPlcParameter("").getValue()); |
| | | // jsonObject.append("xiaoche", plcParameterObject.getPlcParameter("").getValue()); |
| | | |
| | | |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("Parameter1"); |
| | | if (sendwServer != null) { |
| | |
| | | webserver.sendMessage(jsonObject.toString()); |
| | | |
| | | |
| | | |
| | | if (webserver != null) { |
| | | |
| | | List<String> messages = webserver.getMessages(); |