I. Introducing OPC DA
What is OPC DA?
OPC DA (OLE for Process Control – Data Access) is a communication standard in the field of automation and process control. OPC DA is used to transfer data from automation devices and systems to computer applications such as HMI (Human-Machine Interface), SCADA (Supervisory Control and Data Acquisition) and data management systems .
Special of OPC
- Compatibility: OPC DA enables communication between devices and applications from different manufacturers without having to worry about incompatibility.
- High reliability: OPC DA is designed to ensure high stability and reliability in data transmission from device to application.
- Scalability: It allows to expand the system by adding new devices without having to change the communication structure.
- Data transmission speed: OPC DA is capable of transmitting data at fast speeds, suitable for applications that require real time.
II.Configuration instructions and source code
Register OPC on the computer
- Copy the OPCDAAuto.dll library file to drive C//window//System32 and C//window//SysWoW64 (Library link at the end of the article)
- Command 1: %windir%\System32\regsvr32.exe %windir%\System32\OPCDAAuto.dll For 32bit windows
- Command 2: %windir%\SysWoW64\regsvr32.exe %windir%\SysWoW64\OPCDAAuto.dll For 64bit windows
Config Kepware OPC V6
Kepware OPC is a software that helps connect and transfer data from automation devices and systems to computer applications such as HMI, SCADA, MES (Manufacturing Execution System), ERP (Enterprise Resource Planning), and many more. other system, supports many communication protocols such as Modbus, Siemens, Allen-Bradley, OPC UA, and many others, allowing connection to a variety of devices and systems. This is a popular solution used in automation and production management applications to connect and manage data from different devices and systems.
In this article. I use Kepware OPC V6 to connect. Because Kepware is so famous among technical people for their developments and also for easy, fast, convenient connection, support for many drivers of different brands, and clear device management. , friendly, coherent, fast.
This is an example I have pre-configured on Kepware OPC.

OPC DA C# source code on Visual Studio
Source code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using OPCAutomation;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
OPCServer oServer;
OPCGroup oGroup;
Array handles = new Array[2];
public int temp1;
public int temp2;
public Form1()
{
InitializeComponent();
SET_opc();
}
public void SET_opc()
{
//add server - reference the kepserver that should already be setup
oServer = new OPCServer();
oServer.Connect("Kepware.KEPServerEX.V6", null);
oServer.OPCGroups.DefaultGroupIsActive = true;
oServer.OPCGroups.DefaultGroupDeadband = 0f; //the percentage change required before a change is reported, used to filter noise
oServer.OPCGroups.DefaultGroupUpdateRate = 10; //the rate is ms before item is updated
//set up group - this is an arbitrary container to place OPC items
oGroup = oServer.OPCGroups.Add("g1");
oGroup.IsSubscribed = false; //dont need to be subscribed to data change events
oGroup.OPCItems.DefaultIsActive = false; //the item does not need to be active, it will only be refreshed with the latest value after we synch read
//add group items - items can capture the values of registers from the device, the item is setup within the kepserver
int[] h = new int[3];
//index starts at 1
h[1] = oGroup.OPCItems.AddItem("Channel1.Device1.PV", 1).ServerHandle; //the handle is a server generated value that we use to reference the item for further operations
h[2] = oGroup.OPCItems.AddItem("Channel1.Device1.SV", 2).ServerHandle;
handles = (Array)h;
}
public void Sync_read() //reads device
{
System.Array values; //opc server will store the values in this array
System.Array errors; //opc server will store any errors in this array
object qualities = new object(); //opc server will store the quality of the item
object timestamps = new object(); //store the timestamp of the read
//read directly from device
oGroup.SyncRead((short)OPCAutomation.OPCDataSource.OPCDevice, 2, ref handles, out values, out errors, out qualities, out timestamps);
temp1 = (int)values.GetValue(1);
temp2 = (int)values.GetValue(2);
}
private void button1_Click(object sender, EventArgs e)
{
Sync_read();
textBox1.Text = temp1.ToString();
textBox2.Text = temp2.ToString();
}
}
}
Library download link OPCDAutomation.dll
Link Video: Audio









Was just browsing the site and was impressed the layout. Nicely design and great user experience. Just had to drop a message, have a great day! 8dfds87a
Was just browsing the site and was impressed the layout. Nicely design and great user experience. Just had to drop a message, have a great day! we7f8sd82
Hello
We have client that are interested about what you selling, please contact us on whatsapp: +44 790 462 9452
Hello,
We are interested to resell what you offer to our clients, can we discuss on whatsapp ? Here is my number : +1 204 272 8230