QuickOPC User's Guide and Reference
Installed Examples - WindowsForms - WindowsFormsApplication1
View with Navigation Tools

The simplest Windows Forms application. Reads and displays an OPC "Classic" (OPC-DA) item value on a form. This is what you get if you follow the steps described in Quick Start for QuickOPC.NET.

The form:

// $Header: $
// Copyright (c) CODE Consulting and Development, s.r.o., Plzen. All rights reserved.

// ReSharper disable NotNullMemberIsNotInitialized

using System;
using System.Windows.Forms;
using OpcLabs.EasyOpc.DataAccess;
using OpcLabs.EasyOpc.OperationModel;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            try
            {
                object value = easyDAClient1.ReadItemValue("", "OPCLabs.KitServer.2", "Demo.Single");
                textBox1.Text = value?.ToString() ?? "";
            }
            catch (OpcException opcException)
            {
                textBox1.Text = $"*** {opcException.Message}";
            }
        }
    }
}

 

See Also

Conceptual

Installed Examples - WPF

Installed Examples - Console