# Darra Profinet Slave — AI Code Prompts # Official API grammar for code generation. Do not invent members. Product: Darra Profinet Slave Website: https://profinet.darra.xyz Docs: https://profinet.darra.xyz/docs/sdk/csharp/ Contact: support@darra.xyz ## Hard rules 1. Brand is Darra Profinet Slave. Never write PnSlaver. 2. Protocol name is PROFINET. 3. C# namespace `Darra.PnS`. Assembly `DarraPnS`. NuGet `Darra.PnS.SDK`. 4. Entry is `DarraPnS.Connect()` then `Start()`. Do not `new DarraPnS(...)`. 5. `LoadConfig` is parse-only. It does not start a session. 6. Diagnose first: `Connected`, `State`, `ErrorCode`, `ErrorMessage`, `DiagSnapshot`, `IoStatus`. 7. Write I (device → controller). Read Q (controller → device). Writing Q returns `NotSupported`. 8. Never copy Q back to I. 9. Addresses: `I0.0` / `IB0` / `IW2` / `ID4`, `Q...`, `M...`, `DB1...`. Big-endian words. `IW3` is legal. 10. Cycle is freely configurable, minimum 1 ms. Do not invent other cycle slogans. 11. Shop is not listed. Purchase page is https://profinet.darra.xyz/purchase. Do not invent Stripe prices. 12. Trial is 2 hours (`TrialStartUtc`), not 30 days. 13. Linux is supported. Do not invent Linux install steps or kernel details. 14. Do not document internal driver names, handshake IOCTLs, or test-only bus tricks. ## Install ``` C#: dotnet add package Darra.PnS.SDK or reference C:\DARRA\Profinet_Slave\DarraPnS.dll Java: see https://profinet.darra.xyz/docs/api/java Python: see https://profinet.darra.xyz/docs/api/python C: see https://profinet.darra.xyz/docs/api/c C++: see https://profinet.darra.xyz/docs/api/cpp Rust: see https://profinet.darra.xyz/docs/api/rust Web: https://profinet.darra.xyz/docs/sdk/webapi/ ``` Service name: DarraPnSService Install directory: C:\DARRA\Profinet_Slave TIA: V15.1+ ## Session ```csharp using Darra.PnS; var device = DarraPnS.Connect(); if (device.Start() != PnSErrorCode.Success) { Console.WriteLine(device.LastServiceError); return; } if (!device.Connected) { Console.WriteLine(device.ErrorMessage); return; } device.WriteInt16("IW2", 123); short q = 0; if (device.ReadInt16("QW0", out q) != PnSErrorCode.Success) Console.WriteLine(device.ErrorMessage); device.Stop(); ``` ## Diagnostics first ```csharp bool online = device.Connected; PnSState state = device.State; PnSRuntimeErrorCode err = device.ErrorCode; string reason = device.ErrorMessage; PnSDiagSnapshot snap = device.DiagSnapshot; if (!device.IoStatus.InputDataGood) Console.WriteLine("controller data not usable yet"); ``` Do not treat I/Q as valid until diagnostics and `IoStatus` say so. ## Process data | Call | Meaning | |------|---------| | `WriteInt16("IW2", v)` | write input word to controller | | `ReadInt16("QW0", out v)` | read output word from controller | | `WriteInt16("QW0", v)` | `NotSupported` | | `Write(byte[] toPlc)` | write I from offset 0 (short write allowed) | | `Read(out byte[] fromPlc)` | snapshot of Q | | `WriteArea(Output, data)` | `NotSupported` | Optional PDO helper: `PDO.Write(ref tx)` writes I; `PDO.Read(ref rx)` reads Q. Structs must be `[StructLayout(LayoutKind.Sequential, Pack = 1)]`. This is an auxiliary path, not the primary narrative. ## Engineering flow 1. Install product to `C:\DARRA\Profinet_Slave` 2. Start `DarraPnSService` 3. GUI exports GSDML 4. Import GSDML into Siemens TIA 5. `DarraPnS.Connect()` / `Start()` and read diagnostics ## License honesty - Official purchase page: https://profinet.darra.xyz/purchase - Shop reserved: https://shop.darra.xyz/profinet — not listed - Placeholder SKUs `pns_personal` / `pns_enterprise_100` / `pns_enterprise_500` are not live - Trial: 2 hours - Do not reuse EtherCAT activate URLs