Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [milo-dev] Problem reading variable value

From the information you've provided I can only conclude this is a problem with the server, not with the client.

Can you read these variables using other UA client software (e.g. UaExpert)? 


On Tue, Jul 24, 2018 at 6:17 AM, Joaquim Torres <joaquimtorres@xxxxxxxxxxxxxxxxxxx> wrote:
Hello,

I'm writing a Java client to read variable values from a opcua server that is a gateway to several machines. I can read the values from the server variables, but not from the machine variables. The machine variables values allways return null.

The machine variables have ns=2, the server variables have ns=0.

The NodeId for the variable I'm trying to read is created with the following code:

public static final NodeId CycleCounter = new NodeId(Unsigned.ushort(2), "47.CycleCounter");

A modified ReadExample program called ReadTest:

    @Override
    public void run(OpcUaClient client, CompletableFuture<OpcUaClient> future) throws Exception {
        // synchronous connect
        client.connect().get();

        VariableNode node2 = client.getAddressSpace().createVariableNode(HuskyIds.CycleCounter);
        DataValue value2 = node2.readValue().get();
        logger.info("CycleCounter = {}   {}", value2.getValue().getValue(), value2.getStatusCode());
        future.complete(client);
    }

prints:

[main] INFO org.eclipse.milo.examples.client.ReadTest - CycleCounter = null   StatusCode{name=Good, value=0x00000000, quality=good}

I interpret this log as the server recognizing the variable Id as valid, but the return value is still null.

The machine variables have ns=2. Is this the problem? If so, How can I read their values?

Thank you.
Joaquim Torres

_______________________________________________
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