Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
1ac88d7
- switch to new project an solution format
jogibear9988 Aug 22, 2024
7a4fa1f
updates for net
jogibear9988 Aug 22, 2024
03c41f2
also build for net472, load correct openssl in net472
jogibear9988 Aug 22, 2024
2025b1c
remove x64 folder from gitignore
jogibear9988 Aug 22, 2024
a37091b
add github builds
jogibear9988 Aug 22, 2024
f177ada
enable build on linux
jogibear9988 Aug 22, 2024
93063a4
try fix build on linux
jogibear9988 Aug 22, 2024
60c09af
remove some warnings from build
jogibear9988 Aug 22, 2024
50d7b11
switch to SHA1.Create from new SHA1Managed (needs to be tested)
jogibear9988 Aug 22, 2024
162bdc6
create a build artifact
jogibear9988 Aug 22, 2024
9bff215
fix workflow
jogibear9988 Aug 22, 2024
4f09795
try fix include of unmanged dlls in nugets (need to be checked)
jogibear9988 Aug 22, 2024
70aa39c
fix compilation in vs2019
jogibear9988 Aug 22, 2024
d55d2f6
Merge branch 'thomas-v2:master' into master
jogibear9988 Jan 22, 2025
406228e
Merge branch 'thomas-v2:master' into master
jogibear9988 Jan 25, 2025
d4709cd
remove net4.7 support
jogibear9988 Jan 26, 2025
14edd3c
remove old solution format
jogibear9988 Jan 26, 2025
fe3c323
remove zlib and work on package
jogibear9988 Feb 19, 2025
1527d15
Merge branch 'master' of https://github.com/thomas-v2/S7CommPlusDriver
jogibear9988 Feb 19, 2025
1a95e2c
work on nuget
jogibear9988 Feb 19, 2025
0a6e848
try publish again
jogibear9988 Feb 19, 2025
328c433
again work on release
jogibear9988 Feb 19, 2025
5c239f8
work on push
jogibear9988 Feb 19, 2025
ef2149b
rmeove some console messages and add more errors
jogibear9988 Feb 19, 2025
ee97319
try fix native files copy
jogibear9988 Feb 19, 2025
eca476d
file missing
jogibear9988 Feb 19, 2025
1405dd2
disable key writer
jogibear9988 Feb 20, 2025
1164350
error to string
jogibear9988 Feb 23, 2025
3decef7
fix keylog
jogibear9988 Feb 23, 2025
f3c6757
refactor write ssl key
jogibear9988 Feb 23, 2025
cde8f97
add more IDs and Block functions to s7commplus
jogibear9988 Mar 5, 2025
263b76e
fix dll loading macos
jogibear9988 Mar 6, 2025
faef08b
fix relative path in macos dll
jogibear9988 Mar 6, 2025
063ab3b
support block download
jogibear9988 Mar 7, 2025
a4cc576
add more out para
jogibear9988 Mar 15, 2025
88bd4eb
Get XML of Folders
jogibear9988 Mar 20, 2025
385f460
add more high level fct
jogibear9988 Mar 20, 2025
c83773c
add udt type
jogibear9988 May 27, 2025
465fdab
add net6 and net9
jogibear9988 Jun 6, 2025
84d3130
install more sdks
jogibear9988 Jun 6, 2025
b0fad13
build for more dotnet versions
jogibear9988 Jun 12, 2025
3491510
Merge branch 'master' of https://github.com/thomas-v2/S7CommPlusDriver
jogibear9988 Jun 12, 2025
af6a0da
Merge branch 'master' of https://github.com/thomas-v2/S7CommPlusDriver
jogibear9988 Oct 30, 2025
8a6d0e2
alarms
jogibear9988 Oct 30, 2025
d3cc257
Merge remote-tracking branch 'thomas/master'
jogibear9988 May 20, 2026
2e946f9
Production harden PLC communication library
jogibear9988 May 20, 2026
36c5e2e
Document production S7CommPlus client
jogibear9988 May 20, 2026
7476d16
Harden S7CommPlus legacy authentication and production client behavior
jogibear9988 May 20, 2026
a3fab22
add crc from js code
jogibear9988 Jun 29, 2026
47488ab
Serialize S7CommPlus requests per connection
jogibear9988 Jun 29, 2026
a460b34
Add PLC text list catalog and alarm formatting
jogibear9988 Jun 29, 2026
2a08d2a
Add CPU state and cycle time APIs
jogibear9988 Jun 30, 2026
668c623
Add CPU control and runtime status APIs
jogibear9988 Jul 1, 2026
7539e35
Update README badges and package docs
jogibear9988 Jul 5, 2026
68ee4fb
Fix native runtime copy target
jogibear9988 Jul 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: .NET

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Fetch history
run: git fetch --prune --unshallow
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
9.0.x
- name: Restore dependencies
run: |
dotnet restore src/S7CommPlusDriver
dotnet restore src/DriverTest
dotnet restore src/S7CommPlusGUIBrowser

- name: Build
run: |
dotnet build src/S7CommPlusDriver
dotnet build src/DriverTest
dotnet build src/S7CommPlusGUIBrowser
- uses: actions/upload-artifact@v4
with:
path: src/S7CommPlusDriver/bin/Debug/*.nupkg
30 changes: 30 additions & 0 deletions .github/workflows/dotnetpull.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: .NET Pull Request

on:
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
8.0.x
9.0.x
- name: Restore dependencies
run: |
dotnet restore src/S7CommPlusDriver
dotnet restore src/DriverTest
dotnet restore src/S7CommPlusGUIBrowser
- name: Build
run: |
dotnet build src/S7CommPlusDriver
dotnet build src/DriverTest
dotnet build src/S7CommPlusGUIBrowser
45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: .NET

on:
release:
types: [published]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Fetch history
run: git fetch --prune --unshallow
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
8.0.x
9.0.x
- name: Restore dependencies
run: |
dotnet restore src/S7CommPlusDriver
dotnet restore src/DriverTest
dotnet restore src/S7CommPlusGUIBrowser

- name: Update project version
uses: roryprimrose/set-vs-sdk-project-version@v1
with:
version: ${{ github.event.release.tag_name }}
assemblyVersion: ${{ github.event.release.tag_name }}
fileVersion: ${{ github.event.release.tag_name }}
informationalVersion: ${{ github.event.release.tag_name }}-${{ github.sha }}

- name: Build
run: |
dotnet build --configuration Release src/S7CommPlusDriver
dotnet build --configuration Release src/DriverTest
dotnet build --configuration Release src/S7CommPlusGUIBrowser
- name: Publish
run: |
dotnet nuget push --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json src/S7CommPlusDriver/bin/Release/*.nupkg

601 changes: 422 additions & 179 deletions README.md

Large diffs are not rendered by default.

40 changes: 40 additions & 0 deletions docs/online-multiplexing-todo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# S7CommPlus online multiplexing notes

Status: implemented in the driver refactor. One `S7CommPlusClient` owns exactly one PLC connection. The library must not silently open additional PLC connections. If an application wants more physical PLC connections, it creates more clients explicitly.

Observed TIA behavior in `C:\Data\temp\Online CPU FA01.pcapng`:

- TIA opened two ES connections to the PLC, not one connection per watched block.
- Online block view traffic used one long-lived watch connection.
- Additional opened or expanded blocks created additional TIS jobs/subscriptions on that same watch connection.
- Responses and notifications were interleaved; notifications are routed by subscription object id.

Implemented driver changes:

- Added a receive dispatcher per protocol session, but arbitrary PLC requests are not run in parallel.
- Thomas' 2025 note is correct for fragmented response bodies: once a large S7CommPlus response is fragmented, the individual fragments do not carry the request sequence number. Sending multiple fragment-producing requests concurrently can make fragment ownership ambiguous.
- One foreground request stays in flight per physical S7CommPlus connection.
- Responses are matched by function code and sequence number.
- Notifications are routed by `Notification.SubscriptionObjectId`.
- Alarm part-2 notifications are also routed by `Notification.P2SubscriptionObjectId` when present.
- Consumed notifications are not left in the dispatcher queue for a second delivery.
- Public API rule:
- One `S7CommPlusClient` means one PLC connection.
- Multiple physical connections are created only when the application creates multiple clients.
- Replaced singleton subscription state with per-subscription handles.
- Tags: subscription object id, reference-id-to-tag map, next credit limit.
- Alarms: subscription object id, next credit limit.
- TIS watch: job object id, subscription object id, subscription-ref object id, result model, poll counter.
- Multiple subscriptions can coexist on one client.
- Create/delete/read/metadata operations stay serialized as normal session requests.
- Notification loops wait for their own subscription object id.
- Reads/metadata may run while subscriptions are active, but not in parallel with another foreground request on the same physical connection.
- If an application needs true parallel large metadata/block transfers, it should create a second `S7CommPlusClient` explicitly.
- Explicit helper APIs stay explicit.
- Snapshot helpers may accept another `S7CommPlusClient`, but should not create one implicitly.
- For online engineering features prefer `S7CommPlusDefaults.RemoteTsapEs`.

Live-test rule:

- Do not test against `10.0.10.100` or the production/FA01 CPU.
- If live PLC testing is needed, use only `10.0.98.206`.
1 change: 0 additions & 1 deletion src/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@
[Rr]elease/
[Bb]in/
[Oo]bj/
x64/
build/
116 changes: 25 additions & 91 deletions src/DriverTest/DriverTest.csproj
Original file line number Diff line number Diff line change
@@ -1,92 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{94755B6A-7E0D-40F9-A2ED-48FF0C0FEA2B}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DriverTest</RootNamespace>
<AssemblyName>DriverTest</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TestPlcTag.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\S7CommPlusDriver\S7CommPlusDriver.csproj">
<Project>{781951d8-80de-4e2f-92ca-a5fef0059415}</Project>
<Name>S7CommPlusDriver</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>xcopy /y /d "$(SolutionDir)S7CommPlusDriver\OpenSSL-dll-$(PlatformName)\*.dll" "$(ProjectDir)$(OutDir)"</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
<OutputType>Exe</OutputType>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\S7CommPlusDriver\S7CommPlusDriver.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
<PropertyGroup>
<AssemblyTitle>DriverTest</AssemblyTitle>
<Description>S7CommPlusDriver Test</Description>
<Product>DriverTest</Product>
<Copyright>Copyright © 2023, Thomas Wiens</Copyright>
<AssemblyVersion>0.1.0.0</AssemblyVersion>
<FileVersion>0.1.0.0</FileVersion>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
</Project>
Loading