Menu

#16 OpcGroup.removeItem

open
nobody
None
5
2011-02-26
2011-02-26
Pazifist
No

While running Tests for understanding the behaviour of JEasyOPC, i ran into the following:

OpcGroup group = new OpcGroup("MyTEstBenchgroup", true, 5, 0.0f);
server.addGroup(group);
server.registerGroup(group);
OpcItem item1, item2, item3, item4;
//initialising items...
group.addItem(item1); group.addItem(item2); group.addItem(item3); group.addItem(item4);
server.updateGroups();
server.registerItem(group, item1); server.registerItem(group, item2); server.registerItem(group, item3); server.registerItem(group, item4);
OpcGroup result = server.synchReadGroup(group);
//so far, so good, no problems up to here

//now i try to remove items from the Group:
server.unregisterItem(group, item1);
group.removeItem(item1);
server.updateGroups();
OpcGroup result = server.synchReadGroup(group);

This leads to a "shift" in the Values:
item2 -> no value
item3 -> value of item2
item4 -> value of item3

If i try to remove item4 in the same way, no problems occur;
when removing an item in the middle, eg item2, a similar shift of values occurs.

Hope this is explanatory enough.
If i can help with more examples, or similar, please contact me via sourceforge.

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.