a bc
a bc

Reputation: 45

Milo OPC Ua Subscription not operated at node's data change , only Interval

this milo github https://github.com/eclipse/milo

I use

ManagedSubscription subscription = ManagedSubscription.create(client);

subscription.addChangeListener(new ChangeListener() {

@Override
public void onDataReceived(List<ManagedDataItem> dataItems, List<DataValue> dataValues) {

   // I added data log code
}
});

ManagedDataItem dataItem = subscription.createDataItem(Identifiers.Server_ServerStatus_CurrentTime);
if (!dataItem.getStatusCode.isGood()) {
throw new RuntimeException("uh oh!")
}

and i attempt to change server's node data but client data log is not appear

so I fixed listener

 subscription.addDataChangeListener((items, values) -> {
            for (int i = 0; i < items.size(); i++) {
                log.info(
                    "subscription value received: item={}, value={}",
                    items.get(i).getNodeId(), values.get(i).getValue()
                );
            }
        });

but subscription is running only interval time, not data changed time

what is problem?

Upvotes: 1

Views: 565

Answers (0)

Related Questions