【问题标题】:Can’t write amount of data to kepware无法将大量数据写入kepware
【发布时间】:2019-03-24 09:01:46
【问题描述】:

当我通过milo向kepware服务器写入数据时,有时有些数据无法写入成功。但是服务器返回了

状态码{name=Good, value=0x00000000, quality=good}

服务器没有显示我写的数据。
在此先感谢您的帮助

  1. 单线程不起作用。
  2. 开始写入数据时创建新客户端。
  3. 只有一个客户端会响应写作。

所有这些都失败了。

 mWriteClient = new OPCUAClientRunner(KSOPCUASubscription.this).createClient();
                mWriteClient.connect().get();
            } catch (Exception e) {
                e.printStackTrace();
                logger.error("OPCUAClient connect Exception", e);
                return ;
            }
            logger.info("Wrote identifier: " + identifier);
            List<NodeId> nodeIds = ImmutableList.of(new NodeId(namespaceIndex, identifier));//Int32"t|bbb"

            Variant v = new Variant(value);

            // don't write status or timestamps
            DataValue dv = new DataValue(v, null, null);
            logger.info("OPCUAClient begin write");
            // write asynchronously....
            CompletableFuture<List<StatusCode>> f =
                    mWriteClient.writeValues(nodeIds, ImmutableList.of(dv));

            // ...but block for the results so we write in order
            List<StatusCode> statusCodes = null;
            try {
                statusCodes = f.get();
            } catch (InterruptedException e) {
                e.printStackTrace();
                logger.error("OPCUAClient write get response Exception", e);
            } catch (ExecutionException e) {
                e.printStackTrace();
                logger.error("OPCUAClient write get response Exception", e);
            }
            StatusCode status = statusCodes.get(0);
            logger.info("Wrote status: " + status.toString());
            if (status.isGood()) {
                logger.info("Wrote '{}' to nodeId={}", v, nodeIds.get(0));
            }

【问题讨论】:

    标签: opc milo


    【解决方案1】:

    除非您实际上没有写入您声称正在写入的值,否则来自服务器的 StatusCode 为 Good 意味着您在客户端没有做错任何事情。

    也许您可以捕获与 Wireshark 的交换,以进一步证明问题出在服务器端。

    【讨论】:

      猜你喜欢
      • 2017-02-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-11-12
      相关资源
      最近更新 更多