这是我测试的写如和读出 以word类型为例,3001后的参数似乎是代表偏移量,但我填写的范围不能超过10,这是为何
Moka7Demo.plc.wordMoka7.S7Moka7.S7Clientjava.util.ArraysWriteWord { (String[] args) { S7Client s7Client = TYPE = s7Client = S7Client()s7Client.SetConnectionType(TYPE)s7Client.ConnectTo()[] buffer = []S7.(buffer)i = s7Client.WriteArea(S7.buffer.buffer)(i == ){ System..println(Arrays.(buffer))System..println()}{ System..println()} s7Client.Disconnect()} }Moka7Demo.plc.wordMoka7.S7Moka7.S7Clientjava.io.UnsupportedEncodingExceptionjava.util.ArraysReadWord { (String[] args) UnsupportedEncodingException { S7Client s7Client = TYPE = s7Client = S7Client()s7Client.SetConnectionType(TYPE)s7Client.ConnectTo()[] buffer = []i = s7Client.ReadArea(S7.buffer.buffer)(i == ){ System..println(Arrays.(buffer))System..println(String(buffer))System..println(S7.(buffer))System..println()}{ System..println()} s7Client.Disconnect()} }
楼主最近还看过