我总是收到错误消息
Exception in thread "main" UaMethodException: status=Bad_NotFound, message=A requested item was not found or a search operation ended without success..
要以读模式打开文件,我必须将字节中的第一位设置为1。我无法做到这一点。
val nodeId = new NodeId(2, "Demo.Files.readwrite.txt")
val client: Option[OpcUaClient] = OpcConnector.createOpcClients()
val objectNode = client.get.getAddressSpace.getObjectNode(nodeId)
val x = new QualifiedName(0, "Open")
val method = objectNode.getMethod(x)
val b: Byte = 1
val inputs: Array[Variant] = Array(new Variant(b))
val outputs: Array[Variant] = method.call(inputs)
private val logger = LoggerFactory.getLogger(getClass)
logger.info("Input values: " + inputs.mkString("Array(", ", ", ")"))
logger.info("Output values: " + outputs.mkString("Array(", ", ", ")"))
我尝试将B声明为字节,并将b设置为1以获得“00000001”。
1条答案
按热度按时间8yparm6h1#
引发此异常的可能是
objectNode.getMethod(x)
...你能用Wireshark捕获这个吗?你确定你有正确的对象节点吗?