Topic RSS
Testing the Java SDK
August 22, 2012
11:38, EEST
11:38, EEST
Jouni Aro
Moderator
Moderators
Forum Posts: 1026
Member Since:
December 21, 2011
December 21, 2011
Offline
August 23, 2012
13:26, EEST
13:26, EEST
Jouni Aro
Moderator
Moderators
Forum Posts: 1026
Member Since:
December 21, 2011
December 21, 2011
Offline
August 27, 2012
10:45, EEST
10:45, EEST
Jouni Aro
Moderator
Moderators
Forum Posts: 1026
Member Since:
December 21, 2011
December 21, 2011
Offline
It should be pretty straight forward, if you compare against readValue(). E.g.:
@Override
protected boolean writeValue(ServiceContext serviceContext,
NodeId nodeId, UaVariable node, NumericRange indexRange,
DataValue dataValue) throws StatusException {
DataItem dataItem = getDataItem(nodeId);
if (dataItem == null)
throw new StatusException(StatusCodes.Bad_NodeIdInvalid);
dataItem.setValue(dataValue.getValue().doubleValue(),
dataValue.getStatusCode());
return true;
}
protected boolean writeValue(ServiceContext serviceContext,
NodeId nodeId, UaVariable node, NumericRange indexRange,
DataValue dataValue) throws StatusException {
DataItem dataItem = getDataItem(nodeId);
if (dataItem == null)
throw new StatusException(StatusCodes.Bad_NodeIdInvalid);
dataItem.setValue(dataValue.getValue().doubleValue(),
dataValue.getStatusCode());
return true;
}
Just make sure that simulation is also disabled (in MyBigNodeManager.simulate()), since it is writing the values normally all the time.
Forum Timezone: Europe/Helsinki
Most Users Ever Online: 1919
Currently Online:
20 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 144
rocket science: 88
pramanj: 86
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 744
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1529
Posts: 6471
Newest Members:
guadalupechastai, joleenbunnell, WilliamViego, edwardobeckenbau, Charlesslota, hilda21x1388, bertZok, Bernardclila, doylenewbery, mickey21654Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1032, Jimmy Ni: 26, Matti Siponen: 349, Lusetti: 0
Administrators: admin: 1