Skip to main content

Darra Profinet Slave

Darra Profinet Slave · Python SDK

把 Windows 主机作为 PROFINET IO 从站设备使用,受主站系统(如西门子 PLC)控制:RT Class 1 实时周期,DCP 设备发现 / 命名 / 地址分配,过程数据 IO,报警与诊断(含 I&M),GSDML 导入 TIA V15+;搭配 DarraRT 实时内核驱动,SDK 以服务模式使用(过程映像共享内存映射)。

Use a Windows host as a PROFINET IO device under a master (e.g. a Siemens PLC) — RT Class 1, DCP, process-data IO, alarms and diagnostics (I&M), GSDML for TIA V15+; with the DarraRT kernel driver. The SDK is used in service mode (process image mapped from shared memory).


能力 · Capabilities

  • 从站设备 — Windows 主机作为 PROFINET IO Device,受 PLC 等主站控制
  • 实时周期 — RT Class 1,搭配 DarraRT 实时内核驱动
  • 发现与组态 — DCP 发现 / 命名 / 地址;GSDML 导入 TIA V15+
  • 过程数据 — 写 Q、读 I;报警、诊断、I&M
  • 0 拷贝 — 过程映像映射成结构体,供高性能直接读写(读可并发;写请调用方串行化)
  • 同一 Core — 过程数据由 DarraRT 实时内核周期搬运,SDK 侧零拷贝映射共享映像

开始 · Get started

  1. 先安装官方安装包(实时内核驱动 + 配置工具 + SDK):下载页 · https://download.darra.xyz/profinet/client/Darra-Profinet-Setup.exe
  2. 本包是 Python SDK:
pip install darra-profinet-slave
  1. 新人:基础知识 · 从 SDK 继续 · Python 文档

最佳用法 · 0 拷贝

总线周期由内核完成。Start 后把 I / Q 映射成结构体,之后当普通变量读写即可——读是当前周期,写下个周期发出。

import ctypes
from darra_pns import PnSService

class FromPlc(ctypes.BigEndianStructure):   # I:控制器 → 设备
    _pack_ = 1
    _fields_ = [("present", ctypes.c_uint8),
                ("recipe", ctypes.c_int16)]

class ToPlc(ctypes.BigEndianStructure):     # Q:设备 → 控制器
    _pack_ = 1
    _fields_ = [("ready", ctypes.c_uint8),
                ("busy", ctypes.c_uint8)]

svc = PnSService()                          # 构造随时可调
svc.start()                                 # 启动服务 + 建立过程数据通道

inp = svc.process_data.inputs_mapping(FromPlc)   # 映射一次(I 只读)
outp = svc.process_data.outputs_mapping(ToPlc)   # 映射一次(Q 可写)

outp.ready = 1                              # 写下的下个周期发出
present = inp.present                       # 读到的永远是当前周期

要整段一次读出用 svc.read()(一次调用取一份,同一拍自洽)。

i = svc.read()   # I 区整段字节

其它语言 · Other SDKs

语言 / Language 包 / Package 来源 / Source
C darra_profinet_c-win-x64.zip 下载页
C++ darra_profinet_cpp-win-x64.zip 下载页
C# Darra.Profinet.Slave NuGet
Java xyz.darra:darra-profinet-slave Maven Central
Python darra-profinet-slave PyPI(本包 / this SDK)
Rust darra-profinet-slave crates.io

许可 · License

专有软件 · Proprietary — © Darra Technology,使用须遵守随产品提供的许可协议。

Release files for Darra-Profinet-Slave 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for Darra-Profinet-Slave 1.1.0
File Interpreter ABI Platform
darra_profinet_slave-1.1.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details

Release files / darra_profinet_slave-1.1.0-cp312-cp312-win_amd64.whl

Download URL darra_profinet_slave-1.1.0-cp312-cp312-win_amd64.whl
Size 13.8 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
5aa64320857da1ec89473399a5116a27b10115daeea79d6e1a09d3213524e57f
BLAKE2b-256 checksum
How to use checksums
cae4803d0570b69deeead74df6d57b5c42d4048843326fe133f86382db9444d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release history Release notifications | RSS feed

This release

1.1.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page