| | |
| | | this.taskingService = taskingService; |
| | | } |
| | | |
| | | public void plcStart() { |
| | | public void plcStart() throws Exception{ |
| | | Machine machine=machineMapper.selectById(thisMachine.getId()); |
| | | String fileName=machine.getFileName(); |
| | | ModbusTcp modbusTcp1 =new ModbusTcp(machine.getIp(),machine.getPort(),fileName); |
| | |
| | | } catch (Exception e) { |
| | | log.info("交互逻辑错误"); |
| | | } |
| | | |
| | | modbusTcp1.close(); |
| | | //log.info("无可执行的条件"); |
| | | } |
| | |
| | | |
| | | @Override |
| | | public void run() { |
| | | while (this != null) { |
| | | while (true) { |
| | | try { |
| | | Thread.sleep(1000); |
| | | plcStart(); |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | }catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | } |