
OPC UA Client / Server in C#/VB.NET
schnell und einfach.
Weitere Informationen finden Sie auch auf unserer
OPC UA WEB-Seite https://opcua.traeger.de
Mit dem OPC-UA Framework Advanced schnell und einfach zur eigenen OPC-UA Client/Server Anwendung.
Der an den Richtlinien für das Framework Design von Microsoft angelehnte Aufbau erlaubt es selbst OPC Neulingen einen Einstieg von null auf hundert in die Entwicklung. Die üblicherweise aufwändige Konfiguration entfällt nahezu vollständig.
Hierbei erweitert das Framework den Foundation Stack um diverse Features. So werden serverseitig ACLs (Access Control List) für die Benutzer und Zertifikat basierte Authentifizierung bereitgestellt. Über deren ACEs (Access Control Entry) lassen sich dann die Zugriffsrechte individuell festlegen. Ebenso einfach ist das Node Management, sodass komplexe gar dutzende Zeilen an Konfigurationscode entfallen.
Auch clientseitig wird einiges geboten. Das Lesen mittels ReadNode und Schreiben mittels WriteNode ist ebenso einfach wie das Browsen der Nodes.
Starten Sie sofort und laden Sie hier das Evaluation Paket.
Sie können sofort 14 Tage kostenfrei testen. Bei Bedarf fordern Sie bitte einen Test-Key mit längerer Laufzeit an.
Im Paket sind umfrangreiche Samples für Client und Server enthalten.
OPC-Watch, ein Profi-Tool in der OPC-UA-Welt im Lieferumfang
using Opc.UaFx;
using Opc.UaFx.Server;
internal class SampleNodeManager : OpcNodeManager
{ private OpcDataVariableNode<bool> isStarted; public SampleNodeManager() : base("http://sampleserver/machines") { } protected override IEnumerable<IOpcNode> CreateNodes(OpcNodeReferenceCollection references) { OpcFolderNode machineOne = new OpcFolderNode(new OpcName("Machine_1", this.DefaultNamespaceIndex)); references.Add(machineOne, OpcObjectTypes.ObjectsFolder); new OpcMethodNode(machineOne, "StartMachine", new Action<OpcMethodContext>(StartMachine)); new OpcMethodNode(machineOne, "StopMachine", new Action<OpcMethodContext>(StopMachine)); this.isStarted = new OpcDataVariableNode<bool>(machineOne, "IsStarted", false); return new IOpcNode[] { machineOne }; } private void StartMachine(OpcMethodContext context) { // The code to start the machine. this.isStarted.Value = true; this.isStarted.ApplyChanges(context); } private void StopMachine(OpcMethodContext context) { // The code to stop the machine. this.isStarted.Value = false; this.isStarted.ApplyChanges(context); }
}
public class Program
{
new OpcServerApplication ("opc.tcp://localhost:12345/SampleServer", new SampleNodeManager()).Run();
Console.ReadKey();
}
OpcClient client = new OpcClient("opc.tcp://localhost:4711/MyServer");
client.UserIdentity = new UserIdentity("username", "password");
client.Connect(); // Connect to Server
To read nodes use one of the ReadNode overloads of the OpcNodeInfo class.
OpcValue value = client.ReadNode("2:Machine_1/IsStarted");
To read a different OpcAttribute as the value attribute specify the attribute to read as follows:
OpcValue description = client.ReadNode("2:Machine_1/IsStarted", OpcAttribute.Description);
To write nodes use one of the WriteNode overloads of the OpcNodeInfo class.
client.WriteNode("2:Machine_1/IsStarted", true);
To write a different OpcAttribute as the value attribute specify the attribute to write as follows:
client.WriteNode("2:Machine_1/IsStarted", OpcAttribute.Description, "Indicates the started state");
client.WriteNode("2:Machine_1/IsStarted", true);
client.Disconnect();
Site / Branch / Standort License
Single Developer License