Visualize and control your enterprise using OPC Unified Architecture (OPC UA) and Visual Studio.
Updated Microsoft.IO.RecyclableMemoryStream package to 3.0.0
throw pending exception from channel. mark ServiceResultException Serializable. fix unit tests. update readme.
Instead of UaTcpSessionChannel, use ClientSessionChannel. See Readme for details.
// create a 'ClientSessionChannel', a client-side channel that opens a 'session' with the server.
var channel = new ClientSessionChannel(
clientDescription,
null, // no x509 certificates
new AnonymousIdentity(), // no user identity
"opc.tcp://opcua.rocks:4840", // the public endpoint of a server at opcua.rocks.
SecurityPolicyUris.None); // no encryption
In v3.0, we ask that you mark the assembly containing your custom structures with TypeLibrary() attribute. The Encoder/Decoder will discover these custom structures and be able to read and write these structures with the server.
using System;
using Workstation.ServiceModel.Ua;
[assembly: TypeLibrary()]
namespace CustomTypeLibrary
{
[DataTypeId("nsu=http://www.unifiedautomation.com/DemoServer/;i=3002")]
[BinaryEncodingId("nsu=http://www.unifiedautomation.com/DemoServer/;i=5054")]
public class CustomVector : Structure
{
public double X { get; set; }
public double Y { get; set; }
public double Z { get; set; }
public override void Encode(IEncoder encoder)
{
encoder.WriteDouble("X", X);
encoder.WriteDouble("Y", Y);
encoder.WriteDouble("Z", Z);
}
public override void Decode(IDecoder decoder)
{
X = decoder.ReadDouble("X");
Y = decoder.ReadDouble("Y");
Z = decoder.ReadDouble("Z");
}
}
}
Adopt nullable reference types (NRT) in preparation for .NET 5. See https://devblogs.microsoft.com/dotnet/embracing-nullable-reference-types Thank you, @quinmars
Support the latest version of the OPC Foundation specification v1.04 with additional types, node attributes, and status codes.