如何从 DB560 中读取来自 PLC 的字符串,偏移量为 0.0,大小为 12 字节。垃圾值出现在输出端。
S7Client client = new S7Client();
client.SetConnectionType (S7.S7_BASIC);
int res = client.ConnectTo("192.168.0.1", 0, 1);
byte[] data = new byte[12];
client.ReadArea(S7.S7AreaDB, 560, 0, 12, data);
String ret = S7.GetStringAt(data,0,12);
System.out.println(ret);