DotNetProjects.S7CommPlusDriver
2.1.0
dotnet add package DotNetProjects.S7CommPlusDriver --version 2.1.0
NuGet\Install-Package DotNetProjects.S7CommPlusDriver -Version 2.1.0
<PackageReference Include="DotNetProjects.S7CommPlusDriver" Version="2.1.0" />
<PackageVersion Include="DotNetProjects.S7CommPlusDriver" Version="2.1.0" />
<PackageReference Include="DotNetProjects.S7CommPlusDriver" />
paket add DotNetProjects.S7CommPlusDriver --version 2.1.0
#r "nuget: DotNetProjects.S7CommPlusDriver, 2.1.0"
#:package DotNetProjects.S7CommPlusDriver@2.1.0
#addin nuget:?package=DotNetProjects.S7CommPlusDriver&version=2.1.0
#tool nuget:?package=DotNetProjects.S7CommPlusDriver&version=2.1.0
DotNetProjects.S7CommPlusDriver
Production-oriented S7CommPlus communication library for Siemens S7-1200/1500 PLCs.
Install from NuGet:
dotnet add package DotNetProjects.S7CommPlusDriver
Use S7CommPlusClient for new applications. It provides async connect, browse, read, write, alarm, subscription, CPU metadata/control, block metadata, online block-view, and legitimation operations with request serialization, typed exceptions, connection-state events, reconnect support for read operations, and an explicit write-enable safety gate.
TLS is the default security mode, using the managed BouncyCastle TLS backend unless S7CommPlusClientOptions.TlsBackend is set explicitly. On net8.0 and later, older S7-1200/1500 CPUs can use S7CommPlusSecurityMode.LegacyChallenge or Auto for HarpoS7-derived legacy challenge authentication. net6.0 remains TLS-only.
Default connection parameters are exposed through S7CommPlusDefaults: ISO-on-TCP port 102, local TSAP 0x0600, HMI remote TSAP SIMATIC-ROOT-HMI, and engineering remote TSAP SIMATIC-ROOT-ES. Remote TSAP values are validated as ASCII COTP parameters before connecting.
Older PLCs / Legacy Challenge Auth
Siemens OMS names the old non-TLS mode SecurityTypeCSI. This library exposes it as S7CommPlusSecurityMode.LegacyChallenge and keeps TLS as the default, so there is no silent security downgrade.
await using var client = new S7CommPlusClient(new S7CommPlusClientOptions
{
Address = "10.0.98.34",
SecurityMode = S7CommPlusSecurityMode.LegacyChallenge,
WriteEnabled = false
});
await client.ConnectAsync();
var cpuInfo = await client.GetCpuInfoAsync();
await client.DisconnectAsync();
Legacy support uses the PLC fingerprint to resolve a Siemens public-key family. Known mappings are S7-1500 (00), S7-1200 (01), and PLCSIM/VPLC (03). The implementation references the HarpoS7 and HarpoS7.PublicKeys NuGet packages for challenge/key/digest primitives on net8.0 and net9.0, while this driver still owns transport, request ordering, timeouts, reconnect behavior, and write protection.
Subscriptions
Variable and alarm subscriptions are available through disposable production objects:
var tag = await client.GetTagBySymbolAsync("MyDb.MyValue");
await using var subscription = await client.SubscribeTagsAsync(new[] { tag });
subscription.NotificationReceived += (_, e) =>
{
foreach (var item in e.Notification.Items)
{
if (item.IsSuccess)
{
Console.WriteLine(item.Tag);
}
}
};
Subscriptions share the client connection with normal request/response calls. The driver serializes foreground requests on that physical connection and routes subscription notifications by PLC subscription object id, so reads and metadata requests can run while subscriptions are active without creating another PLC connection. Alarm subscriptions use SubscribeAlarmsAsync(languageId) and expose NotificationReceived, CommunicationError, StateChanged, and Completion in the same way. Use SubscribeAlarmsAsync() or GetActiveAlarmsAsync() without a language id to request every alarm text language returned by the PLC; the legacy AlarmTexts property contains the first returned language, and AlarmTextsByLanguage contains the full set. The library does not silently open a second PLC connection for alarm snapshots. If you need a live alarm subscription plus an initial active-alarm snapshot on a separate physical connection, create a second S7CommPlusClient yourself and pass it to the SubscribeAlarmsWithSnapshotAsync(snapshotClient, ...) overload.
PLC Text Lists for Alarms
Alarm text payloads can contain TIA-style text-list placeholders such as @2%t#519K@. Load the PLC text-list catalog and pass it to the alarm APIs to resolve those placeholders, including nested system-diagnostic text-list references:
var textLists = await client.GetTextListsAsync(); // all CPU LCIDs + language-independent system lists
var alarms = await client.GetActiveAlarmsAsync(1031, textLists);
await using var alarmSubscription = await client.SubscribeAlarmsAsync(1031, textLists);
Use GetTextListsAsync(new[] { 1031, 2057 }) when only selected LCIDs are needed. The catalog remains one API, but each S7CommPlusTextList has TextListType (User, System, or Unknown) so applications can filter or display the same distinction shown by engineering tools. The online PLC payload does not carry the exact engineering project object kind, so classification follows Siemens runtime list-id conventions; placeholder resolution still uses both user and system lists.
Associated-value placeholders are formatted too. @2W%d@ means the second associated value, read as a WORD, displayed as signed decimal.
Each S7CommPlusAlarm exposes SourceRelationId and SourceAlarmId, decoded from CpuAlarmId. For PLC program alarms, SourceRelationId can be matched with a separately built online block/catalog model to find the source block.
Communication limits are exposed through GetCommunicationResourcesAsync(), including max read/write batch sizes, available PLC subscription slots, and subscription memory.
Block Metadata and Online View
Block metadata is available through BrowseBlocksAsync(), GetPlcStructureXmlAsync(), BrowseBlockStructureAsync(), and GetBlockContentAsync(relid).
Advanced block-watch scenarios can use OpenBlockOnlineViewAsync() with a caller-provided S7CommPlusTisWatchRequest; the returned S7CommPlusTisWatchSubscription exposes parsed watch notifications and follows the same disposable subscription lifecycle.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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. net9.0 is compatible. 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. |
-
net6.0
- BouncyCastle.Cryptography (>= 2.6.2)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.3)
- zlib.net-mutliplatform (>= 1.0.8)
-
net8.0
- BouncyCastle.Cryptography (>= 2.6.2)
- CommunityToolkit.HighPerformance (>= 8.2.2)
- HarpoS7 (>= 1.1.2)
- HarpoS7.PublicKeys (>= 1.1.2)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.3)
- zlib.net-mutliplatform (>= 1.0.8)
-
net9.0
- BouncyCastle.Cryptography (>= 2.6.2)
- CommunityToolkit.HighPerformance (>= 8.2.2)
- HarpoS7 (>= 1.1.2)
- HarpoS7.PublicKeys (>= 1.1.2)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.3)
- zlib.net-mutliplatform (>= 1.0.8)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on DotNetProjects.S7CommPlusDriver:
| Package | Downloads |
|---|---|
|
jfk-solutions.TiaFileFormat.S7CommPlus
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.1.0 | 69 | 7/5/2026 |
| 2.0.0 | 71 | 7/5/2026 |
| 1.1.2 | 339 | 10/30/2025 |
| 1.1.1 | 217 | 10/30/2025 |
| 1.1.0 | 555 | 6/12/2025 |
| 1.0.18 | 183 | 6/6/2025 |
| 1.0.16 | 230 | 5/27/2025 |
| 1.0.15 | 281 | 3/20/2025 |
| 1.0.14 | 231 | 3/20/2025 |
| 1.0.13 | 159 | 3/15/2025 |
| 1.0.12 | 328 | 3/6/2025 |
| 1.0.11 | 299 | 3/6/2025 |
| 1.0.10 | 341 | 3/5/2025 |
| 1.0.9 | 203 | 2/23/2025 |
| 1.0.8 | 207 | 2/23/2025 |
| 1.0.7 | 209 | 2/20/2025 |
| 1.0.6 | 218 | 2/19/2025 |
| 1.0.4 | 193 | 2/19/2025 |