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

Also a long shot, but your UaExpert screenshot is actually showing you getting values by *subscribing*, not by reading.

If you scroll down in the attributes pane on the right you'll be able to see the value attribute as it was obtained via the Read service.

Wireshark captures should reveal all, though. Feel free to upload and link them here and I'll look at them as well.

On Tue, Jul 24, 2018 at 8:25 AM, Joaquim Torres <joaquimtorres@xxxxxxxxxxxxxxxxxxx> wrote:

Kevin,

Yes, I’m sure I’m connected to the actual server, because I can read server variables and the server acknowledges the variables’ names.

I’ll try wireshark.

Thank you,

Joaquim Torres

 

 

From: milo-dev-bounces@xxxxxxxxxxx [mailto:milo-dev-bounces@eclipse.org] On Behalf Of Kevin Herron
Sent: terça-feira, 24 de julho de 2018 16:05


To: milo developer discussions
Subject: Re: [milo-dev] Problem reading variable value

 

Assuming HuskyIds.CycleCounter is the same NodeId I see defined in your example code it all looks good...

 

Maybe you can use Wireshark to capture the read happening with UaExpert to the read happening with Milo.

 

There must be some difference that is causing the server to return a null value.

 

One obvious thing: you've modified the example to connect to your actual server and not the Milo example server yes?

 

On Tue, Jul 24, 2018 at 7:50 AM, Joaquim Torres <joaquimtorres@microprocessador.pt> wrote:

Kevin,

Thank you for your response. I’ve already tried everything I could think of.

I can read all the variables with UaExpert. I attach a screen print.

As I told before, I can read server variables, with ns=0, but not the machine variables, which have ns=2. I cannot read any variables from the machines, either variables directly associated with the machine, like description or cycle counter, or process variables, like cycle time.

Also I can browse all the objects in the server, even those that belong to the machines. I attach a file nodes.txt with the output of a slightly modified version of BrowseExample that writes the log to a file.

Best regards,

Joaquim Torres

 

 

From: milo-dev-bounces@xxxxxxxxxxx [mailto:milo-dev-bounces@eclipse.org] On Behalf Of Kevin Herron
Sent: terça-feira, 24 de julho de 2018 14:58
To: milo developer discussions
Subject: 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@microprocessador.pt> 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

 


_______________________________________________
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

 


_______________________________________________
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