English(英文) | Chinese(中文)
If this helps you, please give the author a ⭐ .
Now, it is a tool for iot communication, it includes
- Siemens S7 protocol, it can access to S1500, S1200, S200smart.
- ModbusTCP protocol.
- Parse byte array data.
Add the dependency to pom.xml in the JAVA project
<dependency>
<groupId>com.github.xingshuangs</groupId>
<artifactId>iot-communication</artifactId>
<version>1.2.7</version>
</dependency>
class Demo {
public static void main(String[] args) {
// create PLC instance
S7PLC s7PLC = new S7PLC(EPlcType.S1200, "127.0.0.1");
// read and write boolean
s7PLC.writeBoolean("DB1.2.0", true);
boolean boolData = s7PLC.readBoolean("DB1.2.0");
// read and write byte
s7PLC.writeByte("DB2.1", (byte) 0x11);
byte byteData = s7PLC.readByte("DB2.1");
// close
s7PLC.close();
}
}
If you have any questions, please contact the author in the following ways, and the author will give answers in his spare time.
- QQ Group: 759101350
- QQ Private: 837820457
- Email:[email protected]
Distributed under the MIT License. See LICENSE
for more information.
@2019 - 2099 Oscura, All Rights Reserved