1.安裝opc server
https://blog.csdn.net/yhtppp/article/details/80676118
2.c#讀取opc
https://github.com/leogle/OPCAutomationDotNet
1 var client = new OPCClientWrapper(); 2 client.Init("127.0.0.1", "Matrikon.OPC.Simulation.1"); 3 //client.MonitorOPCItem("DCS001.TEST08"); 4 //var res = client.ReadValue("DCS001.TEST08"); 5 //client.Write("DCS001.TEST08","試試"); 6 var value = client.ReadNodeLabel("DCS001.TEST08"); 7 client.Write("DCS001.TEST08", "試試"+DateTime.Now.ToLongTimeString()); 8 9 client.Disconnect();
3.
檢索COM 類工廠中 CLSID 為 <28e68f9a-8d75-11d1-8dc3-3c302a000000> 的組件時失敗,原因是出現以下錯誤: 80040154
一定要到C:\Windows\SysWOW64路徑下打開cmd.exe運行命令文件(而不是在運行打開),注冊“OPCDAAuto.dll” 輸入命令: REGSVR32 OPCDAAuto.dll;即可
https://www.cnblogs.com/ike_li/p/5468658.html
網上搜OPCDAAuto.dll,用228k大小的