OPC-UA-SDK S7-TCPIP for client/server
Framework Advanced
Site / Branch / Standort License
12 months - Top level support and update
service including new features
Use
With the OPC UA SDK .NET you can quickly and easily create your own OPC UA client or server application.
The structure, which is based on the guidelines for Microsoft's framework design, allows even newcomers to OPC to get started with development from zero to one hundred. The usually complex configuration is almost completely eliminated.
The framework extends the foundation stack with various features. For example, ACLs (Access Control List) are provided on the server side for user and certificate-based authentication. The access rights can then be individually defined via their ACEs (Access Control Entry). Node management is just as simple, eliminating the need for complex lines of configuration code.
more...
ARTNR: SUP-9782.NET-CLIENT
Software Update & Support service
EAN number: | 4260721030977 | |
HS-code: | 85234990 |
Use
With the OPC UA SDK .NET you can quickly and easily create your own OPC UA client
or server application.
The structure, which is based on the guidelines for Microsoft's framework design,
allows even newcomers to OPC to get started with development from zero to one
hundred. The usually complex configuration is almost completely eliminated.
The framework extends the foundation stack with various features. For example,
ACLs (Access Control List) are provided on the server side for user and certificate-based
authentication. The access rights can then be individually defined via their
ACEs (Access Control Entry). Node management is just as simple, eliminating
the need for complex lines of configuration code.
There is also a lot on the client side. Reading with ReadNode and writing with
WriteNode is just as easy as browsing the nodes.
The SKD can be used for the .NET Framework, .NET Standard and .NET Core. It supports any platform for which .NET Core is available.
For the SDK speaks
- Write once, run everywhere
- Support by developer hotline
- Agile customer-oriented updates
- Royalty-free Developer-/Branch-licenses
Features
- Security Policies: None • Sign • SignAndEncrypt
- Security Algorythm: Auto • Custom • None • Basic128Ras15 • Basic256 • Basic256Sha256 • Https
- Configuration: In Code • XML-File • dynamic
- Nodemanager: Browse • Read • Write • Add • Delete
- Easy Node Access: Access Node by Browse Name • NodeId
- Data Access: DA • HDA • Alarm • Conditions • Events • Methods • Subscription • Custom Datatype • File
- Structured / Complex Data Types: Name-Value Paare • .NET dynamic • .NET • Typen
- OPC DA (Classic) Client
Target Frameworks
- .NET Framework 4.6+
- .NET Standard 2.0+
- .NET Core 3.0+
- .NET 5.0+
- Mono
- Xamarin
- Universal Windows Platform
- Unity
NuGet Packages
- Client SDK (40000+ downloads)
- Client + Server SDK (65000+ downloads)
GitHub Examples
- C#, VB.NET & C++/CLI
- Client & Server Basics
- Common User Scenarios
- NodeSets (VDMA, EUROMAP,...)
OPC UA Specifications
- OPC UA V1.03 (AE, DA, HDA, ...)
- OPC UA V1.04 (AE, DA, HDA, ...)
- OPC UA Companions
Platforms
- Windows
- Linux
- iOS
- macOS
- Android
OPC Watch - professional OPC-UA-client with attractive GUI
OPC-Watch, a professional tool for the OPC UA world. Developed with the OPC UA SDK .NET.
It offers:
- Diagnostics of OPC UA servers
- Analysis of connection options
- Node-Browser
- Display actual values of the nodes by subscription
- Code generator for OPC UA complex data types
- Change the values of the nodes
- Save the connection data / project settings
- Can run indefinitely
Example - Server
Example - Client
Licenses: | |
Single Developer License | Site / Branch / Standort License |
|
|
structured data
In the following sections is assumed, that the server provides a node (over the NodeId „ns=2;s=Machine/Operator“), which of the (fictitious) data types „StaffType“ used.
The structure of the data type is defined as follows:
StaffType .Name : string .ID : long .Shift : ShiftInfoType .Name : string .Elapsed : DateTime .Remaining : int
Easy access
The following types are used here: Opc.UaFx.Client.OpcClient, Opc.UaFx.OpcNodeId, Opc.UaFx.OpcValue and Opc.UaFx.OpcDataObject.
For easy access to values of variable nodes with structured data, the framework supports the use of the keyword dynamic
. Accesses to variables that are declared using dynamic
are evaluated by .NET at runtime. This means that the data of a structured data type can be accessed without prior explicit implementation of a .NET type. Such access could look like this:
client.UseDynamic = true; client.Connect(); dynamic staff = client.ReadNode("ns=2;s=Machine/Operator").Value; // Access the 'Name' and 'ID' field of the data without to declare the data type itself. // Just use the field names known as they would be defined in a .NET Type. Console.WriteLine("Name: {0}", staff.Name); Console.WriteLine("Staff ID: {0}", staff.ID); // Continue accessing subsequently used data types. Console.WriteLine("Shift: {0}", staff.Shift.Name); Console.WriteLine("- Time Elapsed: {0}", staff.Shift.Elapsed); Console.WriteLine("- Jobs Remaining: {0}", staff.Shift.Remaining); // Change Shift staff.Name = "John"; staff.ID = 4242; staff.Shift.Name = "Swing Shift"; client.WriteNode("ns=2;s=Machine/Operator", staff);
Name-based access
The following types are used here: Opc.UaFx.Client.OpcClient, Opc.UaFx.OpcNodeId, Opc.UaFx.OpcValue, Opc.UaFx.OpcDataObject and Opc.UaFx.OpcDataField.
For name-based access to values of variable nodes with structured data, the OpcDataObject class can be used directly. If the names of the fields of the data type are known, these can be accessed in the following way:
client.UseDynamic = true; client.Connect(); OpcDataObject staff = client.ReadNode("ns=2;s=Machine/Operator").As<OpcDataObject>(); // Access the 'Name' and 'ID' field of the data without to declare the data type itself. // Just use the field names known as the 'key' to access the according field value. Console.WriteLine("Name: {0}", staff["Name"].Value); Console.WriteLine("Staff ID: {0}", staff["ID"].Value); // Continue accessing subsequently used data types using the OpcDataObject as before. OpcDataObject shift = (OpcDataObject)staff["Shift"].Value; Console.WriteLine("Shift: {0}", shift["Name"].Value); Console.WriteLine("- Time Elapsed: {0}", shift["Elapsed"].Value); Console.WriteLine("- Jobs Remaining: {0}", shift["Remaining"].Value); // Change Shift staff["Name"].Value = "John"; staff["ID"].Value = 4242; shift["Name"].Value = "Swing Shift"; client.WriteNode("ns=2;s=Machine/Operator", staff);
Dynamic access
The following types are used here: Opc.UaFx.Client.OpcClient, Opc.UaFx.OpcNodeSet, Opc.UaFx.OpcAutomatism and Opc.UaFx.OpcDataTypeSystem.
For the "easiest access" by means of dynamic
as well as the name-based access, the used OpcClient needs information about the data types provided by the server. This information is automatically retrieved by the OpcClient-class when you call Connect() from the server, if before the property UseDynamic on either the OpcClient or the static OpcAutomatism value true
is set.
By enabling the feature, the OpcClient loads the necessary type information from the server, so that following the call to Connect() they can be accessed without explicit coding or similar as shown in the previous sections.
Is a UANodeSet.xml or an XML file describing the server (an XML file whose contents starts with UANodeSet), this file can also be loaded into the client application. The OpcClient can then obtain the information from the NodeSet and does not need to retrieve the type information when connecting. This could then look like this:
using (OpcClient client = new OpcClient("opc.tcp://localhost:4840")) { client.NodeSet = OpcNodeSet.Load(@"..\Resources\MyServersNodeSet.xml"); client.UseDynamic = true; client.Connect(); dynamic staff = client.ReadNode("ns=2;s=Machine/Operator").Value; Console.WriteLine("Name: {0}", staff.Name); Console.WriteLine("Staff ID: {0}", staff.ID); }
Note that when GetDataTypeSystem() is called, the OpcClient class provides an instance of the OpcDataTypeSystem class after setting a NodeSet, which describes the type system described in the NodeSet. Conversely, if no NodeSet is set using the NodeSet property of the OpcClient class, calling GetDataTypeSystem() returns a OpcDataTypeSystem instance, which describes the type system of the server retrieved from the server when Connect() was called.
Typed access
The following types are used here: Opc.UaFx.Client.OpcClient, Opc.UaFx.OpcNodeId, Opc.UaFx.OpcDataTypeAttribute and Opc.UaFx.OpcDataTypeEncoding.
For typed access, .NET types are defined in the client application as defined in the server. All required metadata is provided via attributes. Definition of .NET types for structured data types:
[OpcDataType("ns=2;s=StaffType")] [OpcDataTypeEncoding("ns=2;s=StaffType-Binary")] public class Staff { public string Name { get; set; } public int ID { get; set; } public ShiftInfo Shift { get; set; } } [OpcDataType("ns=2;s=ShiftInfoType")] [OpcDataTypeEncoding("ns=2;s=ShiftInfoType-Binary")] public class ShiftInfo { public string Name { get; set; } public DateTime Elapsed { get; set; } public byte Remaining { get; set; } }
After the client-side definition of a .NET type for a server-defined structured data type, this can be used as follows:
client.Connect(); Staff staff = client.ReadNode("ns=2;s=Machine/Operator").As<Staff>(); // Access the 'Name' and 'ID' field of the data with the declared the data type. Console.WriteLine("Name: {0}", staff.Name); Console.WriteLine("Staff ID: {0}", staff.ID); // Continue accessing subsequently used data types. Console.WriteLine("Shift: {0}", staff.Shift.Name); Console.WriteLine("- Time Elapsed: {0}", staff.Shift.Elapsed); Console.WriteLine("- Jobs Remaining: {0}", staff.Shift.Remaining); // Change Shift staff.Name = "John"; staff.ID = 4242; staff.Shift.Name = "Swing Shift"; client.WriteNode("ns=2;s=Machine/Operator", staff);
Generate data types
If the typed access is to be used, the possibility exists either only certain or all data types of an OPC UA server over the OPC Watch to generate. To generate a single data type implemented in .NET, follow the steps below:
- OPC Watch open
- Create new connection (+) and configure if necessary
- Connect to the server (plug icon)
- Select a node…
- either a variable node with structured DataType as value
- or a DataType-node under /Types/DataTypes/BaseDataType/Structure or /Enumeration
- Right click on this node
- click „Generate DataType“
- Paste the code into the application, done!
All data types can be generated either in a code file (* .cs) or assembly file (* .dll). To do this, follow the steps below:
- OPC Watch open
- Create new connection (+) and configure if necessary
- Connect to the server (plug icon)
- select Server node „opc.tcp://…“
- Right click on this node
- click „Generate Models“
- Select the desired file type in the dialog
- click „saving“
- Add the file to the project, done!
Define data types
The following types are used here: Opc.UaFx.Client.OpcClient, Opc.UaFx.OpcNodeId, Opc.UaFx.OpcData, Opc.UaFx.OpcDataTypeAttribute, Opc.UaFx.OpcDataTypeEncodingAttribute, Opc.UaFx.OpcDataTypeSystem and Opc.UaFx.OpcDataTypeInfo.
As an alternative to generating the data type as a .NET code or .NET assembly, these can also be defined manually. To do this, implement the type as defined by the server. This means that the .NET Type (regardless of structure or class) must provide the fields of the structured data type - in terms of their type - in exactly the same order. All other metadata is provided via corresponding attributes:
[OpcDataType("<NodeId of DataType Node>")] [OpcDataTypeEncoding( "<NodeId of Binary Encoding Node>", NamespaceUri = "<NamespaceUri.Value of binary Dictionary-Node>")] internal struct MyDataType { public short FieldA; public int FieldB; public string FieldC; ... }
The information needed for the definition can be obtained either through the OPC UA Server manual, the responsible PLC developer or via the OpcClient class. To determine the necessary information about the OpcClient class, you can examine the variable node - which uses the structured data types - as follows:
OpcNodeInfo node = client.BrowseNode("ns=2;s=Machine/Operator"); if (node is OpcVariableNodeInfo variableNode) { OpcNodeId dataTypeId = variableNode.DataTypeId; OpcDataTypeInfo dataType = client.GetDataTypeSystem().GetType(dataTypeId); Console.WriteLine(dataType.TypeId); Console.WriteLine(dataType.Encoding); Console.WriteLine(dataType.Name); foreach (OpcDataFieldInfo field in dataType.GetFields()) Console.WriteLine(".{0} : {1}", field.Name, field.FieldType); }
Data types with optional fields
The following types are used here: Opc.UaFx.Client.OpcClient, Opc.UaFx.OpcNodeId, Opc.UaFx.OpcData, Opc.UaFx.OpcDataTypeAttribute, Opc.UaFx.OpcDataTypeEncodingAttribute, Opc.UaFx.OpcDataTypeEncodingMaskAttribute and Opc.UaFx.OpcDataTypeMemberSwitchAttribute.
In order to reduce the amount of data transported, it is possible to "mark" certain fields of a structured data type as existent or missing in the data stream depending on certain conditions or on the value of another field within the data structure. To "mark" that a field is available, either the value of another field or a single bit within the EncodingMask is used (a field which is encoded as a preamble in front of the data in the data stream). The size of the EncodingMask is specified in number of bytes in the 'OpcDataTypeEncodingMaskAttribute'; if the 'Size' property is not explicitly set, its value (when using 'OpcEncodingMaskKind.Auto') will be used with the smallest number of bytes required (based on the number of optional fields).
The following options are available for defining the optional fields:
[OpcDataType("<NodeId of DataType Node>")] [OpcDataTypeEncoding( "<NodeId of Binary Encoding Node>", NamespaceUri = "<NamespaceUri.Value of binary Dictionary-Node>")] [OpcDataTypeEncodingMask(OpcEncodingMaskKind.Auto, Size = sizeof(uint))] internal struct MyDataTypeWithOptionalFields { public short FieldA; public int FieldB; public string FieldC; // Nullables are treat as optional fields by default. // Existence-Indicator-Bit is Bit0 in the encoding mask. public uint? OptionalField1; // Existence-Indicator-Bit is Bit1 (the next unused bit) in the encoding mask. [OpcDataTypeMemberSwitch] public int OptionalField2; // Existence-Indicator-Bit is Bit3 (bit 2 is unused) in the encoding mask. [OpcDataTypeMemberSwitch(bit: 3)] public byte OptionalField3; public bool FieldD; // 'OptionalField3' exists only if the value of 'FieldD' is equals 'true'. [OpcDataTypeMemberSwitch("FieldD")] public string OptionalField3; public int FieldE; // 'OptionalField4' exists only if the value of 'FieldE' is greater than '42'. [OpcDataTypeMemberSwitch("FieldE", value: 42, operand: OpcMemberSwitchOperator.GreaterThan)] public string OptionalField4; }
support-service (further 12 months):
Software Update & Support service
Single Developer License Support OPC-UA-SDK S7-TCPIP für Client .NET Standard/Core/Framework 12 months top level support and updates
plus VAT. and shipping
Software Update & Support service
Site / Branch / Standort License Support OPC-UA-SDK S7-TCPIP für Client .NET Standard/Core/Framework 12 months top level support and updates
plus VAT. and shipping
Software Update & Support service Obsolete
Successor: Software Update & Support service (Art.No: SUP-9782.NET-CLIENT-D)
Single developer license 12 months - Top level support and update service including new features
plus VAT. and shipping
Software Update & Support service Obsolete
Successor: Software Update & Support service (Art.No: SUP-9782.NET-CLIENT)
Site / Branch / Standort License 12 months - Top level support and update service including new features
plus VAT. and shipping
Software Update & Support service
Single Developer License 12 months - Top level support and update service including new features
plus VAT. and shipping
Software Update & Support service
Site / Branch / Standort License 12 months - Top level support and update service including new features
plus VAT. and shipping
Software Update & Support service
Single Developer License Support OPC-UA-SDK S7-TCPIP for Server .NET Standard/Core/Framework 12 months top level support and updates
plus VAT. and shipping
Software Update & Support service
Site / Branch / Standort License Support OPC-UA-SDK S7-TCPIP für Server .NET Standard/Core/Framework 12 months top level support and updates
plus VAT. and shipping
Software Update & Support service
Single Developer License Support OPC-UA-SDK S7-TCPIP für Client/Server .NET Standard/Core/Framework 12 months top level support and updates
plus VAT. and shipping
Software Update & Support service
Site / Branch / Standort License Support OPC-UA-SDK S7-TCPIP für Client/Server .NET Standard/Core/Framework 12 months top level support and updates
plus VAT. and shipping
Software Update & Support service
Single Developer License 12 months - Top level support and update service including new features
plus VAT. and shipping
Software Update & Support service
Site / Branch / Standort License 12 months - Top level support and update service including new features
plus VAT. and shipping
Einzel-Entwickler-Lizenz
OPC-UA-SDK S7-TCPIP client, single dev.lic.
Single Developer License For a single developer Incl. 12 months top level support Unlimited applications Unlimited license duration Royalty free
plus VAT. and shipping
OPC'96 for UA Client .NET SDK, single dev.license Obsolete
Successor: OPC (UA) Client .NET SDK, single dev.license (Art.No: 9782.NET-CLIENT-D)
Single Developer License Extension of the 'OPC UA Client .NET SDK' to connect to OPC'96 (= "OPC Classic", Windows only) Servers with DA, AE and HDA using .NET 4.6 - .NET 5.0, .NET Standard 2+ and .NET Core 3+ for windows (any), Linux, macOS, iOS, Android, Unity, Docker and Embedded Systems Incl. 12 months top level support and update service including new features
plus VAT. and shipping
OPC (UA) Client .NET SDK, single dev.license
Single Developer License SDK for Client development using OPC UA v1.03+ and OPC'96 (= 'OPC Classic', Windows only) with DA, AE, HDA and more using .NET 4.6 - .NET 5.0, .NET Standard 2+ and .NET Core 3+ for windows (any), Linux, macOS, iOS, Android, Unity, Docker and Embedded Systems Incl. 12 months top level support and update service including new features
plus VAT. and shipping
OPC-UA-SDK S7-TCPIP Server, single dev.lic.
Single Developer License Incl. 12 months top level support Unlimited applications Unlimited license duration Royalty free
plus VAT. and shipping
OPC-UA-SDK S7-TCPIP client/srv, single dev.lic.
Single Developer License For a single developer Incl. 12 months top level support Unlimited applications Unlimited license duration Royalty free
plus VAT. and shipping
OPC (UA) CL&UA SV .NET SDK, single dev.license
Single Developer License SDK for Client & Server development using OPC UA and OPC'96 (= "OPC Classic", Windows only) for Clients and OPC UA for Servers with DA, AE, HDA and more using .NET 4.6 - .NET 5.0, .NET Standard 2+ and .NET Core 3+ for windows (any), Linux, macOS, iOS, Android, Unity, Docker and Embedded Systems Incl. 12 months top level support and update service including new features
plus VAT. and shipping
Standort-Lizenz
OPC-UA-SDK S7-TCPIP client, branch-lic.
Site / Branch / Standort License Unlimited number of developers at the location Including 12 months top level support Unlimited applications Unlimited license duration Royalty free
plus VAT. and shipping
OPC'96 for UA Client .NET SDK, branch-license Obsolete
Successor: OPC (UA) Client .NET SDK, branch-license (Art.No: 9782.NET-CLIENT)
Site / Branch / Standort License Extension of the 'OPC UA Client .NET SDK' to connect to OPC'96 (= "OPC Classic", Windows only) Servers with DA, AE and HDA using .NET 4.6 - .NET 5.0, .NET Standard 2+ and .NET Core 3+ for windows (any), Linux, macOS, iOS, Android, Unity, Docker and Embedded Systems Incl. 12 months top level support and update service including new features
plus VAT. and shipping
OPC (UA) Client .NET SDK, branch-license
Site / Branch / Standort License SDK for Client development using OPC UA v1.03+ and OPC'96 (= 'OPC Classic', Windows only) with DA, AE, HDA and more using .NET 4.6 - .NET 5.0, .NET Standard 2+ and .NET Core 3+ for windows (any), Linux, macOS, iOS, Android, Unity, Docker and Embedded Systems Incl. 12 months top level support and update service including new features
plus VAT. and shipping
OPC-UA-SDK S7-TCPIP Server, branch lic.
Site / Branch / Standort License Unlimited number of developers at the site Incl. 12 months top level support Unlimited applications Unlimited license duration Royalty free
plus VAT. and shipping
OPC-UA-SDK S7-TCPIP Client/Server, branch lic.
Site / Branch / Standort License Unlimited number of developers at the location Incl. 12 months top level support Unlimited applications Unlimited license duration Royalty free
plus VAT. and shipping
OPC (UA) CL&UA SV .NET SDK, branch license
Site / Branch / Standort License SDK for Client & Server development using OPC UA and OPC'96 (= "OPC Classic", Windows only) for Clients and OPC UA for Servers with DA, AE, HDA and more using .NET 4.6 - .NET 5.0, .NET Standard 2+ and .NET Core 3+ for windows (any), Linux, macOS, iOS, Android, Unity, Docker and Embedded Systems Incl. 12 months top level support and update service including new features
plus VAT. and shipping
OPC-Server
Data exchange between OPC-Clients and PLC’s
Easy UA-server
Universal - simple - contemporary - expandable platform