In order to manage the set of items to be acquired in a UA Device I am trying to use the hooks:
@Override public void onDataItemsCreated(List dataItems) { subscriptionModel.onDataItemsCreated(dataItems); } @Override public void onDataItemsModified(List dataItems) { subscriptionModel.onDataItemsModified(dataItems); } @Override public void onDataItemsDeleted(List dataItems) { subscriptionModel.onDataItemsDeleted(dataItems); }
But these methods never fire in the debugger when referencing/displaying the datapoints in the application. So I tried to use these hooks:
`/**
- Called when a new item (tag) is added to this device.
*/
@Override
public void onDeviceItemAdded(DeviceItem item) {
logger.info("Item added for data acquisition: {}", item.getNodeId());
super.onDeviceItemAdded(item);
}``/**
- Called when an item becomes active (Ignition client starts subscribing to it).
*/
@Override
public void onDeviceItemActivated(DeviceItem item) {
logger.info("Item activated: {}", item.getNodeId());
// You could start polling or reading hardware here.
super.onDeviceItemActivated(item);
}``/**
- Called when the item is deactivated (no subscribers).
*/
@Override
public void onDeviceItemDeactivated(DeviceItem item) {
logger.info("Item deactivated: {}", item.getNodeId());
super.onDeviceItemDeactivated(item);
}`
But the corresonding references don't resolve in the POM:
<dependency>
<groupId>com.inductiveautomation.ignition</groupId>
<artifactId>opc-ua</artifactId>
<version>8.3.4</version>
<scope>provided</scope>
</dependency>
<!-- XOPC Driver API (DeviceItem, DriverContext, etc.) -->
<dependency>
<groupId>com.inductiveautomation.ignition</groupId>
<artifactId>xopc-driver-api</artifactId>
<version>8.3.6</version>
<scope>provided</scope>
</dependency>
Which is the correct way to be informed of items being requested for data updates?
Please advise