Closed xujiesh0510 closed 1 year ago
After a few days' digging :
when client request DataTypeDefinition attribute value of a DataTypeNode, server shoud return the DataType information
request:
response:
Instead ,when client request DataTypeDefinition attribute value of a DataTypeNode, server just return None
hi, i'm a newbie in rust. i have a variable ,its value type is custom datatype
// OPCUA for Rust // SPDX-License-Identifier: MPL-2.0 // Copyright (C) 2017-2022 Adam Lock // // This file was autogenerated from BatchPlant.Types.bsd by tools/schema/gen_types.js // // DO NOT EDIT THIS FILE
[derive(Debug, Clone, PartialEq)]
pub struct DataTypeChildOne { pub field_1: UAString, pub field_2: UAString }
impl MessageInfo for DataTypeParent { fn object_id(&self) -> ObjectId { ObjectId::DataTypeChildOne_Encoding_DefaultBinary ?????? //ObjectId do not have value DataTypeChildOne_Encoding_DefaultBinary } }
[derive(Debug, Clone, PartialEq)]
pub struct DataTypeParent { pub field_1: DataTypeChildOne, pub field_2: DataTypeChildOne, }
Qustion1 : how do i write/read custom datatype value to variable ?
In c# opcua server ,it's quite easy: variable.Value = new DataTypeParent { } // beacuse Value property is object type
Qustion2 : in order to let client know custom dataType, how to register custom data type to opcua ? (using StructureDefinition? how?)
[ // Process definitions] (https://github.com/locka99/opcua/blob/b2c6e70b84511e975f29a144b472f1d67090c4fe/tools/schema/nodeset.js#L373) Definition node seems not processed . how do I register manually?
Qustion3 : how to convert a json string to my custom types(eg. DataTypeParent ) ?
Many thanks.