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
created Node can't be populated with respective references of its type definiton node ?
April 20, 2016
10:48, EEST
Avatar
khalid_shah
Member
Members
Forum Posts: 6
Member Since:
April 12, 2016
sp_UserOfflineSmall Offline

The “ProgramStateMachineType” which is the subtype of finite stateMachieType have the following 29 reffernces.

0 – ProgramDiagnostics: ProgramDiagnosticType (ReferenceType=HasComponent, BrowseName=ProgramDiagnostics)
1 – Ready: StateType (ReferenceType=HasComponent, BrowseName=Ready)
2 – Running: StateType (ReferenceType=HasComponent, BrowseName=Running)
3 – Suspended: StateType (ReferenceType=HasComponent, BrowseName=Suspended)
4 – Halted: StateType (ReferenceType=HasComponent, BrowseName=Halted)
5 – HaltedToReady: TransitionType (ReferenceType=HasComponent, BrowseName=HaltedToReady)
6 – ReadyToRunning: TransitionType (ReferenceType=HasComponent, BrowseName=ReadyToRunning)
7 – RunningToHalted: TransitionType (ReferenceType=HasComponent, BrowseName=RunningToHalted)
8 – RunningToReady: TransitionType (ReferenceType=HasComponent, BrowseName=RunningToReady)
9 – RunningToSuspended: TransitionType (ReferenceType=HasComponent, BrowseName=RunningToSuspended)
10 – SuspendedToRunning: TransitionType (ReferenceType=HasComponent, BrowseName=SuspendedToRunning)
11 – SuspendedToHalted: TransitionType (ReferenceType=HasComponent, BrowseName=SuspendedToHalted)
12 – SuspendedToReady: TransitionType (ReferenceType=HasComponent, BrowseName=SuspendedToReady)
13 – ReadyToHalted: TransitionType (ReferenceType=HasComponent, BrowseName=ReadyToHalted)
14 – Start: [Method] (ReferenceType=HasComponent, BrowseName=Start)
15 – Suspend: [Method] (ReferenceType=HasComponent, BrowseName=Suspend)
16 – Resume: [Method] (ReferenceType=HasComponent, BrowseName=Resume)
17 – Halt: [Method] (ReferenceType=HasComponent, BrowseName=Halt)
18 – Reset: [Method] (ReferenceType=HasComponent, BrowseName=Reset)
19 – CurrentState: FiniteStateVariableType (ReferenceType=HasComponent, BrowseName=CurrentState)
20 – LastTransition: FiniteTransitionVariableType (ReferenceType=HasComponent, BrowseName=LastTransition)
21 – FinalResultData: BaseObjectType (ReferenceType=HasComponent, BrowseName=FinalResultData)
22 – Deletable: PropertyType (ReferenceType=HasProperty, BrowseName=Deletable)
23 – InstanceCount: PropertyType (ReferenceType=HasProperty, BrowseName=InstanceCount)
24 – Creatable: PropertyType (ReferenceType=HasProperty, BrowseName=Creatable)
25 – MaxRecycleCount: PropertyType (ReferenceType=HasProperty, BrowseName=MaxRecycleCount)
26 – MaxInstanceCount: PropertyType (ReferenceType=HasProperty, BrowseName=MaxInstanceCount)
27 – RecycleCount: PropertyType (ReferenceType=HasProperty, BrowseName=RecycleCount)
28 – AutoDelete: PropertyType (ReferenceType=HasProperty, BrowseName=AutoDelete)

when i create a node of object type and select its type defination as “ProgramStateMachineType” then it should be populated with all these references.. but when i create
a node with this type definition it is empty 🙁 . my code is below

NodeId typeDefinition=Identifiers.ProgramStateMachineType;
NodeClass nodeClass=NodeClass.Object;
ObjectAttributes objectAttributes=new ObjectAttributes();
objectAttributes.setDescription(LocalizedText.english(“I am a Object Node”));
objectAttributes.setSpecifiedAttributes(NodeAttributesMask.getMask(
NodeAttributesMask.Description,
NodeAttributesMask.DisplayName,
NodeAttributesMask.UserWriteMask,
NodeAttributesMask.WriteMask));
objectAttributes.setUserWriteMask(UnsignedInteger.ONE);
objectAttributes.setWriteMask(UnsignedInteger.ONE);

NodeAttributes nodeAttributes= objectAttributes;
String NameSpaceIndex=2;
String name=”MyMachine”;
NodeId newNodeId = new NodeId(NameSpaceIndex,name);
QualifiedName browseName=new QualifiedName(NameSpaceIndex,name);
nodeAttributes.setDisplayName(new LocalizedText(name));
NodeId referenceTypeId =Identifiers.HasComponent;
NodeId parentNode= MyObjects ; // Root -> Objects -> MyObjects
NodeId Id = client.getAddressSpace().addNode(
parentNode,
referenceTypeId,
newNodeId,
browseName,
nodeClass,
nodeAttributes,
typeDefinition);

my new node is successfully created and typedefinition is assigned but my object does not have any references which are defined in “ProgramStateMachineType”.
Logically when we create a node and add its typeDefinition reference all the mandatory references and attirbutes must also be instantiated inside my node. the same structure of typedefinition should be reflected in the instance node, BUT its not happening.

what should I do ?

April 20, 2016
11:17, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 1026
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

That scenario is not well defined in the specification (at least not in AddNodes Service description, based on my interpretation). This is server specific anyway because in most cases there is some logic that must be attached to the node for it to be of any use.

Assuming you are trying to do this for a server made with our SDK and can change the code (and you are using NodeManagerUaNode):
Override NodeManagerUaNode.createNodeForAddNode to use one of it’s createInstance methods, then you should get the full structure (depending on the UaNodeBuilderConfiguration, by default it creates mandatory nodes). And as addition note the NodeManagerTable.setNodeManagementEnabled(true) must be set for AddNodes to work at all (it is by default off).

– Bjarne

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 1919

Currently Online:
53 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: 738

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1524

Posts: 6450

Newest Members:

jonathonmcintyre, fannielima, kristiewinkle8, rust, christamcdowall, redaahern07571, nigelbdhmp, travistimmons, AnnelCib, dalenegettinger

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

Administrators: admin: 1