Avatar

Please consider registering
guest

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
Creating New OPC Server Object From Client Request
February 12, 2014
11:39, EET
Avatar
pfay
New Member
Members
Forum Posts: 1
Member Since:
February 12, 2014
sp_UserOfflineSmall Offline

Hi,

I am wondering if it is possible for a client to make a request to the server to create an new instance of an object base on a type parameter.

February 12, 2014
16:23, EET
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1026
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

Yes, that is possible. You can use AddressSpace.addNode() from the client, e.g.

ObjectAttributes nodeAttributes = new ObjectAttributes();
ExpandedNodeId parentNodeId = …
ExpandedNodeId requestedNewNodeId = …
ExpandedNodeId typeDefinitionId = …

AddNodesItem node = new AddNodesItem(parentNodeId,
Identifiers.HasComponent, requestedNewNodeId,
new QualifiedName(requestedNewNodeId.getNamespaceIndex(), NodeClass.Object,
ExtensionObject.binaryEncode(nodeAttributes), typeDefinitionId);
NodeId nodeId = client.getAddressSpace().addNode(node);

Also, you need to ensure that the server enables node management, e.g. with the Java SDK

server.getNodeManagerTable().setNodeManagementEnabled(true);

Note that the server will not by default create the structure of the object. But if you have a Java class that defines the structure, you can register that in the server, e.g.:

myNodeManager.getNodeFactory().registerTypeDefinition(
yourTypeDefinitionId, YourType.class);
Forum Timezone: Europe/Helsinki

Most Users Ever Online: 1919

Currently Online:
40 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: 726

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1525

Posts: 6456

Newest Members:

forrestdilke5, ernestoportus31, martin123, rickie5305, shaylamaggard4, rickyjuarez140, jonathonmcintyre, fannielima, kristiewinkle8, rust

Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1028, Jimmy Ni: 26, Matti Siponen: 346, Lusetti: 0

Administrators: admin: 1