| | |
| | | this.slave = slave; |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | ArrayList<Integer> staNos = staNos1; |
| | | System.out.println(staNos.indexOf(129)); |
| | | System.out.println(staNos.size()); |
| | | for (int i = 0; i < staNos.size(); i++) { |
| | | // System.out.println(i*2); |
| | | // System.out.println(i*2 + 200); |
| | | // System.out.println(i); |
| | | } |
| | | int index = staNos.indexOf(128); |
| | | System.out.println(index * 2); |
| | | System.out.println(index * 2 + 200); |
| | | } |
| | | |
| | | |
| | | private ArrayList<Integer> getStaNo() { |
| | | switch (slave.getId()) { |
| | |
| | | siemensS7Net.ConnectClose(); |
| | | } |
| | | |
| | | // public static void main(String[] args) throws Exception { |
| | | // DevpSlave slave = new DevpSlave(); |
| | | // slave.setIp("192.168.2.125"); |
| | | // SiemensDevpThread devpThread = new SiemensDevpThread(slave); |
| | | // devpThread.connect(); |
| | | // devpThread.read(); |
| | | // // 写 |
| | | // StaProtocol staProtocol = devpThread.getStation().get(1); |
| | | // staProtocol.setWorkNo((short) 232); |
| | | // staProtocol.setStaNo((short) 6); |
| | | // staProtocol.setAutoing(true); |
| | | // staProtocol.setEmptyMk(true); |
| | | // staProtocol.setInEnable(true); |
| | | // devpThread.write(staProtocol); |
| | | // System.out.println("----------------------------------------"); |
| | | // // 读 |
| | | // devpThread.read(); |
| | | // System.out.println(JSON.toJSONString(devpThread.station)); |
| | | // |
| | | // } |
| | | |
| | | } |