> For the complete documentation index, see [llms.txt](https://docs.zongsoft.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zongsoft.com/framework/externals/projects/opc.md).

# Opc (opc)

Opc 项目的能力范围、部署产物、接入入口与使用边界。

提供 OPC UA 客户端、服务端及读写订阅适配，用于连接工业数据服务。节点标识、数值质量和采样时间都属于业务数据。

| 项目项  | 值                                                  |
| ---- | -------------------------------------------------- |
| 源码目录 | `externals/opc`                                    |
| 主包   | `Zongsoft.Externals.Opc`                           |
| 配套主题 | [OPC UA 设备协议](/framework/externals/integration.md) |

## 部署与使用入口

将主包追加到已有宿主的[部署清单](/references/deploy-files.md)，并保留包中的插件清单、程序集及附属运行资源：

{% code title="Application.deploy（追加片段）" %}

```ini
[plugins zongsoft externals opc]
nuget:Zongsoft.Externals.Opc
```

{% endcode %}

端点、应用证书、信任目录、用户身份和会话生命周期由应用组织。项目包含配套本地 server/client 示例，可先用于验证读取与订阅。

## 接入步骤

1. 按项目示例准备本地服务器与客户端，建立证书信任和会话。
2. 先浏览并读取已知节点，再验证变化订阅、状态码与源时间戳。
3. 验证断线、服务器重启和退出释放后，再设计真实设备的写入控制。

具体配置、调用示例和相关基础概念见[OPC UA 设备协议](/framework/externals/integration.md)。

## 项目边界

{% hint style="info" %}
💡 应用证书和用户权限解决不同问题。插件部署不自动完成信任配置，读取到数值也不代表质量状态正常；示例中的信任方式不能直接作为正式设备部署策略。
{% endhint %}

## 继续阅读

[按项目浏览扩展](/framework/externals/projects.md) · [OPC UA 设备协议](/framework/externals/integration.md) · [源码与项目说明](https://github.com/Zongsoft/framework/tree/main/externals/opc)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.zongsoft.com/framework/externals/projects/opc.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
