| | |
| | | |
| | | public DevpThread(Slave slave) { |
| | | this.slave = slave; |
| | | connect(); |
| | | } |
| | | |
| | | @Override |
| | | @SuppressWarnings("InfiniteLoopStatement") |
| | | public void run() { |
| | | connect(); |
| | | while (true) { |
| | | try { |
| | | int step = 1; |
| | |
| | | Slave slave = new Slave(); |
| | | slave.setIp("192.168.2.125"); |
| | | DevpThread devpThread = new DevpThread(slave); |
| | | devpThread.connect(); |
| | | devpThread.read(); |
| | | // 写 |
| | | StaProtocol staProtocol = devpThread.getStation().get(2); |
| | | staProtocol.setWorkNo((short) 0); |
| | | staProtocol.setStaNo((short) 1001); |
| | | StaProtocol staProtocol = devpThread.getStation().get(1); |
| | | staProtocol.setWorkNo((short) 232); |
| | | staProtocol.setStaNo((short) 6); |
| | | staProtocol.setAutoing(true); |
| | | staProtocol.setEmptyMk(true); |
| | | staProtocol.setInEnable(true); |