Please consider registering

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —

— Match —

— Forum Options —

Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Read commands problem
March 24, 2014
13:15, EET
Forum Posts: 8
Member Since:
March 20, 2014
sp_UserOfflineSmall Offline


I am evaluating the Prosys JAVA SDK and I try to retrieve the Current Time of the My Ignition OPC Server …
Using the Prosys OPC Client, I can select the Node “Objects/Server/ServerStatus/CurrentTime” and I can see in the “attribute and reference” list the field Value (which is in fact a node) and finally the Value representing the currenttime.

However, I can”t get that currenttime value from java code …. When I reading the Attribute Value … I got this error:

com.prosysopc.ua.StatusException: Bad_AttributeIdInvalid (0x80350000) “The attribute is not supported for the specified Node.”

What’s wrong?

String browsePathString = "Objects/Server/ServerStatus/CurrentTime";
NodeId nodeId = Identifiers.RootFolder;

List<RelativePathElement> browsePath = new ArrayList<RelativePathElement>();
for (String s : browsePathString.split("/")) {
final QualifiedName targetName = QualifiedName.parseQualifiedName(s);
browsePath.add(new RelativePathElement(Identifiers.HierarchicalReferences, false, true, targetName));
// The result may always contain several targets (if there are nodes with the same browseName), although normally only one is expected

BrowsePathTarget[] pathTargets;
try {
pathTargets = client.getAddressSpace().translateBrowsePathToNodeId(nodeId,browsePath.toArray(new RelativePathElement[0]));

for (BrowsePathTarget pathTarget : pathTargets) {
String targetStr = "Target: " + pathTarget.getTargetId();

if (!pathTarget.getRemainingPathIndex().equals(UnsignedInteger.MAX_VALUE))
targetStr = targetStr + " – RemainingPathIndex: "+ pathTarget.getRemainingPathIndex();

// !!!This call will generate an exception!!!
DataValue data = client.readAttribute(nodeId, Attributes.Value);
String currentTime = data.getValue().toString();

catch (Exception e} {

Thanks a lot for your help!

March 24, 2014
13:55, EET
Jouni Aro
Forum Posts: 988
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

You are not using the nodeId that you get from the pathTarget. Since that is an ExpandedNodeId, you need to convert it with client.getNamespaceTable().toNodeId().

But in general, it is easier to use the known NodeId (which are all defined in Identifiers) directly, so you can just call:

DataValue data = client.readValue(Identifiers.Server_ServerStatus_CurrentTime);
Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
6 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 130

pramanj: 86

ibrahim: 75

rocket science: 72

Francesco Zambon: 62

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

fred: 41

Member Stats:

Guest Posters: 0

Members: 651

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1415

Posts: 6035

Newest Members:

u310498, ntd, francescac, yahya95, leomajoe, Gus, sdfsdfsdfsd, riatuccker

Moderators: Jouni Aro: 988, Otso Palonen: 32, Tuomas Hiltunen: 5, Pyry: 1, Petri: 0, Bjarne Boström: 941, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 25, Teppo Uimonen: 21, Markus Johansson: 42, Niklas Nurminen: 0, Matti Siponen: 288, Lusetti: 0, Ari-Pekka Soikkeli: 5

Administrators: admin: 1