| | |
| | | } |
| | | s7PLC.writeMultiData(addressWrite); |
| | | } |
| | | /** |
| | | * 按指定的地址 写入多个byte |
| | | * |
| | | * @param address 地址 |
| | | * @param datas byte的值 |
| | | */ |
| | | public void WriteByte(String address, byte[] datas) { |
| | | if (s7PLC==null) |
| | | return; |
| | | // s7PLC.write(address, data); |
| | | s7PLC.writeByte(address, datas); |
| | | } |
| | | |
| | | /** |
| | | * 按指定的地址 读取word结果集 |
| | |
| | | List<String> addresslist = GetAddressList(address, count, 16); |
| | | return s7PLC.readInt16(addresslist); |
| | | } |
| | | /** |
| | | * 按指定的地址 读取byte结果集 |
| | | * |
| | | * @param address 地址 |
| | | * @param count 连续读多少个byte |
| | | * @return 结果 |
| | | */ |
| | | public byte[] ReadByte(String address, int count) { |
| | | if (s7PLC==null) |
| | | return null; |
| | | |
| | | // List<String> addresslist = GetAddressList(address, count, 16); |
| | | return s7PLC.readByte(address,count); |
| | | } |
| | | |
| | | /** |
| | | * 按指定的地址 按bit位 0 flase 1 true 读取结果 |