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

java在使用AB CIP协议API批量读取的时候长度超过30会报错误“目标收到一个无效长度的信息。” #34

Open
sjdGitHub opened this issue Nov 29, 2022 · 2 comments

Comments

@sjdGitHub
Copy link

您好,我在使用AllenBradleyNet.Read方法进行AB plc测试批量读取的时候,发现读取点位数没超过30的时候能够正常读取,但是一超过30就会报“目标收到一个无效长度的信息。”这样的错误信息,请问,这是因为长度做了限制吗?如果做了限制的话,假设plc有非常多的点位又该怎么去一次性读取呢?以下是方法测试的调试过程截图:
成功的:
success
失败的:
fail

@dathlin
Copy link
Owner

dathlin commented Nov 29, 2022

这个是协议层的限制,你这里既然是同一个标签,直接读取数组比较合适
比如你的类型是int,那么使用 ReadInt32("DINT[1001]", 30);

@sjdGitHub
Copy link
Author

这个是协议层的限制,你这里既然是同一个标签,直接读取数组比较合适 比如你的类型是int,那么使用 ReadInt32("DINT[1001]", 30);

谢谢您的回复,这里这一批确实是同一个标签,但是实际的plc中还是有很多不是同一个标签以及很多不连续的,那只能分批去处理咯?

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