Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[milo-dev] Reply: Write node value error

I modified WriteExample.java, and wrote node value through KEP Server.
In KEP Server the node data type is Word, value is 2500, I want to modify the value to 3000.
This is the souce code :
@Override
public void run(OpcUaClient client, CompletableFuture<OpcUaClient> future) throws Exception {
// synchronous connect
client.connect().get();
List<NodeId> nodeIds = ImmutableList.of(new NodeId(2, "ChannelTest.DeviceTest.Tag190"));
Variant v = new Variant((short)3000);
DataValue dv = new DataValue(v, null, null);
CompletableFuture<StatusCode> f = client.writeValue(nodeIds.get(0), dv);
StatusCode status = f.get();

if (status.isGood()) {
logger.info("Wrote '{}' to nodeId={} success", v, nodeIds.get(0));
}
else
logger.info("Wrote '{}' to nodeId={} failed", v, nodeIds.get(0));

future.complete(client);
}

How to set values type in Eclipse Milo when writing Node?

------------------------------------------------------------------
发件人:Kevin Herron <kevinherron@xxxxxxxxx>
发送时间:2017年3月29日(星期三) 23:00
收件人:george.ray <george.ray@xxxxxxxxxx>; milo developer discussions <milo-dev@xxxxxxxxxxx>
主 题:Re: [milo-dev] Write node value error

If you post your code I could tell you more, but OPC UA requires that you write values of the correct type for the Node you're writing to.

On Wed, Mar 29, 2017 at 3:30 AM, george.ray <george.ray@xxxxxxxxxx> wrote:
Hi,

I am testing write node value function by WriteExample, but getting “StatusCode{name=Bad_TypeMismatch, value=0x80740000, quality=bad}” error.
What's the reseason of this issue? Maybe the value type is error, but I don't known how to set the type when writing value.

Thanks!

Best regards,
George Ray

_______________________________________________
milo-dev mailing list
milo-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/milo-dev




Back to the top