I found out the code in the Utgard documentation to access signals individually by defining their callback functions.
server.connect();
// add sync access, poll every 500 ms
final AccessBase access = new SyncAccess(server, 500);
access.addItem(itemId, new DataCallback() {
@Override
public void changed(Item item, ItemState state) {
System.out.println(state);
}
});
// start reading
access.bind();
// Sleeping thread infinitely to listen continuously
while(true){
Thread.sleep(10 * 1000);
}
// never comes here
access.unbind();
But, in my application I need to get signals in order of 1000s. Hence, defining 1000 callback functions wouldn't be a good approach to handle such large amount of signals.
Is their any way to get values of all 1000 signals in a single callback function ?
Please throw your views/opinions & enlighten me. Thanks !