I wish to read an array of a custom structure using a model.
I would expect that I could do something like the following:
Code: Select all
var usersNodeId = new NodeId(OpcNodeIds.UsersPropertyId, this.NamespaceIndex());
var users = new List<UserModel>();
session.Model.Read(usersNodeId, users);
Code: Select all
[UaTypeDefinition(NamespaceUri = OpcNamespaces.ApplicationUri, NodeId = OpcNodeIds.UserDataType)]
public class UserModel
{
[UaInstanceDeclaration(NamespaceUri = OpcNamespaces.ApplicationUri, BrowseName = "UserName")]
public string Username { get; set; }
[UaInstanceDeclaration(NamespaceUri = OpcNamespaces.ApplicationUri, BrowseName = "Description")]
public string Description { get; set; }
}
So how do I accomplish what I am trying to do?
I am using the Nuget package version 3.1.1 on .NET Framework 4.6.2.
Thank you