The code below (in C# language) reads and displays an item value, using QuickOPC.NET:
// Read item value and display it in a message box MessageBox.Show(EasyDAClient.DefaultInstance.ReadItemValue("", "OPCLabs.KitServer.2", "Demo.Single").ToString()); |
The code below subscribes to changes of an item, and displays the value with each change:
// The callback is a lambda expression that displays the value EasyDAClient.DefaultInstance.SubscribeItem( "", "OPCLabs.KitServer.2", "Demo.Single", 1000, (_, args) => Console.WriteLine(args.Vtq.Value)); |
No other product can do this in such a clear and concise code, in a single statement! The programming is straightforward, and the developer can focus on getting the work done and not on fighting the intricacies of OPC protocols.
The same code simplicity is maintained in other programming languages. Here are the corresponding examples in Visual Basic (VB.NET).