Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

S7-1500 read byte exception: object does not exist #23

Closed
suna996 opened this issue Sep 18, 2024 · 2 comments
Closed

S7-1500 read byte exception: object does not exist #23

suna996 opened this issue Sep 18, 2024 · 2 comments

Comments

@suna996
Copy link

suna996 commented Sep 18, 2024

你好, 我在连接S7-1500并读取DB数据时, 调用readByteapi发生异常

单元测试代码

public void test3() {
    S7PLC s7PLC = new S7PLC(EPlcType.S1500, "10.120.38.x");
    // print message
    s7PLC.readByte("DB169.1");
    s7PLC.close();
}

异常信息如下

com.github.xingshuangs.iot.net.client.TcpClientBasic - Create and connect S7 server [/10.120.38.x:102] succeed
com.github.xingshuangs.iot.protocol.s7.service.PLCNetwork - PLC[S1500] handshake success, rack[0],slot[1],PDULength[960]
      
com.github.xingshuangs.iot.exceptions.S7CommException: Return [1] result exception, cause: object does not exist
    at com.github.xingshuangs.iot.protocol.s7.service.PLCNetwork.checkPostedCom(PLCNetwork.java:343)
    at com.github.xingshuangs.iot.protocol.s7.service.PLCNetwork.readFromServer(PLCNetwork.java:219)
    at com.github.xingshuangs.iot.protocol.s7.service.PLCNetwork.lambda$readS7Data$2(PLCNetwork.java:387)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
    at com.github.xingshuangs.iot.protocol.s7.service.PLCNetwork.readS7Data(PLCNetwork.java:375)
    at com.github.xingshuangs.iot.protocol.s7.service.PLCNetwork.readS7Data(PLCNetwork.java:414)a
    at com.github.xingshuangs.iot.protocol.s7.service.S7PLC.readByte(S7PLC.java:133)
    at com.github.xingshuangs.iot.protocol.s7.service.S7PLC.readByte(S7PLC.java:144)
    at plc.PlcTest.test3(PlcTest.java:45)

请问异常信息中的object does not exist具体是什么, 以及我应该如何正确读写DB数据, 谢谢

@suna996
Copy link
Author

suna996 commented Sep 18, 2024

JDK版本: 15
项目版本: 1.5.2

@xingshuangs
Copy link
Owner

确认地址是否存在

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants