Happy Happy
Member
Members
Forum Posts: 4
Member Since:
08/18/2016
08/18/2016
Offline
My Code base on C#.
//Method Init MethodState method = new MethodState(parent); method.SymbolicName = name; method.ReferenceTypeId = ReferenceTypeIds.HasComponent; method.NodeId = new NodeId(path, NamespaceIndex); method.BrowseName = new QualifiedName(path, NamespaceIndex); method.DisplayName = new LocalizedText("en", name); method.WriteMask = AttributeWriteMask.None; method.UserWriteMask = AttributeWriteMask.None; method.Executable = true; method.UserExecutable = true; //InputArguments Setup method.InputArguments = new PropertyState<Argument[]>(method); method.InputArguments.NodeId = new NodeId((string)method.NodeId.Identifier + @"\MethodsInputI", NamespaceIndex); method.InputArguments.BrowseName = BrowseNames.InputArguments; method.InputArguments.DisplayName = method.InputArguments.BrowseName.Name; method.InputArguments.TypeDefinitionId = VariableTypeIds.PropertyType; method.InputArguments.ReferenceTypeId = ReferenceTypeIds.HasProperty; method.InputArguments.DataType = DataTypeIds.Argument; method.InputArguments.ValueRank = ValueRanks.OneDimension; //Value Setup method.OutputArguments.Value = ValueInformation(); //This is ValueInformation() private Argument[] ValueInformation() { Argument[] args = new Argument[2]; args[0] = new Argument(); args[0].Name = "NetworkAdapter"; args[0].Value = "55:88:99:11:22:33:44"; args[0].Description = "This is iut CNC Program Context."; args[0].DataType = DataTypeIds.String; args[0].ValueRank = ValueRanks.Scalar; args[1] = new Argument(); args[1].Name = "IP"; args[1].Value = "127.0.0.1"; args[1].Description = "This is Set IP"; args[1].DataType = DataTypeIds.String; args[1].ValueRank = ValueRanks.Scalar; }
I has set the two Arguments default value. But when i use opc ua client to call this server methods, the two Argument default value is show “”(no default value)? Why?
Does the opc ua methods can’t set default value with InputArguments?
If is ture, How can i use another way to achieve this function?
Â
Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online:
Guest(s) 18
Currently Browsing this Page:
1 Guest(s)
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1446
Posts: 4891