Z21 7.1.6
dotnet add package Z21 --version 7.1.6
NuGet\Install-Package Z21 -Version 7.1.6
<PackageReference Include="Z21" Version="7.1.6" />
<PackageVersion Include="Z21" Version="7.1.6" />
<PackageReference Include="Z21" />
paket add Z21 --version 7.1.6
#r "nuget: Z21, 7.1.6"
#:package Z21@7.1.6
#addin nuget:?package=Z21&version=7.1.6
#tool nuget:?package=Z21&version=7.1.6
Z21
A small, event-driven .NET client for the ROCO/Fleischmann Z21 digital command station. It speaks the Z21 LAN protocol (V1.13) over UDP, so you can drive locomotives, throw turnouts, switch track power, read CVs and query system state — and get typed events back whenever something changes on the layout.
station.LocoInfoReceived += (_, loco) =>
Console.WriteLine($"loco {loco.LocoAddress} now at speed {loco.LocoSpeed}");
await station.ConnectAsync();
await station.TrackPowerOnAsync();
await station.DriveAsync(3, DccSpeedMode.Steps128, DrivingDirection.Forward, 40);
You get an IZ21CommandStation from the DI container. To wire it up, add one of the
companion packages: Z21.DependencyInjection (Microsoft.Extensions.DependencyInjection)
or Z21.Autofac (Autofac). Both expose a single AddZ21(...) call.
The full command/response support matrix and protocol notes live on the project page. Licensed under GPL-3.0.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net8.0-windows7.0 is compatible. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- CommandStation.Abstractions (>= 7.1.6)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.8)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.8)
-
net8.0-windows7.0
- CommandStation.Abstractions (>= 7.1.6)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.8)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.8)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Z21:
| Package | Downloads |
|---|---|
|
Z21.DependencyInjection
Package Description |
|
|
Z21.Autofac
Package Description |
|
|
OpenSpeed.Adapter
OpenSpeed hardware adapters: REST speed-sensor client and Z21 DCC controller. Implements OpenSpeed.Core interfaces. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 7.1.6 | 90 | 6/5/2026 |
| 7.1.3 | 91 | 6/5/2026 |
| 7.1.2 | 92 | 6/5/2026 |
| 7.0.8 | 88 | 6/5/2026 |
| 7.0.6 | 87 | 6/5/2026 |
| 7.0.5 | 87 | 6/5/2026 |
| 7.0.2-g7efc542658 | 92 | 6/5/2026 |
| 6.0.3 | 155 | 5/16/2026 |
| 6.0.2 | 111 | 5/16/2026 |
| 5.0.9 | 116 | 5/16/2026 |
| 5.0.8 | 113 | 5/16/2026 |
| 5.0.6 | 206 | 1/25/2026 |
| 5.0.3 | 190 | 1/25/2026 |
| 5.0.2 | 198 | 1/25/2026 |
| 5.0.1 | 212 | 1/25/2026 |
| 5.0.0-beta.16 | 185 | 10/6/2025 |
| 5.0.0-beta.15 | 155 | 10/6/2025 |
| 5.0.0-beta.14 | 155 | 10/6/2025 |
| 4.0.0 | 542 | 5/3/2024 |