TechnoSoftware OPCDA client(1.2.1) Error Codes
OPCDA.NET Client Interface Wrapper
Summary of OPC Error Codes
We have attempted to minimize the number of unique errors by identifying common generic problems and defining error codes that can be reused in many contexts. An OPC server should only return those OPC errors that are listed for the various methods in this specification or are standard Microsoft errors. Note that OLE itself will frequently return errors (such as RPC errors) in addition to those listed in this specification.
The most important thing for a client is to check FAILED for any error return. Other than that, (the statements above not withstanding) a robust, user friendly client should assume that the server may return any error code and should call the GetErrorString function to provide user readable information about those errors.
Fig.1 Standard COM errors that are commonly used by OPC Servers
Value | Description | |
S_OK | 0x0 | |
S_FALSE | 0x1 | |
E_FAIL | 0x80004005 | Unspecified error |
E_INVALIDARG | 0x80070057 | The value of one or more parameters was not valid. This is generally used in place of a more specific error where it is expected that problems are unlikely or will be easy to identify (for example when there is only one parameter). |
E_NOINTERFACE | 0x80004002 | No such interface supported |
E_NOTIMPL | 0x80004001 | Not implemented |
E_OUTOFMEMORY | 0x8007000E | Not enough memory to complete the requested operation. This can happen any time the server needs to allocate memory to complete the requested operation. |
CONNECT_E_ADVISELIMIT | 0x80040201 | Advise limit exceeded for this object |
OLE_E_NOCONNECTION | 0x80040200 | Cannot Unadvise - there is no existing connection |
Fig.2 OPC Specific Errors
Value | Description | |
OPC_E_BADRIGHTS | 0xC0040006 | The Items AccessRights do not allow the operation. |
OPC_E_BADTYPE | 0xC0040004 | The server cannot convert the data between the specified format/ requested data type and the canonical data type. |
OPC_E_DUPLICATENAME | 0xC004000C | Duplicate name not allowed. |
OPC_E_INVALIDCONFIGFILE | 0xC0040010 | The server's configuration file is an invalid format. |
OPC_E_INVALIDFILTER | 0xC0040009 | The filter string was not valid |
OPC_E_INVALIDHANDLE | 0xC0040001 | The value of the handle is invalid. Note: a client should never pass an invalid handle to a server. If this error occurs, it is due to a programming error in the client or possibly in the server. |
OPC_E_INVALIDITEMID | 0xC0040008 | The item ID doesn't conform to the server's syntax. |
OPC_E_INVALID_PID | 0xC0040203 | The passed property ID is not valid for the item. |
OPC_E_NOTFOUND | 0xC0040011 | Requested Object (e.g. a public group) was not found. |
OPC_E_PUBLIC | 0xC0040005 | The requested operation cannot be done on a public group. |
OPC_E_RANGE | 0xC004000B | The value was out of range. |
OPC_E_UNKNOWNITEMID | 0xC0040007 | The item ID is not defined in the server address space (on add or validate) or no longer exists in the server address space (for read or write). |
OPC_E_UNKNOWNPATH | 0xC004000A | The item's access path is not known to the server. |
OPC_S_CLAMP | 0x0004000E | A value passed to WRITE was accepted but the output was clamped. |
OPC_S_INUSE | 0x0004000F | The operation cannot be performed because the object is being referenced. |
OPC_S_UNSUPPORTEDRATE | 0x0004000D | The server does not support the requested data rate but will use the closest available rate. |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 提示词工程——AI应用必不可少的技术
· 地球OL攻略 —— 某应届生求职总结
· 字符编码:从基础到乱码解决
· SpringCloud带你走进微服务的世界