跳到主要内容

AI 工具链

给终端用户的 AI 助手(Claude Code / Cursor / ChatGPT)用官方公开资料回答 Darra Profinet Slave 问题、生成可运行 SDK 代码。全部公开只读,无鉴权,不含内部管理接口。

官网:https://profinet.darra.xyz

三种用法

1. llms.txt

让助手先读站点摘要,再按需打开完整文档:

文件地址
摘要https://profinet.darra.xyz/llms.txt
完整内容https://profinet.darra.xyz/llms-full.txt
代码生成规则https://profinet.darra.xyz/ai-prompts.txt

ChatGPT / 没有 MCP 的助手:把上面任一地址贴进对话,或让它先抓 llms.txt

2. MCP

公开端点:

https://profinet.darra.xyz/mcp

协议:MCP over Streamable HTTP,JSON-RPC 2.0,协议版本 2025-06-18。发现文件:

可用工具:get_product_overviewlist_featuresget_pricingget_sdk_installget_contactsearchget_code_promptget_diagnostics_guide

get_pricing 只陈述现状:商城未上架,占位 SKU 不可购买,未授权时 2 小时试用。不会返回价格数字。

3. agent-skills

技能目录:

https://profinet.darra.xyz/.well-known/agent-skills/index.json

每条技能都指向同一个 MCP 端点,并带对应工具名。覆盖产品概况、功能、授权现状、SDK 安装、代码生成、诊断、GSDML/TIA、下载、联系。

Claude Code

在项目根目录放 .mcp.json(或写入用户级 Claude Code MCP 配置):

{
"mcpServers": {
"darra-profinet": {
"type": "http",
"url": "https://profinet.darra.xyz/mcp"
}
}
}

连上后让助手先调 get_product_overviewget_diagnostics_guide,再按语言调 get_sdk_install / get_code_prompt

Cursor

在 Cursor MCP 设置里加同一条 HTTP 端点 https://profinet.darra.xyz/mcp,或使用与上面相同的 mcp.json 片段。

生成代码时必须遵守

官方 C# 入口(不要发明 API):

using Darra.PnS;

var device = DarraPnS.Connect();
if (device.Start() != PnSErrorCode.Success)
{
Console.WriteLine(device.LastServiceError);
return;
}

bool online = device.Connected;
PnSState state = device.State;
PnSRuntimeErrorCode err = device.ErrorCode;
string reason = device.ErrorMessage;
PnSDiagSnapshot snap = device.DiagSnapshot;

device.WriteInt16("IW2", 123);
short command = 0;
device.ReadInt16("QW0", out command);

device.Stop();
  • 先诊断,再过程数据。
  • 写 I(设备→控制器),读 Q(控制器→设备)。写 Q 返回 NotSupported。不要把 Q 抄回 I。
  • 地址:I0.0 / IB0 / IW2 / ID4,以及 Q / M / DB1。
  • 周期自由配置,最低 1 ms。
  • 命名空间 Darra.PnS,程序集 DarraPnS,NuGet Darra.PnS.SDK

相关