Z21 7.1.9
dotnet add package Z21 --version 7.1.9
NuGet\Install-Package Z21 -Version 7.1.9
<PackageReference Include="Z21" Version="7.1.9" />
<PackageVersion Include="Z21" Version="7.1.9" />
<PackageReference Include="Z21" />
paket add Z21 --version 7.1.9
#r "nuget: Z21, 7.1.9"
#:package Z21@7.1.9
#addin nuget:?package=Z21&version=7.1.9
#tool nuget:?package=Z21&version=7.1.9
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.9)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.8)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.8)
-
net8.0-windows7.0
- CommandStation.Abstractions (>= 7.1.9)
- 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.9 | 178 | 6/27/2026 |
| 7.1.7 | 140 | 6/27/2026 |
| 7.1.6 | 212 | 6/5/2026 |
| 7.1.3 | 208 | 6/5/2026 |
| 7.1.2 | 212 | 6/5/2026 |
| 7.0.8 | 204 | 6/5/2026 |
| 7.0.6 | 211 | 6/5/2026 |
| 7.0.5 | 202 | 6/5/2026 |
| 7.0.2-g7efc542658 | 181 | 6/5/2026 |
| 6.0.3 | 215 | 5/16/2026 |
| 6.0.2 | 170 | 5/16/2026 |
| 5.0.9 | 173 | 5/16/2026 |
| 5.0.8 | 172 | 5/16/2026 |
| 5.0.6 | 263 | 1/25/2026 |
| 5.0.3 | 245 | 1/25/2026 |
| 5.0.2 | 253 | 1/25/2026 |
| 5.0.1 | 269 | 1/25/2026 |
| 5.0.0-beta.16 | 192 | 10/6/2025 |
| 5.0.0-beta.15 | 161 | 10/6/2025 |
| 5.0.0-beta.14 | 161 | 10/6/2025 |