Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [milo-dev] Error fetching data from Rockwell OPC UA Server using Eclipse Milo JAva Client

It's possible that browsing via the Prosys client actually triggers the creation of the Nodes in that server but I don't know for sure.

I would get a Wireshark capture of your Milo-based client trying to read these Nodes as well as one of Prosys client reading the same Nodes and verify that the requested NodeIds match exactly.

On Thu, Feb 25, 2021 at 6:13 AM <milind.barve@xxxxxxxxxxxxxxx> wrote:

I have built a Java Application to fetch data from OPC UA Server. I have used Eclipse Milo UA Client SDK to build the client. I am facing a problem in OpcUaClient.readValues method. I am passing a list of NodeId created from Tags defined and if I traverse the DataValue array returned by readValues method, I get follwing error for some of the elements

DataValue{value=Variant{value=null}, status=StatusCode{name=Bad_NodeIdUnknown, value=0x80340000, quality=bad},

 

Sudo code looks like

List<NodeId> nodeIds = new ArrayList<NodeId>();

List<Parameter> parameters = device.getParameters();

for (int i = 0; i < parameters.size(); i++) {

    Parameter parameter = parameters.get(i);

                           

    nodeIds.add(new NodeId(device.getNsID(),  parameter.getTagName()));

                           

}

List<DataValue> values = client.readValues( 0.0, TimestampsToReturn.Both, nodeIds).get();

for (int i = 0; i < values .size(); i++) {

    DataValue dvalue = values.get(i);

    if( dvalue.getValue().getValue() != null) {

        Integer intValue =  (Integer) values.get(i).getValue().getValue();

                           

        logger.info("captured Value is  {}", value);

                                       

    }

    else

    {

       logger.error("Error fetching value for {} , {}", parameter.getName(),dvalue.toString());

    }

}

The error is flagged from else clause.

My application is running on a separate computer than the SCADA Server ( OPC UA). A peculiar behavior observed is , If I use ProSys Client to check value of failing tag, and if I re-run my application, data is fetched correctly. I am completely clueless about how ProSys client and my application is related. Is prosys client triggering something on the server side to load the tags in some cache... Any clues/pointers will help. Thanks in advance.

 

_______________________________________________
milo-dev mailing list
milo-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/milo-dev

Back to the top