Z21 7.1.2
See the version list below for details.
dotnet add package Z21 --version 7.1.2
NuGet\Install-Package Z21 -Version 7.1.2
<PackageReference Include="Z21" Version="7.1.2" />
<PackageVersion Include="Z21" Version="7.1.2" />
<PackageReference Include="Z21" />
paket add Z21 --version 7.1.2
#r "nuget: Z21, 7.1.2"
#:package Z21@7.1.2
#addin nuget:?package=Z21&version=7.1.2
#tool nuget:?package=Z21&version=7.1.2
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.2)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.8)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.8)
-
net8.0-windows7.0
- CommandStation.Abstractions (>= 7.1.2)
- 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 | 120 | 6/5/2026 |
| 7.1.3 | 120 | 6/5/2026 |
| 7.1.2 | 121 | 6/5/2026 |
| 7.0.8 | 118 | 6/5/2026 |
| 7.0.6 | 117 | 6/5/2026 |
| 7.0.5 | 116 | 6/5/2026 |
| 7.0.2-g7efc542658 | 127 | 6/5/2026 |
| 6.0.3 | 165 | 5/16/2026 |
| 6.0.2 | 122 | 5/16/2026 |
| 5.0.9 | 126 | 5/16/2026 |
| 5.0.8 | 124 | 5/16/2026 |
| 5.0.6 | 216 | 1/25/2026 |
| 5.0.3 | 200 | 1/25/2026 |
| 5.0.2 | 208 | 1/25/2026 |
| 5.0.1 | 223 | 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 | 553 | 5/3/2024 |