├── .gitattributes
├── .gitignore
├── .vscode
├── launch.json
└── tasks.json
├── LICENSE.md
├── README.md
└── Sources
├── AdsSecureSamples
└── AdsSecureConsoleApp
│ ├── .vscode
│ ├── launch.json
│ └── tasks.json
│ ├── AdsSecureConsoleApp.csproj
│ ├── AdsSecureConsoleApp.sln
│ ├── ArgParser.cs
│ ├── Certs
│ ├── RootCA.key
│ ├── RootCA.pem
│ ├── RootCA.srl
│ ├── SourceIPC.crt
│ ├── SourceIPC.csr
│ ├── SourceIPC.key
│ ├── TargetIPC.crt
│ ├── TargetIPC.csr
│ ├── TargetIPC.key
│ ├── WrongRootCA.key
│ └── WrongRootCA.pem
│ ├── Program.cs
│ ├── Properties
│ └── launchSettings.json
│ └── README.md
├── BaseSamples
├── .vscode
│ ├── launch.json
│ └── tasks.json
├── AccessByVarName
│ ├── AccessByVarName.cs
│ └── S02_AccessByVarName.csproj
├── EventReading
│ ├── Form1.cs
│ ├── Form1.resx
│ └── S03_EventReading.csproj
├── Heartbeat
│ ├── Program.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── S50_Heartbeat.csproj
├── MethodCall
│ ├── Form1.Designer.cs
│ ├── Form1.cs
│ ├── Form1.resx
│ ├── Program.cs
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
│ └── S30_MethodCall.csproj
├── PLCStartStop
│ ├── PLCStartStop.cs
│ └── S20_PLCStartStop.csproj
├── Reactive
│ ├── Program.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── S80_Reactive.csproj
├── ReadArray
│ ├── Form1.Designer.cs
│ ├── Form1.cs
│ ├── Form1.resx
│ ├── Program.cs
│ └── S12_ReadArray.csproj
├── ReadVariableDeclaration
│ ├── Form1.cs
│ ├── Form1.resx
│ └── S21_ReadVariableDeclaration.csproj
├── ReadWriteAnyType
│ ├── Form1.cs
│ ├── Form1.resx
│ └── S14_ReadWriteAnyType.csproj
├── ReadWriteDateTime
│ ├── Form1.cs
│ └── S11_ReadWriteDateTime.csproj
├── ReadWriteFlag
│ ├── Form1.cs
│ ├── Form1.resx
│ └── S01_ReadWriteFlag.csproj
├── ReadWriteString
│ ├── Form1.cs
│ ├── Form1.resx
│ └── S10_ReadWriteString.csproj
├── SamplePlc
│ ├── 00_TwinCAT_Demo_PLC.tsproj
│ └── PLC
│ │ ├── DUTs
│ │ ├── PLCStruct.TcDUT
│ │ ├── TComplexStruct.TcDUT
│ │ └── TSimpleStruct.TcDUT
│ │ ├── GVLs
│ │ └── GVL.TcGVL
│ │ ├── PLC.plcproj
│ │ ├── PLC.tmc
│ │ ├── POUs
│ │ ├── FB_Math.TcPOU
│ │ └── MAIN.TcPOU
│ │ ├── PlcTask.TcTTO
│ │ └── Version
│ │ └── Global_Version.TcGVL
├── Server
│ ├── AdsSampleServer.cs
│ ├── NotificationRequestEntry.cs
│ ├── Program.cs
│ ├── S60_Server.csproj
│ └── Worker.cs
├── SumReadWrite
│ ├── Form1.Designer.cs
│ ├── Form1.cs
│ ├── Form1.resx
│ ├── Program.cs
│ └── S22_AdsSumReadWrite.csproj
├── TF6000_ADS_DOTNET_V5_BaseSamples.sln
├── TcStateChange
│ ├── Form1.Designer.cs
│ ├── Form1.cs
│ ├── Form1.resx
│ ├── Program.cs
│ └── S23_TcStateChange.csproj
├── TwinCAT_Demo_PLC
│ ├── PLC
│ │ ├── DUTs
│ │ │ ├── MYSTRUCT.TcDUT
│ │ │ ├── MyComplexStruct.TcDUT
│ │ │ ├── PLCStruct.TcDUT
│ │ │ ├── TComplexStruct.TcDUT
│ │ │ └── TSimpleStruct.TcDUT
│ │ ├── GVLs
│ │ │ └── GVL.TcGVL
│ │ ├── PLC.plcproj
│ │ ├── POUs
│ │ │ ├── FB_Math.TcPOU
│ │ │ └── MAIN.TcPOU
│ │ ├── PlcTask.TcTTO
│ │ └── Version
│ │ │ └── Global_Version.TcGVL
│ └── TwinCAT_Demo_PLC.tsproj
├── WPFConnectionObserver
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── MainWindow.xaml
│ ├── MainWindow.xaml.cs
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
│ └── S40_WPFConnectionObserver.csproj
└── WriteStruct
│ ├── Form1.cs
│ ├── Form1.resx
│ └── S13_WriteStruct.csproj
├── ClientSamples
├── AdsCli
│ ├── .gitignore
│ ├── .vscode
│ │ ├── launch.json
│ │ └── tasks.json
│ ├── AdsCli.sln
│ ├── Dockerfile
│ ├── README.md
│ └── src
│ │ ├── AdsCli.csproj
│ │ ├── AdsCommand.cs
│ │ ├── ArgsParser.cs
│ │ ├── Logger.cs
│ │ └── Programm.cs
├── AdsOverMqttApp
│ ├── .gitignore
│ ├── .vscode
│ │ └── launch.json
│ ├── AdsOverMqttApp.sln
│ ├── Overview.drawio
│ ├── Overview.svg
│ ├── README.md
│ └── src
│ │ ├── AdsOverMqttApp.csproj
│ │ ├── HostedService.cs
│ │ ├── Program.cs
│ │ ├── appSettings.json
│ │ └── settings.env
└── WpfAdsSession
│ ├── WpfAdsSession.sln
│ └── WpfAdsSession
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── DataTypeTemplateSelector.cs
│ ├── DataTypesControl.xaml
│ ├── DataTypesControl.xaml.cs
│ ├── DataTypesViewModel.cs
│ ├── MainWindow.xaml
│ ├── MainWindow.xaml.cs
│ ├── Properties
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
│ ├── Resources
│ ├── Alias.ico
│ ├── Array.ico
│ ├── DataType.ico
│ ├── Enum.ico
│ ├── Primitive.ico
│ ├── String.ico
│ ├── Struct.ico
│ └── Symbol.ico
│ ├── SymbolTemplateSelector.cs
│ ├── SymbolsControl.xaml
│ ├── SymbolsControl.xaml.cs
│ ├── SymbolsViewModel.cs
│ ├── SymbolsWindow.xaml
│ ├── SymbolsWindow.xaml.cs
│ └── WpfAdsSession.csproj
├── DockerSamples
├── .dockerignore
├── .vscode
│ ├── launch.json
│ └── tasks.json
├── AdsClient
│ ├── AdsClient.csproj
│ ├── Dockerfile
│ ├── Program.cs
│ ├── Properties
│ │ └── launchSettings.json
│ └── Worker.cs
├── AdsRouterConsole
│ ├── AdsRouterConsole.csproj
│ ├── Dockerfile
│ ├── Program.cs
│ ├── Properties
│ │ └── launchSettings.json
│ └── Worker.cs
├── AdsServer
│ ├── AdsServer.cs
│ ├── AdsServer.csproj
│ ├── Dockerfile
│ ├── Program.cs
│ ├── Properties
│ │ └── launchSettings.json
│ └── Worker.cs
├── DockerSample.sln
├── MQTTConfiguration.drawio
├── MQTTConfiguration.svg
├── NuGet.Config
├── PwshClient
│ ├── Dockerfile
│ └── init.ps1
├── ReadMe.md
├── RouterConsoleConfiguration.drawio
├── RouterConsoleConfiguration.svg
├── config-mqtt.env
├── config-routerconsole.env
├── docker-compose.mqtt.yml
├── docker-compose.routerconsole.yml
└── simple-mosquitto.conf
├── ManagementSamples
└── PwshBroadcastSearch
│ ├── Program.cs
│ ├── PwshBroadcastSearch.csproj
│ └── PwshBroadcastSearch.sln
├── ProviderSamples
└── CustomSessionProvider
│ ├── CustomSessionProvider.csproj
│ ├── CustomSessionProvider.sln
│ ├── CustomSymbolProvider.cs
│ └── ReadMe.md
├── RouterSamples
├── AdsRouterAndClientConsoleApp
│ ├── AdsRouterAndClientConsoleApp.sln
│ ├── AdsRouterAndClientConsoleApp
│ │ ├── AdsRouterAndClientConsoleApp.csproj
│ │ ├── Program.cs
│ │ ├── Services
│ │ │ ├── AdsBaseService.cs
│ │ │ ├── ClientService1.cs
│ │ │ ├── ClientService2.cs
│ │ │ └── RouterService.cs
│ │ └── appsettings.json
│ └── ReadMe.md
├── AdsRouterConsoleApp
│ ├── .gitignore
│ ├── .vscode
│ │ ├── launch.json
│ │ ├── settings.json
│ │ └── tasks.json
│ ├── AdsRouterConsoleApp.sln
│ ├── Dockerfile
│ ├── README.md
│ ├── docs
│ │ ├── run-as-docker-container.md
│ │ └── run-beneath-TwinCATRouter.md
│ └── src
│ │ ├── AdsRouterConsoleApp.csproj
│ │ ├── Program.cs
│ │ ├── Worker.cs
│ │ ├── appSettings.json
│ │ ├── settings-bridged-network.env
│ │ └── settings-host-network.env
├── AdsRouterWpfApp
│ ├── AdsRouterWpfApp.csproj
│ ├── AdsRouterWpfApp.sln
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── AssemblyInfo.cs
│ ├── MainWindow.xaml
│ ├── MainWindow.xaml.cs
│ └── ReadMe.md
└── ReadMe.md
└── ServerSamples
├── AdsServerSample
├── AdsServerConsoleApp.png
├── AdsServerConsoleApp
│ ├── AdsSampleServer.cs
│ ├── AdsServerConsoleApp.csproj
│ ├── App.config
│ ├── Logger.cs
│ ├── NotificationRequestEntry.cs
│ ├── Program.cs
│ └── Worker.cs
├── AdsServerSample.sln
├── AdsServerTester.png
├── AdsServerTester
│ ├── AdsSampleServerTester.Designer.cs
│ ├── AdsSampleServerTester.cs
│ ├── AdsSampleServerTester.resx
│ ├── AdsServerTester.csproj
│ └── app.config
└── ReadMe.md
└── AdsSymbolicServerSample
├── AdsSymbolicServer.cs
├── AdsSymbolicServerSample.csproj
├── AdsSymbolicServerSample.sln
├── Program.cs
├── Properties
└── launchSettings.json
└── ReadMe.md
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "0.2.0",
3 | "configurations": [
4 | {
5 | // Use IntelliSense to find out which attributes exist for C# debugging
6 | // Use hover for the description of the existing attributes
7 | // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
8 | "name": "AdsSymbolServer ConsoleApp",
9 | "type": "coreclr",
10 | "request": "launch",
11 | "preLaunchTask": "build",
12 | // If you have changed target frameworks, make sure to update the program path.
13 | "program": "${workspaceFolder}/Sources/ServerSamples/AdsSymbolicServerSample/bin/Debug/net6.0/AdsSymbolicServerSample.dll",
14 | "args": [],
15 | "cwd": "${workspaceFolder}/Sources/ServerSamples/AdsSymbolicServerSample",
16 | // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
17 | "console": "integratedTerminal",
18 | "stopAtEntry": false
19 | },
20 | {
21 | // Use IntelliSense to find out which attributes exist for C# debugging
22 | // Use hover for the description of the existing attributes
23 | // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
24 | "name": "AdsSecure ConsoleApp",
25 | "type": "coreclr",
26 | "request": "launch",
27 | "preLaunchTask": "build",
28 | // If you have changed target frameworks, make sure to update the program path.
29 | "program": "${workspaceFolder}/Sources/AdsSecureSamples/AdsSecureConsoleApp/bin/Debug/net6.0/AdsSecureConsoleApp.dll",
30 | "args": [],
31 | "cwd": "${workspaceFolder}/Sources/AdsSecureSamples/AdsSecureConsoleApp",
32 | // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
33 | "console": "internalConsole",
34 | "stopAtEntry": false
35 | }
36 | ]
37 | }
--------------------------------------------------------------------------------
/.vscode/tasks.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "2.0.0",
3 | "tasks": [
4 | {
5 | "label": "build AdsSecureSamples",
6 | "command": "dotnet",
7 | "type": "process",
8 | "args": [
9 | "build",
10 | "${workspaceFolder}/Sources/AdsSecureSamples/AdsSecureConsoleApp/AdsSecureConsoleApp.csproj",
11 | "/property:GenerateFullPaths=true",
12 | "/consoleloggerparameters:NoSummary"
13 | ],
14 | "problemMatcher": "$msCompile"
15 | },
16 | {
17 | "label": "build AdsServer",
18 | "command": "dotnet",
19 | "type": "process",
20 | "args": [
21 | "build",
22 | "${workspaceFolder}/Sources/DockerSamples/AdsServer/AdsServer.csproj",
23 | "/property:GenerateFullPaths=true",
24 | "/consoleloggerparameters:NoSummary"
25 | ],
26 | "problemMatcher": "$msCompile",
27 | "group": {
28 | "kind": "build",
29 | "isDefault": true
30 | }
31 | },
32 | {
33 | "label": "publish",
34 | "command": "dotnet",
35 | "type": "process",
36 | "args": [
37 | "publish",
38 | "${workspaceFolder}/Sources/AdsSecureSamples/AdsSecureConsoleApp/AdsSecureConsoleApp.csproj",
39 | "/property:GenerateFullPaths=true",
40 | "/consoleloggerparameters:NoSummary"
41 | ],
42 | "problemMatcher": "$msCompile"
43 | },
44 | {
45 | "label": "watch",
46 | "command": "dotnet",
47 | "type": "process",
48 | "args": [
49 | "watch",
50 | "run",
51 | "--project",
52 | "${workspaceFolder}/Sources/AdsSecureSamples/AdsSecureConsoleApp/AdsSecureConsoleApp.csproj"
53 | ],
54 | "problemMatcher": "$msCompile"
55 | }
56 | ]
57 | }
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | BSD Zero Clause License
2 |
3 | Copyright (c) 2021 Beckhoff Automation GmbH & Co. KG
4 |
5 | Permission to use, copy, modify, and/or distribute this software for any
6 | purpose with or without fee is hereby granted.
7 |
8 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10 | AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12 | LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13 | OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14 | PERFORMANCE OF THIS SOFTWARE.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # About this repository
2 | This repository contains official sample code for the product TF6000|TwinCAT ADS .NET V6 offered by [Beckhoff Automation](https://www.beckhoff.com). The sample code is provided as-is under the Zero-Clause BSD license.
3 |
4 | # How to get support
5 | Should you have any questions regarding the provided sample code, please contact your local Beckhoff support team. Contact information can be found on the official Beckhoff website at https://www.beckhoff.com/contact/.
6 |
7 | # Further information
8 | Further information about this sample code can be found on the [Beckhoff Information System](https://infosys.beckhoff.com) in the [ADS .NET V6 documentation](https://infosys.beckhoff.com/english.php?content=../content/1033/tc3_ads.net/index.html&id=3120360106606588270).
9 |
--------------------------------------------------------------------------------
/Sources/AdsSecureSamples/AdsSecureConsoleApp/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "0.2.0",
3 | "configurations": [
4 | {
5 | // Use IntelliSense to find out which attributes exist for C# debugging
6 | // Use hover for the description of the existing attributes
7 | // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
8 | "name": ".NET Core Launch (console)",
9 | "type": "coreclr",
10 | "request": "launch",
11 | "preLaunchTask": "build",
12 | // If you have changed target frameworks, make sure to update the program path.
13 | "program": "${workspaceFolder}/bin/Debug/net5.0/AdsSecureConsoleApp.dll",
14 | "args": [],
15 | "cwd": "${workspaceFolder}",
16 | // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
17 | "console": "internalConsole",
18 | "stopAtEntry": false
19 | },
20 | {
21 | "name": ".NET Core Attach",
22 | "type": "coreclr",
23 | "request": "attach"
24 | }
25 | ]
26 | }
--------------------------------------------------------------------------------
/Sources/AdsSecureSamples/AdsSecureConsoleApp/.vscode/tasks.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "2.0.0",
3 | "tasks": [
4 | {
5 | "label": "build",
6 | "command": "dotnet",
7 | "type": "process",
8 | "args": [
9 | "build",
10 | "${workspaceFolder}/AdsSecureConsoleApp.csproj",
11 | "/property:GenerateFullPaths=true",
12 | "/consoleloggerparameters:NoSummary"
13 | ],
14 | "problemMatcher": "$msCompile"
15 | },
16 | {
17 | "label": "publish",
18 | "command": "dotnet",
19 | "type": "process",
20 | "args": [
21 | "publish",
22 | "${workspaceFolder}/AdsSecureConsoleApp.csproj",
23 | "/property:GenerateFullPaths=true",
24 | "/consoleloggerparameters:NoSummary"
25 | ],
26 | "problemMatcher": "$msCompile"
27 | },
28 | {
29 | "label": "watch",
30 | "command": "dotnet",
31 | "type": "process",
32 | "args": [
33 | "watch",
34 | "run",
35 | "${workspaceFolder}/AdsSecureConsoleApp.csproj",
36 | "/property:GenerateFullPaths=true",
37 | "/consoleloggerparameters:NoSummary"
38 | ],
39 | "problemMatcher": "$msCompile"
40 | }
41 | ]
42 | }
--------------------------------------------------------------------------------
/Sources/AdsSecureSamples/AdsSecureConsoleApp/AdsSecureConsoleApp.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | disable
7 |
8 |
9 |
10 | False
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/Sources/AdsSecureSamples/AdsSecureConsoleApp/AdsSecureConsoleApp.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.31515.178
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AdsSecureConsoleApp", "AdsSecureConsoleApp.csproj", "{555C2D83-C7EC-4D64-AA5A-B61F4AF07376}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {555C2D83-C7EC-4D64-AA5A-B61F4AF07376}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {555C2D83-C7EC-4D64-AA5A-B61F4AF07376}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {555C2D83-C7EC-4D64-AA5A-B61F4AF07376}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {555C2D83-C7EC-4D64-AA5A-B61F4AF07376}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {502F694D-6F0B-4BE5-B90F-89B816B2A52A}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/Sources/AdsSecureSamples/AdsSecureConsoleApp/ArgParser.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Net;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using TwinCAT.Ads;
8 |
9 | namespace AdsSecureConsoleApp
10 | {
11 | public static class ArgParser
12 | {
13 | ///
14 | /// Parses the arguments.
15 | ///
16 | /// The arguments.
17 | /// AmsAddress.
18 | public static bool TryParse(string[] args, out AmsAddress address, out string ipOrHostName)
19 | {
20 | bool ret = false;
21 | AmsNetId netId = null;
22 | int port = -1;
23 | IPAddress ip;
24 |
25 | address = null;
26 | ipOrHostName = null;
27 |
28 | if (args != null && args.Length == 3)
29 | {
30 | ret = true;
31 | ret &= AmsNetId.TryParse(args[0], out netId);
32 | ret &= int.TryParse(args[1], out port);
33 |
34 | if (!string.IsNullOrEmpty(args[2]))
35 | {
36 | if (IPAddress.TryParse(args[2], out ip))
37 | {
38 | ipOrHostName = ip.ToString();
39 | }
40 | else
41 | {
42 | ipOrHostName= args[2];
43 | }
44 |
45 | }
46 | else
47 | ret = false;
48 |
49 | }
50 | else
51 | {
52 | ret = false;
53 | }
54 |
55 | if (ret)
56 | {
57 | address = new AmsAddress(netId, port);
58 | }
59 | return ret;
60 | }
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/Sources/AdsSecureSamples/AdsSecureConsoleApp/Certs/RootCA.key:
--------------------------------------------------------------------------------
1 | -----BEGIN RSA PRIVATE KEY-----
2 | MIIEpAIBAAKCAQEA7nxfpTuEb/vsnLrzF+7Yi6DN8KFiZjsbq88K/GIE7PPRbtdv
3 | VQvI6UUIVhUTi40Qu5rcDPxAY1x5Txq1yqi+o6gaKwIgPo/6an4AVOXIlJvBTgIo
4 | doKYw249QNI0OEYT7V2FQAfMzVaTLzVC2auIKPc9f8Zxgc7gmEwvdn2j9j3jsxEh
5 | 5mBuf+fh4wg7vMYhS7Q2X/3D6cgXeWBd12KuiWbrx0ZGHeFEFE1oGfoVOQuV2qT3
6 | 2xmvjRsjrzn34wi/oDesL3tHpeBv9y3vI7errwt6mfsIBeYFMqRadH68KVqn4/Rw
7 | 13lPceMRFF8C2Q2RBAKps/QKAJ71iDQiqzDrTwIDAQABAoIBABbBHSsZw6gfpFLL
8 | 75fP/S9NV3jnHQleCGTbK1QrUgb9uHTX71Jw/mlrYcE835GIExmjS+2dP9N7JkPq
9 | 6397nDznNB/4YvU1LZJtlUCEcB/lwIrd39h223aCFSwTIlJgNVSHgMg8Nkk9QmvV
10 | rBwyppoqBN8lIv1crMc7NagbksJStDk8ogIWTUnnrK+jDQul4eI5KeodzlDVCr6C
11 | VC/9RLO4ZcU9XeUAdd7bQFBtjr5z9AjkHHpMsww8gYlcPOUNh3bZnDZmHOZMo09O
12 | 88XKq9UNiIiImw9tlXrgM1cq7t7KSW51CA6RsC7a14e6g0DgfUHwLNRiH+bNXgBs
13 | FDImxRECgYEA+GmDf8NdtP4oHeSlC/GA1VD/N655gul+Rc/0E8P7IjRX6dkAPuUO
14 | EehhdxG6IkvtsvDcxgMztg2prKoW+cDh0y6xfY8jCefxUIbcqoxmIkHYRmkBtQZJ
15 | OFLMSz0kobBLaagIhVZKJ8k1N2EwYjw8cm1vRxB1mMNH9Ul4rHb6accCgYEA9cU9
16 | a9IEl65/ln8IZN1zfyaC4NYg9LQAeKKKwususdWGfgkqbc2raD2k0jeffyWBBiDX
17 | PuLx6jrN9V4RgDBhxk/9rzg4ViAgwi3HVio8OOh/VDQz2DeNNK4nzWj14T/mf5XZ
18 | OueBKyhUgLaUFAxjzaGxm9mzaFFOx6ySagkFsjkCgYEAoglJgoRwUohaqK0lT7YX
19 | gI3V/H8tucwO1wD/yAjVfolAM0SeWWhWFi5LrTx9+rMmeMuOZwddqsocvIkydXVw
20 | mK1jj3BXvbVy/kEKHaF5Wa0zozIJsAhKqJextP5ML7/sYR3/eOJBetRPhzE5O0rp
21 | bwadSHCfFKeE/6YONglh7K8CgYEAyTJeNO0qa04kDv0RzxjnWzkYvZ0uP4U4OYm/
22 | FRDZGiZWQsmYHWnYn66PRrTYcosuU+kArO+24WygfPU0WH/DG0kSwaXBoOgOSUiW
23 | vjg3MtNKoZFWu/PGOlE0Lll1qJ/aP6pZunoY6U7L1s8g7ES0U3vCXXbcA1NErfvd
24 | pMacDikCgYA9/RiQpVsU7/r/KQbVc/g0K54BMnwqPSqOcw9YiCbDeYZsKdVkdr5J
25 | zykyNzioOMl/95DWk7b7+5bv1TY1uls4+PpLtkzl2K9EN07rrGKt808WVLM8YsUA
26 | OQXebgIdNaen4Gq3NbJItLdp0ehdm4u+qo8HAHPTYmIED/PWsKFkyg==
27 | -----END RSA PRIVATE KEY-----
28 |
--------------------------------------------------------------------------------
/Sources/AdsSecureSamples/AdsSecureConsoleApp/Certs/RootCA.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIIDjzCCAnegAwIBAgIULoxUT8ves7P+ftlFpdVrG7yOUTMwDQYJKoZIhvcNAQEL
3 | BQAwVzELMAkGA1UEBhMCREUxDDAKBgNVBAgMA05SVzENMAsGA1UEBwwEVmVybDEL
4 | MAkGA1UECgwCQmsxDTALBgNVBAsMBFRDUE0xDzANBgNVBAMMBlJvb3RDQTAeFw0y
5 | MTExMjYxNjM3NDRaFw0zMTEwMDUxNjM3NDRaMFcxCzAJBgNVBAYTAkRFMQwwCgYD
6 | VQQIDANOUlcxDTALBgNVBAcMBFZlcmwxCzAJBgNVBAoMAkJrMQ0wCwYDVQQLDARU
7 | Q1BNMQ8wDQYDVQQDDAZSb290Q0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK
8 | AoIBAQDufF+lO4Rv++ycuvMX7tiLoM3woWJmOxurzwr8YgTs89Fu129VC8jpRQhW
9 | FROLjRC7mtwM/EBjXHlPGrXKqL6jqBorAiA+j/pqfgBU5ciUm8FOAih2gpjDbj1A
10 | 0jQ4RhPtXYVAB8zNVpMvNULZq4go9z1/xnGBzuCYTC92faP2PeOzESHmYG5/5+Hj
11 | CDu8xiFLtDZf/cPpyBd5YF3XYq6JZuvHRkYd4UQUTWgZ+hU5C5XapPfbGa+NGyOv
12 | OffjCL+gN6wve0el4G/3Le8jt6uvC3qZ+wgF5gUypFp0frwpWqfj9HDXeU9x4xEU
13 | XwLZDZEEAqmz9AoAnvWINCKrMOtPAgMBAAGjUzBRMB0GA1UdDgQWBBSVMYnuU5Z0
14 | +hyFBvsLmH0mEdR/LTAfBgNVHSMEGDAWgBSVMYnuU5Z0+hyFBvsLmH0mEdR/LTAP
15 | BgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQA+MlgRpl49RmtDZyYW
16 | GayI3kstGq/YUYEI+5lkNXuJ8mWd36WzGBTDaQHALsxkXpkwv0V8ed7bGyJT4iOh
17 | wIdMaOU49e5uY1M7pjB3O/mI+Q2LJD6D8z1ENk4jK0H4EyYUsyNn5Tc5Uc8YCMxb
18 | P8bevlpCjDTYmeVcBREWc7M2P6nIW7IDjx9RaJO7nHgQFHtRtG+lpJwC2NcQhoGm
19 | 3joECM5rQZt7jPY8SR9loo9iqR824zRAC2E+glDrd9cSlt8MV825wHed6W/6Cfsm
20 | +X21yG7Z0ghzyba3WdKh9ByeIxFM6CYgTSfpn3ySowX/5vj4UUodMqbrWKjU8nn5
21 | ASqJ
22 | -----END CERTIFICATE-----
23 |
--------------------------------------------------------------------------------
/Sources/AdsSecureSamples/AdsSecureConsoleApp/Certs/RootCA.srl:
--------------------------------------------------------------------------------
1 | 3164A8F8486394D1D6448395D8C3E98808A4172F
2 |
--------------------------------------------------------------------------------
/Sources/AdsSecureSamples/AdsSecureConsoleApp/Certs/SourceIPC.crt:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIIDODCCAiACFDFkqPhIY5TR1kSDldjD6YgIpBcuMA0GCSqGSIb3DQEBCwUAMFcx
3 | CzAJBgNVBAYTAkRFMQwwCgYDVQQIDANOUlcxDTALBgNVBAcMBFZlcmwxCzAJBgNV
4 | BAoMAkJrMQ0wCwYDVQQLDARUQ1BNMQ8wDQYDVQQDDAZSb290Q0EwHhcNMjExMTI2
5 | MTYzODAwWhcNMjIxMTIxMTYzODAwWjBaMQswCQYDVQQGEwJERTEMMAoGA1UECAwD
6 | TlJXMQ0wCwYDVQQHDARWZXJsMQswCQYDVQQKDAJCazENMAsGA1UECwwEVENQTTES
7 | MBAGA1UEAwwJU291cmNlSVBDMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC
8 | AQEA5QRND9VwXGuSM9AW7SsWPpLbCToi8MB1qOS/MZ25wJQUjblH+oeF4qHep5oe
9 | vSYE+dDkiDHQ2wqgnSL1sT0c0hd80GrUFDVwO65O/T2YNX2fw/dGCD8kfvdpIECE
10 | lQ+n8OFu55mhEauHHMEUV0tWlXS8Li5zVws+bkdGlJu4d3rnSDUmVSVtiNI801K5
11 | IBtBwHA6Mhs/0k2DCMaOk949NpzVUUhNLo83r6Zj3vC1gjXZetoMplly2gY4NRos
12 | Yxorr95WKcTPHBzsJcUvMqGKEHTkLnbG7DfTw4fPPack7uewFb2sbKVnJdkiGOAC
13 | oYZl9XQoPQWUIhMOylYU/Q2eTQIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQBWxQ9A
14 | vtlKEpL5N/+h/4xahywayygRNMN6GAoZM2NE1OAm/nBNFbk6AS1hhczYppFG4f7U
15 | VqELjK0oUB9xUMCEidxDFOm3PDjtTu2h2Nx0C4LlT/YvEsX9WR+3Du7nZ+Z0+jd9
16 | v0jwbRn/t9xPOOZswo1I/p/OtQXH4tdbcWozG0pKeTpubkmMaBgFXUDv5ePPxrlH
17 | Gr+E6MYtlrZtDxEywt2JC2KK7Snr/528FBvArTdaS0B75nE28EuBiRDxs88iThql
18 | TKKtRdrkm/zqNYOYnTIQl5iXfyZrNFTPhrF+GpCGwyWqOLihQLoRNYb5B0q8d4vJ
19 | IcPKu8e1NRUosGUE
20 | -----END CERTIFICATE-----
21 |
--------------------------------------------------------------------------------
/Sources/AdsSecureSamples/AdsSecureConsoleApp/Certs/SourceIPC.csr:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE REQUEST-----
2 | MIICnzCCAYcCAQAwWjELMAkGA1UEBhMCREUxDDAKBgNVBAgMA05SVzENMAsGA1UE
3 | BwwEVmVybDELMAkGA1UECgwCQmsxDTALBgNVBAsMBFRDUE0xEjAQBgNVBAMMCVNv
4 | dXJjZUlQQzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOUETQ/VcFxr
5 | kjPQFu0rFj6S2wk6IvDAdajkvzGducCUFI25R/qHheKh3qeaHr0mBPnQ5Igx0NsK
6 | oJ0i9bE9HNIXfNBq1BQ1cDuuTv09mDV9n8P3Rgg/JH73aSBAhJUPp/DhbueZoRGr
7 | hxzBFFdLVpV0vC4uc1cLPm5HRpSbuHd650g1JlUlbYjSPNNSuSAbQcBwOjIbP9JN
8 | gwjGjpPePTac1VFITS6PN6+mY97wtYI12XraDKZZctoGODUaLGMaK6/eVinEzxwc
9 | 7CXFLzKhihB05C52xuw308OHzz2nJO7nsBW9rGylZyXZIhjgAqGGZfV0KD0FlCIT
10 | DspWFP0Nnk0CAwEAAaAAMA0GCSqGSIb3DQEBCwUAA4IBAQBnVMeONd/i+szJIbxR
11 | S+OlO69eO0N3zfRmdA6zC/6ZwMeTchVm2vA0t+iklHSuwqc/PATMvRVxnyoKEEPV
12 | apPwtgCtwHej0x0ILyZjQyp865VefNAzbpxhChd641IymyiQ1sUTY/avvb4WRNzy
13 | A2bpIZmt3UgE0oYeg5h5Gs91IEPIm07NYl6h+AvVnZRKBKDkAzfnjJdB7g4fupZM
14 | ueVcR5D6U1/epBET7Dk6S/FBeSHuwesAfMVRUQj9podNkxpm6YAuzEMgjAfigvDl
15 | 5ZAcomskMzw4btwLMj03+4n06IE4hpWVFCT+wIINIPS0cGlBkBjHKUCnrjFTqEYf
16 | YW9b
17 | -----END CERTIFICATE REQUEST-----
18 |
--------------------------------------------------------------------------------
/Sources/AdsSecureSamples/AdsSecureConsoleApp/Certs/SourceIPC.key:
--------------------------------------------------------------------------------
1 | -----BEGIN RSA PRIVATE KEY-----
2 | MIIEowIBAAKCAQEA5QRND9VwXGuSM9AW7SsWPpLbCToi8MB1qOS/MZ25wJQUjblH
3 | +oeF4qHep5oevSYE+dDkiDHQ2wqgnSL1sT0c0hd80GrUFDVwO65O/T2YNX2fw/dG
4 | CD8kfvdpIECElQ+n8OFu55mhEauHHMEUV0tWlXS8Li5zVws+bkdGlJu4d3rnSDUm
5 | VSVtiNI801K5IBtBwHA6Mhs/0k2DCMaOk949NpzVUUhNLo83r6Zj3vC1gjXZetoM
6 | plly2gY4NRosYxorr95WKcTPHBzsJcUvMqGKEHTkLnbG7DfTw4fPPack7uewFb2s
7 | bKVnJdkiGOACoYZl9XQoPQWUIhMOylYU/Q2eTQIDAQABAoIBAHihA1ZLvptvrdrM
8 | yMaz40uiXu1FShI1zcPgeTTRN35QgWMFLPyxVbxCNt1hOL+4vvY3KajzVGeL+X3L
9 | ZE6vOfcPmBbPrlXWr/8/mSuavgmu2fCG1sSRPdAC0cTDNxKs5HDkzV4Ade6wwsJK
10 | kURJ0pl2m4hXvzkiGwhLUsoEG+4SN4J57Oikuf0J0ZoVs3+TmzTclpbZ0JfSn2+0
11 | RHfad+nNpxrzwgD+Avybkvt7pnmVJeHuh09ICN3yV49Cu1zABf1BesCiFhEsFEuU
12 | RFwsMqhJ18bv1znGFQd2XqSu6AQfbfOkwRvxKy+Z4pEK/HYjLyH6GeD8VUEd9Utm
13 | fOmDfAECgYEA+RHkK+pefIsdmRS5vU8ruEb1+pnqA2dDUit7bsHJZLXT4unl1XWB
14 | lqkMQSAdKIlrwzTbzWGgtfEulcMPqLl8yH/40ZEdF7WA+SYATsLLqQt1KeNMR4aE
15 | NgoTCaVW6nnQneJ1i8acI445gmJPCwG4puH1FQ+Zm0lXYG3elYzKLO0CgYEA62OS
16 | qKToBt61TWS4kGS6avn7vFXrh6JAEO3CV61OVhGQKc/H0oTJBDPhRd/h1YznhILz
17 | FZPAVK9yy6qfd59x0ggmmcK9+VlsJlH+Tnylaq+2Geyo0gdzE4IyVrA9n7UrG8nl
18 | MVCHGuM6obVl2rkjrGiuoJehy6hbZ1XppHWKauECgYBIzSX4gCTmGnOoTxqLbxzE
19 | XFmByoNQQ1q2JeeKVDJdsZghd2SqpBIgy4C9eHmNY72P7V9iBOtIwxpuw/lLxAvp
20 | Px6ngtcSGwd7y9PDMcT9wE+a0sl1DqiOcxtlcmKZXsnPnGXnWUJCUkwVBE8+VF54
21 | yQsuAMVRUnqrwPGSnPhrcQKBgQDG6WTkmD3umEJTPVrtwgD6J3dABsc63bQP2isR
22 | VkVNXBgcDRaJ4mXP5FtoZbF8eU6nXtU2FZ5AseZrDyskthtD5llgM/2/eX53v3AM
23 | OS67wfI7ZA6hNWRcRvhs4w+gJ0NffzPrgWY6JWzFe/mvZCYuKmPvF1PFOubKowIG
24 | VMF8YQKBgE85Ht4dyEoNrVH+WlrCl9xB6HWdkXMl2ZFh+YFJlKwEUuheto4nTdWn
25 | p8rc2I9y9PX7u8kNYAKb9ppsX/Cq+0j89ahJl0QJkZZZYCIK1dHtpHUxNLgoWKyR
26 | 2iP8DpIry0uuIoi/VkoG/M1c9+w4Ojn2x9E3a7PIBK7M4H1F6w1e
27 | -----END RSA PRIVATE KEY-----
28 |
--------------------------------------------------------------------------------
/Sources/AdsSecureSamples/AdsSecureConsoleApp/Certs/TargetIPC.crt:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIIDODCCAiACFDFkqPhIY5TR1kSDldjD6YgIpBcvMA0GCSqGSIb3DQEBCwUAMFcx
3 | CzAJBgNVBAYTAkRFMQwwCgYDVQQIDANOUlcxDTALBgNVBAcMBFZlcmwxCzAJBgNV
4 | BAoMAkJrMQ0wCwYDVQQLDARUQ1BNMQ8wDQYDVQQDDAZSb290Q0EwHhcNMjExMTI2
5 | MTY1MzI2WhcNMjIxMTIxMTY1MzI2WjBaMQswCQYDVQQGEwJERTEMMAoGA1UECAwD
6 | TlJXMQ0wCwYDVQQHDARWZXJsMQswCQYDVQQKDAJCazENMAsGA1UECwwEVENQTTES
7 | MBAGA1UEAwwJVGFyZ2V0SVBDMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC
8 | AQEAr5IYzvd2Mbv/iuvDWdzSHLvhRzHtL+qKIDHViYhL2bsMfpweQHCrIsBvK6uY
9 | GezH91JndnqDnHLDf2mbtxMfFk4FWtUZ6nCuHiWpgW+91ujEClZ31YwLDsjonc1E
10 | Ev3q2481O6IiZdGIIPiuwaQD4D0kKL3pZAXKDn25E3YljofI5xWXQXhKwbk/z28m
11 | OJXLI+ezI7mtvmJsm0RDkkmiEfVcf3HBdt09kIyei0YJPhrM0XA1Yuo+C19LIxT5
12 | K7pssQ21aFh/ev06/qTOhFrFxDQZIkkmJ4Ipvsr1vrk9WERN+FyOaFb4uT3H+lIX
13 | kBYGwyqRjPTVOByR3z2NmXO+JQIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQBcV+AY
14 | hvGd1Bpa2t0+oGxNJwf4m4GCVYVNPduG6KcdWge0EdsLahpkWmH2Mlm6cvH2+apM
15 | o3+71Bu3JrptZ/BVKERFxkiaeCg8CM+xuFuiU7T6oKwY3fc7IiHacZGWcAql0lEy
16 | X2jQjtQ1E2j2z3f4dEuMg8KNrEeV5CRtHKUp9kgiVNwTA/TEcIIh/ddVGDmJN7r4
17 | qqyndm4GCmcgdKudWTjM9wEZxjBbiZiPMVDrFLaQC/FdkXZFUBrMX5hBff0ZP/Vd
18 | M/yoshjrgYkQqmuUcuE8bP6NrG7oWvtMdczEwKXUh8chlSxaVYE4/qYURQ92rE+Z
19 | aY4g20J2OonoX2Wx
20 | -----END CERTIFICATE-----
21 |
--------------------------------------------------------------------------------
/Sources/AdsSecureSamples/AdsSecureConsoleApp/Certs/TargetIPC.csr:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE REQUEST-----
2 | MIICnzCCAYcCAQAwWjELMAkGA1UEBhMCREUxDDAKBgNVBAgMA05SVzENMAsGA1UE
3 | BwwEVmVybDELMAkGA1UECgwCQmsxDTALBgNVBAsMBFRDUE0xEjAQBgNVBAMMCVRh
4 | cmdldElQQzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAK+SGM73djG7
5 | /4rrw1nc0hy74Ucx7S/qiiAx1YmIS9m7DH6cHkBwqyLAbyurmBnsx/dSZ3Z6g5xy
6 | w39pm7cTHxZOBVrVGepwrh4lqYFvvdboxApWd9WMCw7I6J3NRBL96tuPNTuiImXR
7 | iCD4rsGkA+A9JCi96WQFyg59uRN2JY6HyOcVl0F4SsG5P89vJjiVyyPnsyO5rb5i
8 | bJtEQ5JJohH1XH9xwXbdPZCMnotGCT4azNFwNWLqPgtfSyMU+Su6bLENtWhYf3r9
9 | Ov6kzoRaxcQ0GSJJJieCKb7K9b65PVhETfhcjmhW+Lk9x/pSF5AWBsMqkYz01Tgc
10 | kd89jZlzviUCAwEAAaAAMA0GCSqGSIb3DQEBCwUAA4IBAQBDbOJAuAEBjr/onEqx
11 | hw0yod5k2lS2cxfkF6tM1gg10gMmwU65AjP2godeGhu2y2HCt68oNDd1skysCkJO
12 | iBQVTfGFx6x7MzoRnmE1XRRy5dDS+F28hrTAHgviNgNPXHoVkX1hZhLnMPdrvNaB
13 | gyEXMSvt5RX7Y9ohqmwWWRfOGld1e+UsVF7kuw0pIgpLELy1jgx7Io9FECySNMUG
14 | ldvxCs09LX0QQezwFLiKCFWPsJQocG72snymJS0grngPZB8/HXzT8z2ag1VLrBMd
15 | txGjo8P0NH7A1yyBrEhI3SBQQv1SjRsSj11q37m2eEbUwJvIaGyCdKpmabFurrC2
16 | cHt/
17 | -----END CERTIFICATE REQUEST-----
18 |
--------------------------------------------------------------------------------
/Sources/AdsSecureSamples/AdsSecureConsoleApp/Certs/TargetIPC.key:
--------------------------------------------------------------------------------
1 | -----BEGIN RSA PRIVATE KEY-----
2 | MIIEpQIBAAKCAQEAr5IYzvd2Mbv/iuvDWdzSHLvhRzHtL+qKIDHViYhL2bsMfpwe
3 | QHCrIsBvK6uYGezH91JndnqDnHLDf2mbtxMfFk4FWtUZ6nCuHiWpgW+91ujEClZ3
4 | 1YwLDsjonc1EEv3q2481O6IiZdGIIPiuwaQD4D0kKL3pZAXKDn25E3YljofI5xWX
5 | QXhKwbk/z28mOJXLI+ezI7mtvmJsm0RDkkmiEfVcf3HBdt09kIyei0YJPhrM0XA1
6 | Yuo+C19LIxT5K7pssQ21aFh/ev06/qTOhFrFxDQZIkkmJ4Ipvsr1vrk9WERN+FyO
7 | aFb4uT3H+lIXkBYGwyqRjPTVOByR3z2NmXO+JQIDAQABAoIBAEROKZqzyecVhhjt
8 | GoZmk9QcAEwrj2S58d0Opk4omaHu1LCZWmelrd8KUPYDf1xus2l0RM5iYbvHJmn2
9 | k19JcCnEVu78w2VjS0ptSqIR8CChVEvVUi/hmRe6cE2cY2SkJvAeqg42SP2l5Dk3
10 | pv2tKtjd0KiNIjUIz5CNtyhsKbZmVbGzLadp/cIlPjDT+x+th6v3+R/ccF+qLVn6
11 | FK5iTh7O9MNlTrmHWAPoZ2IgFhxcVKQRb6t+MiquqBKSPPfHA/oLhRjYIBM7gQWP
12 | PzEkWhNFfxSv/q0iHcawLx+ATijkxu5X2voZewRK21Dn05fH2P38eiKyPXVIykYW
13 | jwnbUc0CgYEA6cfBbVrHTrmtv6cH7mPAsBH8quDemQZLnmC3951o4vROKjFqxoq/
14 | EtyCtWXOCWwKaY8YfqsPkZGbxoIsL98vf6/32Q/by9oFA0w281oBBrtzHe5atf8G
15 | xDEER8xukGlQnE5veurmwJObT2ObP0hmhofIgqeNlT1Xf8Zn/m4jlscCgYEAwEIC
16 | c40x3xBCCWOmXNVrE10vOcg06PZGFez2J/JwMEpAdRmbC3DANAxhRPC97aSYvxCF
17 | ewI29+4xp1X+q0IKZB92cBiyv/wkAE2w7a+hoh8jX6Un/GvTNf6R/9lgjpRMPfUA
18 | EcDimS3/5A2xBsVgeag8fu9mWECCBn3VDlOfJ7MCgYEAmmlFOkyGblo4B+l0VKHw
19 | iJsoz1j9zgcZdT+e419GAvmokzfWtdK4x+V8NAJNJ24EJprMbAXin5yUTnZ2Zxw8
20 | TFNXGjjeTXPwcbAqb2vYV7ECJRflNGaA+p8Bm8bMlHfrNYKdIYv74+Da6YH57b+N
21 | cHhJGPtAif1dSNksoSHwQcsCgYEAnyiGOv6SYKVm5br3CDctc1RbOiyBkLIABzqp
22 | 9RwAwBlYDxjpf6kRlIUDKT1bHhZ61QFqXxDQTKOFu4+3SjNbwtNBCz+HCuRDMXUf
23 | mUUiO8InWJCy74abzUE3wGRGSQJ/s3LVYd0aOdEY28Rx3rcbTNt3aWXqhfixK4qU
24 | DE4xnX0CgYEApe1n7G3w9sTyZrDYSfFHjaLGXfDmyKD7i9qvRA2NapPE/qNzuhrC
25 | WVjdDUQCVeOgEuPsVSx3pBYDtRwNQAFQbwS1yex9f+Qyy7JNbOSU7h20Z+H3xz/Q
26 | zk68pAYMp2A+t++za1z3XC9G13RLi5sxe3hyDe8vCBvfAnGNCcb9dus=
27 | -----END RSA PRIVATE KEY-----
28 |
--------------------------------------------------------------------------------
/Sources/AdsSecureSamples/AdsSecureConsoleApp/Certs/WrongRootCA.key:
--------------------------------------------------------------------------------
1 | -----BEGIN RSA PRIVATE KEY-----
2 | MIIEpAIBAAKCAQEAx4vwp88gYxwN5jqUdxtobpJ56QVnwhbY7oeQd+XcPycdUTPx
3 | olK/lMYkjqisv6OwWKTBJjLTrczGeg37DzYtoTa6Av7wIOdMT/odUCxJM0PWwpUa
4 | EXQerCkPDsJL9AcMGMy88efPMurYhSv1dzJgDfzSiWoU+yI9EmntLk0tjLP6P2Z2
5 | AhLt5gRXGiZnYpYAi7/C+LOz1v9luUBZ207D5RfnS24gvMPBHpxfXv6opjMumDlv
6 | /BBwD3mo0t+zYsHSzYuDwyrf7XWdZmgU6ObJk/oY73HVJDvq+uQ0XvQDK5oFlW3+
7 | C/NEUH7mBrQRkMXfnqyN3gDeL4voJOkq5gNmGwIDAQABAoIBAQC13+mfuZyGWOqe
8 | PiRVjyiXJ3BwH9obQCHG/s6BSYN+GBOTkKmbTpqJajOlxz10iihQExJs04S181+v
9 | nZCHo9ThDHVsB5ssEkUu3APdsA+j5yAWSDnzUIgoWF/+Dr+VktrGu803GxZyDTT9
10 | 5DwdwU9lUFtAneyznNhXMS7ZtcRfaYk5mmt7RuxsGTKRm4uBAakglgQ8JgTjJhMJ
11 | o+3esrJWdUP1tLV/9mlKMKkTTd6c1Scsrn3YT0jrsO5p4rOm1JHB9FwETsFEdQ1i
12 | x1pZ0r8BfZwY2qB2phC3/LvdipjxgyFrfhBP8dAU6poI46cFK9Vyf/FuJQOZE/pa
13 | yOl6eompAoGBAPikjiv6iUiDDTj06nnOWuMFrAhDd4pu17fBlDZlnYLDbuYYAO0e
14 | 9Ok0pgQFGT846pY04Wx7W6aEZCdPmsbbgECBOzNYdl+7RKtdlu9Cx47BZsuIfYLw
15 | PD7UX5cirUGsnAvvCVgwD24pwt/NEO6oBJq4dceuhzO/WaYXDlgKcDTtAoGBAM1z
16 | fHZsI61ANagbxUxfdtYl4yjqPWvt6tai1QOBwjRRA9bQp5KPT0kxJPV1N8wDVAnE
17 | mftW2vwt7PDh+8owUJCTyD332A+1FtDjpvUsE5yjpNh8OK1hin6Y3SZM/jnpd3ab
18 | SE6ggrM9p+ymaR7nHTimMjtIx9fQtWvS7dRss+4nAoGAMFuAsxj03j9usOchOzNh
19 | BcoynSDR/QB1v+1MMBAvRCFSTjnY5EUjCMAOkbWUJXGiXjhGp1yOhKI3AFZBGe/S
20 | z7jSlLfdvdykDFgVZM8uFJuUrH0NPAwRC38uYCyEWcOCTefdf2NJfPluRyyQ4HmY
21 | +6Zocb+F2BCdFOpjBchx7jkCgYEApZtQmTiD7ZRTbAWunOhapzX1DLb7+bLW2Fp6
22 | 8A+5VmhzesXIPbgtBeeKTh1Fc7q/E/yYzmNts1blpinSx2D4oAGvqFvOmqKzGIBY
23 | xUnZKSszpplDKmb0tyVLJiNrzYymkkGLIG37zLWHVZeyJonPISm+VdFN3WXLx3VH
24 | 5jIVO4MCgYA3/TIWd9dp8xLp1AQb+e2n/x2NSvpwwNuNVYivYpndGEtZKi8sIYGe
25 | wX3+JquWwYx1n9i7FUw4+DnWOYf7mgt0/6L8KmW0N548xZ1zRmQLtWvJXzIJGQMJ
26 | ory3dRuT61CsKW19jU34gvU4h3kNp0gTdr2ImvXRJekEiEcAheLLBw==
27 | -----END RSA PRIVATE KEY-----
28 |
--------------------------------------------------------------------------------
/Sources/AdsSecureSamples/AdsSecureConsoleApp/Certs/WrongRootCA.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIIDmTCCAoGgAwIBAgIUBUFgxVsj94RMfG9VRdEnMbnRy3gwDQYJKoZIhvcNAQEL
3 | BQAwXDELMAkGA1UEBhMCREUxDDAKBgNVBAgMA05SVzENMAsGA1UEBwwEVmVybDEL
4 | MAkGA1UECgwCQmsxDTALBgNVBAsMBFRDUE0xFDASBgNVBAMMC1dyb25nUm9vdENB
5 | MB4XDTIxMTEyOTEyMjYwMVoXDTMxMTAwODEyMjYwMVowXDELMAkGA1UEBhMCREUx
6 | DDAKBgNVBAgMA05SVzENMAsGA1UEBwwEVmVybDELMAkGA1UECgwCQmsxDTALBgNV
7 | BAsMBFRDUE0xFDASBgNVBAMMC1dyb25nUm9vdENBMIIBIjANBgkqhkiG9w0BAQEF
8 | AAOCAQ8AMIIBCgKCAQEAx4vwp88gYxwN5jqUdxtobpJ56QVnwhbY7oeQd+XcPycd
9 | UTPxolK/lMYkjqisv6OwWKTBJjLTrczGeg37DzYtoTa6Av7wIOdMT/odUCxJM0PW
10 | wpUaEXQerCkPDsJL9AcMGMy88efPMurYhSv1dzJgDfzSiWoU+yI9EmntLk0tjLP6
11 | P2Z2AhLt5gRXGiZnYpYAi7/C+LOz1v9luUBZ207D5RfnS24gvMPBHpxfXv6opjMu
12 | mDlv/BBwD3mo0t+zYsHSzYuDwyrf7XWdZmgU6ObJk/oY73HVJDvq+uQ0XvQDK5oF
13 | lW3+C/NEUH7mBrQRkMXfnqyN3gDeL4voJOkq5gNmGwIDAQABo1MwUTAdBgNVHQ4E
14 | FgQUJYsmB+RTHNp3VHug+B6iodHI8UQwHwYDVR0jBBgwFoAUJYsmB+RTHNp3VHug
15 | +B6iodHI8UQwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEARFrI
16 | 2UDoOi2/2WEL9CNJ4f+9q92xmi/lOmL+NBNRoDj7gYsIG/PzwX+idm1xanO7wGca
17 | Pufq8aGTgK1f4eRNdx986apTFQ+dzSrOLoHJvc7e1EIdneWCVhEzVz+/0G5zikRD
18 | agJ1ZjLj7N6WNdviYFbb8EvxY29yBH0kjrr8UCNOC0uwwhMz5deK3Cw5hWyDnWWz
19 | p5MfVvouhzi2jHKIINhf5tWxhmB9OU+97H02Vr++dDiwJQiuGV41rnG12xkA9eUQ
20 | ceTFLVIXa+e7oyZxMZV+WC+nG6FApVAV2Hn7nuSK2xnVe8FLw1OzV6iioZMFXqRI
21 | Tb3cOEnlLuwCqOJb3g==
22 | -----END CERTIFICATE-----
23 |
--------------------------------------------------------------------------------
/Sources/AdsSecureSamples/AdsSecureConsoleApp/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | //"AdsSecureConsoleApp": {
4 | // "commandName": "Project",
5 | // "commandLineArgs": "172.17.60.197.1.1 10000 172.17.60.197"
6 | //}
7 | }
8 | }
--------------------------------------------------------------------------------
/Sources/BaseSamples/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "0.2.0",
3 | "configurations": [
4 | {
5 | // Use IntelliSense to find out which attributes exist for C# debugging
6 | // Use hover for the description of the existing attributes
7 | // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
8 | "name": ".NET Core Launch (console)",
9 | "type": "coreclr",
10 | "request": "launch",
11 | "preLaunchTask": "build",
12 | // If you have changed target frameworks, make sure to update the program path.
13 | "program": "${workspaceFolder}/MethodCall/bin/Debug/net5.0-windows/30_MethodCall.dll",
14 | "args": [],
15 | "cwd": "${workspaceFolder}/MethodCall",
16 | // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
17 | "console": "internalConsole",
18 | "stopAtEntry": false
19 | },
20 | {
21 | "name": ".NET Core Attach",
22 | "type": "coreclr",
23 | "request": "attach"
24 | }
25 | ]
26 | }
--------------------------------------------------------------------------------
/Sources/BaseSamples/.vscode/tasks.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "2.0.0",
3 | "tasks": [
4 | {
5 | "label": "build",
6 | "command": "dotnet",
7 | "type": "process",
8 | "args": [
9 | "build",
10 | "${workspaceFolder}/MethodCall/30_MethodCall.csproj",
11 | "/property:GenerateFullPaths=true",
12 | "/consoleloggerparameters:NoSummary"
13 | ],
14 | "problemMatcher": "$msCompile"
15 | },
16 | {
17 | "label": "publish",
18 | "command": "dotnet",
19 | "type": "process",
20 | "args": [
21 | "publish",
22 | "${workspaceFolder}/MethodCall/30_MethodCall.csproj",
23 | "/property:GenerateFullPaths=true",
24 | "/consoleloggerparameters:NoSummary"
25 | ],
26 | "problemMatcher": "$msCompile"
27 | },
28 | {
29 | "label": "watch",
30 | "command": "dotnet",
31 | "type": "process",
32 | "args": [
33 | "watch",
34 | "run",
35 | "--project",
36 | "${workspaceFolder}/MethodCall/30_MethodCall.csproj"
37 | ],
38 | "problemMatcher": "$msCompile"
39 | }
40 | ]
41 | }
--------------------------------------------------------------------------------
/Sources/BaseSamples/AccessByVarName/AccessByVarName.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Text;
6 | using TwinCAT.Ads;
7 |
8 | namespace S02_AccessByVarName
9 | {
10 | class AccessByVarName
11 | {
12 | static void Main(string[] args)
13 | {
14 | //Create a new instance of class AdsClient
15 | AdsClient tcClient = new AdsClient();
16 |
17 | uint iHandle = 0;
18 | uint iValue = 0;
19 |
20 | try
21 | {
22 | //Connect to local PLC - Port 851
23 | tcClient.Connect(851);
24 |
25 | //Get the handle of the PLC variable "nCounter"
26 | iHandle = tcClient.CreateVariableHandle("MAIN.nCounter");
27 | Console.WriteLine("Press Enter five times to end");
28 | for(int i = 0; i < 5; i++)
29 | {
30 | //Use the handle to read PLCVar
31 | byte[] readData = new byte[sizeof(UInt32)];
32 | tcClient.Read(iHandle, readData.AsMemory());
33 | MemoryStream dataStream = new MemoryStream(readData);
34 | BinaryReader binReader = new BinaryReader(dataStream);
35 | iValue = binReader.ReadUInt32();
36 | Console.WriteLine("Value: " + iValue);
37 | Console.ReadKey();
38 | }
39 |
40 | //Reset PLC variable to zero
41 | tcClient.WriteAny(iHandle, 0);
42 | }
43 | catch (Exception ex)
44 | {
45 | Console.WriteLine(ex.Message);
46 | Console.ReadKey();
47 | }
48 | finally
49 | {
50 | tcClient.DeleteVariableHandle(iHandle);
51 | tcClient.Dispose();
52 | }
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/AccessByVarName/S02_AccessByVarName.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | Exe
4 | AccessByVarName
5 | AccessByVarName
6 | net80
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/EventReading/S03_EventReading.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | WinExe
4 | net80-windows
5 | true
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/Heartbeat/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // Setting ComVisible to false makes the types in this assembly not visible
6 | // to COM components. If you need to access a type in this assembly from
7 | // COM, set the ComVisible attribute to true on that type.
8 | [assembly: ComVisible(false)]
9 |
10 | // The following GUID is for the ID of the typelib if this project is exposed to COM
11 | [assembly: Guid("541c88f4-a88a-46c5-bbe4-40c9a37a270d")]
12 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/Heartbeat/S50_Heartbeat.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | Exe
4 | $(MSBuildProjectName.Replace(" ", "_"))
5 | net80
6 |
7 |
8 | S50_Heartbeat.Program
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/MethodCall/Form1.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.IO;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 | using System.Windows.Forms;
11 | using TwinCAT.Ads;
12 |
13 | namespace S30_MethodCall
14 | {
15 |
16 | public partial class Form1 : Form
17 | {
18 | AdsClient tcClient = null;
19 |
20 | //Update the AMSNetId for your target
21 | AmsNetId targetAmsNetId = AmsNetId.Local;
22 |
23 | public Form1()
24 | {
25 | InitializeComponent();
26 | }
27 | private void Form1_Load(object sender, EventArgs e)
28 | {
29 | //Create a new instance of class AdsClient
30 | tcClient = new AdsClient();
31 |
32 | //Connect to target PLC - Port 851
33 | tcClient.Connect(targetAmsNetId, 851);
34 | }
35 |
36 | private void btnMethodCall_Click(object sender, EventArgs e)
37 | {
38 | try
39 | {
40 | //Get the values entered into the form
41 | short first = Convert.ToInt16(tbValueA.Text);
42 | short second = Convert.ToInt16(tbValueB.Text);
43 |
44 | //Add a function block FB_Math in TwinCAT
45 | //Create a method called mAdd on FB_Math, with the following signature
46 |
47 | /* {attribute 'TcRpcEnable'}
48 | METHOD PUBLIC mAdd : INT
49 | VAR_INPUT
50 | i1 : INT := 0;
51 | i2 : INT := 0;
52 | END_VAR
53 | */
54 |
55 | //Instance the function block in main call it fbMath
56 |
57 | //Call the method mAdd of fbMath in MAIN
58 | short result = (short)tcClient.InvokeRpcMethod("MAIN.fbMath", "mAdd", new object[] { first, second });
59 |
60 | //Display the result
61 | tbSumAB.Text = result.ToString();
62 | }
63 | catch (Exception ex)
64 | {
65 | MessageBox.Show(ex.Message);
66 | }
67 | }
68 |
69 | ///
70 | /// Clean up any resources being used.
71 | ///
72 | /// true if managed resources should be disposed; otherwise, false.
73 | protected override void Dispose(bool disposing)
74 | {
75 | if (disposing)
76 | {
77 | // Dispose the Client during Form Cleanup
78 | tcClient.Dispose();
79 |
80 | if (components != null)
81 | {
82 | components.Dispose();
83 | }
84 | }
85 | base.Dispose(disposing);
86 | }
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/MethodCall/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using System.Windows.Forms;
6 |
7 | namespace S30_MethodCall
8 | {
9 | static class Program
10 | {
11 | ///
12 | /// The main entry point for the application.
13 | ///
14 | [STAThread]
15 | static void Main()
16 | {
17 | Application.EnableVisualStyles();
18 | Application.SetCompatibleTextRenderingDefault(false);
19 | Application.Run(new Form1());
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/MethodCall/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // Setting ComVisible to false makes the types in this assembly not visible
6 | // to COM components. If you need to access a type in this assembly from
7 | // COM, set the ComVisible attribute to true on that type.
8 | [assembly: ComVisible(false)]
9 |
10 | // The following GUID is for the ID of the typelib if this project is exposed to COM
11 | [assembly: Guid("d79218f5-1e8a-40a1-9314-b11de07a8851")]
12 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/MethodCall/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace _30_ADS.NET_MethodCall.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("_30_ADS.NET_MethodCall.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/MethodCall/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace _30_ADS.NET_MethodCall.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.0.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/MethodCall/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/MethodCall/S30_MethodCall.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | WinExe
4 | net80-windows
5 | true
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/PLCStartStop/PLCStartStop.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using TwinCAT.Ads;
6 |
7 | namespace S20_PLCStartStop
8 | {
9 | class PLCStartStop
10 | {
11 | static void Main(string[] args)
12 | {
13 | //Create a new instance of class AdsClient
14 | AdsClient tcClient = new AdsClient();
15 |
16 | try
17 | {
18 | //Connect to local PLC - Runtime 1 - Port 851
19 | tcClient.Connect(851);
20 |
21 | Console.WriteLine(" PLC Run\t[R]");
22 | Console.WriteLine(" PLC Stop\t[S]");
23 | Console.WriteLine("\r\nPlease choose \"Run\" or \"Stop\" and confirm with enter..");
24 | string sInput = Console.ReadLine().ToLower();
25 |
26 | //Process user input and apply chosen state
27 | do{
28 | switch (sInput)
29 | {
30 | case "r": tcClient.WriteControl(new StateInfo(AdsState.Run, tcClient.ReadState().DeviceState)); break;
31 | case "s": tcClient.WriteControl(new StateInfo(AdsState.Stop, tcClient.ReadState().DeviceState)); break;
32 | default: Console.WriteLine("Please choose \"Run\" or \"Stop\" and confirm with enter.."); sInput = Console.ReadLine().ToLower(); break;
33 | }
34 | } while (sInput != "r" && sInput != "s");
35 | }
36 | catch (Exception ex)
37 | {
38 | Console.WriteLine(ex.Message);
39 | Console.ReadKey();
40 | }
41 | finally
42 | {
43 | tcClient.Dispose();
44 | }
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/PLCStartStop/S20_PLCStartStop.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | Exe
4 | PLCStartStop
5 | PLCStartStop
6 | net80
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/Reactive/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // Setting ComVisible to false makes the types in this assembly not visible
6 | // to COM components. If you need to access a type in this assembly from
7 | // COM, set the ComVisible attribute to true on that type.
8 | [assembly: ComVisible(false)]
9 |
10 | // The following GUID is for the ID of the typelib if this project is exposed to COM
11 | [assembly: Guid("ddee523c-f2d5-4d10-9ee8-1801087fbbc4")]
12 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/Reactive/S80_Reactive.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | Exe
4 | net80
5 |
6 |
7 | S80_Reactive.Program
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/ReadArray/Form1.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace S12_ReadArray
2 | {
3 | public partial class Form1
4 | {
5 | #region Windows Form Designer generated code
6 | ///
7 | /// Required method for Designer support - do not modify
8 | /// the contents of this method with the code editor.
9 | ///
10 | private void InitializeComponent()
11 | {
12 | this.lbArray = new System.Windows.Forms.ListBox();
13 | this.btnRead = new System.Windows.Forms.Button();
14 | this.SuspendLayout();
15 | //
16 | // lbArray
17 | //
18 | this.lbArray.ItemHeight = 16;
19 | this.lbArray.Location = new System.Drawing.Point(19, 9);
20 | this.lbArray.Name = "lbArray";
21 | this.lbArray.Size = new System.Drawing.Size(173, 244);
22 | this.lbArray.TabIndex = 0;
23 | //
24 | // btnRead
25 | //
26 | this.btnRead.Location = new System.Drawing.Point(19, 277);
27 | this.btnRead.Name = "btnRead";
28 | this.btnRead.Size = new System.Drawing.Size(173, 26);
29 | this.btnRead.TabIndex = 1;
30 | this.btnRead.Text = "Read";
31 | this.btnRead.Click += new System.EventHandler(this.btnRead_Click);
32 | //
33 | // Form1
34 | //
35 | this.AutoScaleBaseSize = new System.Drawing.Size(6, 15);
36 | this.ClientSize = new System.Drawing.Size(212, 322);
37 | this.Controls.Add(this.btnRead);
38 | this.Controls.Add(this.lbArray);
39 | this.Name = "Form1";
40 | this.Text = "Sample12";
41 | this.Load += new System.EventHandler(this.Form1_Load);
42 | this.ResumeLayout(false);
43 |
44 | }
45 | #endregion
46 |
47 | private System.Windows.Forms.Button btnRead;
48 | private System.ComponentModel.Container components = null;
49 | private System.Windows.Forms.ListBox lbArray;
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/ReadArray/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using System.Windows.Forms;
6 |
7 | namespace S12_ReadArray
8 | {
9 | static class Program
10 | {
11 | ///
12 | /// The main entry point for the application.
13 | ///
14 | [STAThread]
15 | static void Main()
16 | {
17 | Application.EnableVisualStyles();
18 | Application.SetCompatibleTextRenderingDefault(false);
19 | Application.Run(new Form1());
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/ReadArray/S12_ReadArray.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | WinExe
4 | net80-windows
5 | true
6 | S12_ReadArray.Program
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/ReadVariableDeclaration/S21_ReadVariableDeclaration.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | WinExe
4 | net80-windows
5 | true
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/ReadWriteAnyType/S14_ReadWriteAnyType.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | WinExe
4 | net80-windows
5 | true
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/ReadWriteDateTime/S11_ReadWriteDateTime.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | WinExe
4 | net80-windows
5 | true
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/ReadWriteFlag/S01_ReadWriteFlag.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | WinExe
4 | net80-windows
5 | true
6 | S01_ReadWriteFlag.Form1
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/ReadWriteString/S10_ReadWriteString.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | WinExe
4 | net80-windows
5 | true
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/SamplePlc/00_TwinCAT_Demo_PLC.tsproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | PlcTask
8 |
9 |
10 |
11 |
12 |
13 |
14 | PLC Instance
15 | {08500001-0000-0000-F000-000000000064}
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/SamplePlc/PLC/DUTs/PLCStruct.TcDUT:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/SamplePlc/PLC/DUTs/TComplexStruct.TcDUT:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/SamplePlc/PLC/DUTs/TSimpleStruct.TcDUT:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/SamplePlc/PLC/GVLs/GVL.TcGVL:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
68 |
69 |
70 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/SamplePlc/PLC/POUs/FB_Math.TcPOU:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
12 |
13 |
23 |
24 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/SamplePlc/PLC/POUs/MAIN.TcPOU:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
60 |
61 | boolVal);
72 | IF boolVal THEN
73 | IF intval > 12 THEN
74 | intval := 0;
75 | END_IF
76 | intVal := intVal + 1;
77 | stringVal := LEFT(Text, intVal);
78 | TON1(IN:= FALSE);
79 | END_IF
80 |
81 | //Sample12
82 | FOR Index := 0 TO 99 DO
83 | PLCArray[Index] := 3500 + INDEX;
84 | END_FOR]]>
85 |
86 |
87 |
88 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/SamplePlc/PLC/PlcTask.TcTTO:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 10000
6 | 20
7 |
8 | MAIN
9 |
10 | {e1744858-d7d2-49bb-9dd1-d675c73185e6}
11 | {a4e352f1-9bac-45f6-8519-c41c7eb75262}
12 | {00db564b-2301-4548-bca8-31a38e2c32f3}
13 | {23f5e55b-06ee-48f1-a651-6ab1ce027776}
14 | {b61df5c7-99e6-45db-98f9-8809ff94eebe}
15 |
16 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/SamplePlc/PLC/Version/Global_Version.TcGVL:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/Server/NotificationRequestEntry.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using TwinCAT.Ads;
5 |
6 | namespace S60_Server
7 | {
8 |
9 | }
10 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/Server/Program.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.DependencyInjection;
2 | using Microsoft.Extensions.Hosting;
3 | using System;
4 |
5 | namespace S60_Server
6 | {
7 | class Program
8 | {
9 | public static void Main(string[] args)
10 | {
11 | CreateHostBuilder(args).Build().Run();
12 | }
13 |
14 | public static IHostBuilder CreateHostBuilder(string[] args) =>
15 | Host.CreateDefaultBuilder(args)
16 | .ConfigureServices((hostContext, services) =>
17 | {
18 | services.AddHostedService();
19 | });
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/Server/S60_Server.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net80
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/Server/Worker.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading;
5 | using System.Threading.Tasks;
6 | using Microsoft.Extensions.Hosting;
7 | using Microsoft.Extensions.Logging;
8 | using TwinCAT.Ads.Server;
9 |
10 | namespace S60_Server
11 | {
12 |
13 | public class ServerWorker : BackgroundService
14 | {
15 | private readonly ILogger _logger;
16 |
17 | public ServerWorker(ILogger logger)
18 | {
19 | _logger = logger;
20 | }
21 |
22 | protected override async Task ExecuteAsync(CancellationToken cancel)
23 | {
24 | // Instantiate the server
25 | AdsSampleServer server = new AdsSampleServer(_logger);
26 | // Connect the server and wait for cancel
27 | await server.ConnectServerAndWaitAsync(cancel);
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/SumReadWrite/Form1.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 | text/microsoft-resx
50 |
51 |
52 | 2.0
53 |
54 |
55 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
56 |
57 |
58 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
59 |
60 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/SumReadWrite/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using System.Windows.Forms;
6 |
7 | namespace S22_SumReadWrite
8 | {
9 | static class Program
10 | {
11 | ///
12 | /// The main entry point for the application.
13 | ///
14 | [STAThread]
15 | static void Main()
16 | {
17 | Application.EnableVisualStyles();
18 | Application.SetCompatibleTextRenderingDefault(false);
19 | Application.Run(new Form1());
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/Sources/BaseSamples/SumReadWrite/S22_AdsSumReadWrite.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | WinExe
4 | net80-windows
5 | true
6 | S22_SumReadWrite.Program
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/TcStateChange/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Windows.Forms;
4 |
5 | namespace S23_TcStateChange
6 | {
7 | static class Program
8 | {
9 | ///
10 | /// The main entry point for the application.
11 | ///
12 | [STAThread]
13 | public static void Main()
14 | {
15 | Application.EnableVisualStyles();
16 | Application.SetCompatibleTextRenderingDefault(false);
17 | Application.Run(new Form1());
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/Sources/BaseSamples/TcStateChange/S23_TcStateChange.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | WinExe
4 | net80-windows
5 | true
6 | S23_TcStateChange.Program
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/TwinCAT_Demo_PLC/PLC/DUTs/MYSTRUCT.TcDUT:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
13 |
14 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/TwinCAT_Demo_PLC/PLC/DUTs/MyComplexStruct.TcDUT:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
14 |
15 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/TwinCAT_Demo_PLC/PLC/DUTs/PLCStruct.TcDUT:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/TwinCAT_Demo_PLC/PLC/DUTs/TComplexStruct.TcDUT:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/TwinCAT_Demo_PLC/PLC/DUTs/TSimpleStruct.TcDUT:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/TwinCAT_Demo_PLC/PLC/GVLs/GVL.TcGVL:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
68 |
69 |
70 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/TwinCAT_Demo_PLC/PLC/POUs/FB_Math.TcPOU:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
12 |
13 |
23 |
24 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/TwinCAT_Demo_PLC/PLC/POUs/MAIN.TcPOU:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
62 |
63 | boolVal);
76 | IF boolVal THEN
77 | IF intval > 12 THEN
78 | intval := 0;
79 | END_IF
80 | intVal := intVal + 1;
81 | stringVal := LEFT(Text, intVal);
82 | TON1(IN:= FALSE);
83 | END_IF
84 |
85 | //Sample12
86 | FOR Index := 0 TO 99 DO
87 | PLCArray[Index] := 3500 + INDEX;
88 | END_FOR
89 |
90 | myComplexStruct.a := true;]]>
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/TwinCAT_Demo_PLC/PLC/PlcTask.TcTTO:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 10000
6 | 20
7 |
8 | MAIN
9 |
10 | {e1744858-d7d2-49bb-9dd1-d675c73185e6}
11 | {a4e352f1-9bac-45f6-8519-c41c7eb75262}
12 | {00db564b-2301-4548-bca8-31a38e2c32f3}
13 | {23f5e55b-06ee-48f1-a651-6ab1ce027776}
14 | {b61df5c7-99e6-45db-98f9-8809ff94eebe}
15 |
16 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/TwinCAT_Demo_PLC/PLC/Version/Global_Version.TcGVL:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/TwinCAT_Demo_PLC/TwinCAT_Demo_PLC.tsproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | PlcTask
8 |
9 |
10 |
11 |
12 |
13 |
14 | PLC Instance
15 | {08500001-0000-0000-F000-000000000064}
16 |
17 |
18 | 0
19 | PlcTask
20 |
21 | #x02010020
22 |
23 | 20
24 | 10000000
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/WPFConnectionObserver/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/WPFConnectionObserver/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace S40_WPFConnectionObserver
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/WPFConnectionObserver/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/WPFConnectionObserver/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Resources;
3 | using System.Runtime.CompilerServices;
4 | using System.Runtime.InteropServices;
5 | using System.Windows;
6 |
7 | // Setting ComVisible to false makes the types in this assembly not visible
8 | // to COM components. If you need to access a type in this assembly from
9 | // COM, set the ComVisible attribute to true on that type.
10 | [assembly: ComVisible(false)]
11 |
12 | //In order to begin building localizable applications, set
13 | //CultureYouAreCodingWith in your .csproj file
14 | //inside a . For example, if you are using US english
15 | //in your source files, set the to en-US. Then uncomment
16 | //the NeutralResourceLanguage attribute below. Update the "en-US" in
17 | //the line below to match the UICulture setting in the project file.
18 |
19 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
20 |
21 |
22 | [assembly: ThemeInfo(
23 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
24 | //(used if a resource is not found in the page,
25 | // or application resource dictionaries)
26 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
27 | //(used if a resource is not found in the page,
28 | // app, or any theme specific resource dictionaries)
29 | )]
30 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/WPFConnectionObserver/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace _40_ADS.NET_WPFConnectionObserver.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.0.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/WPFConnectionObserver/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/WPFConnectionObserver/S40_WPFConnectionObserver.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net80-windows
6 | true
7 | WPFConnectionObserver
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Sources/BaseSamples/WriteStruct/S13_WriteStruct.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | WinExe
4 | net80-windows
5 | true
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Sources/ClientSamples/AdsCli/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | "configurations": [
3 | {
4 | "name": ".NET Core Launch (console)",
5 | "type": "coreclr",
6 | "request": "launch",
7 | "preLaunchTask": "build",
8 | "program": "${workspaceFolder}/src/bin/Debug/net5.0/AdsCli.dll",
9 | "args": ["5.76.88.215.1.1", "-v", "INT", "MAIN.counter", "16"],
10 | "cwd": "${workspaceFolder}",
11 | "stopAtEntry": false,
12 | "console": "internalConsole"
13 | },
14 | {
15 | "name": "Docker .NET Core Launch",
16 | "type": "docker",
17 | "request": "launch",
18 | "preLaunchTask": "docker-run: debug",
19 | "netCore": {
20 | "appProject": "${workspaceFolder}/src/AdsCli.csproj"
21 | }
22 | }
23 | ]
24 | }
--------------------------------------------------------------------------------
/Sources/ClientSamples/AdsCli/.vscode/tasks.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "2.0.0",
3 | "tasks": [
4 | {
5 | "label": "build",
6 | "command": "dotnet",
7 | "type": "process",
8 | "args": [
9 | "build",
10 | "${workspaceFolder}/src/AdsCli.csproj"
11 | ],
12 | "problemMatcher": "$msCompile"
13 | },
14 | {
15 |
16 | "type": "docker-build",
17 | "label": "docker-build: debug",
18 | "dependsOn": [
19 | "build"
20 | ],
21 | "dockerBuild": {
22 | "tag": "adscli:dev",
23 | "target": "base",
24 | "dockerfile": "${workspaceFolder}/Dockerfile",
25 | "context": "${workspaceFolder}",
26 | "pull": false
27 | },
28 | "netCore": {
29 | "appProject": "${workspaceFolder}/src/AdsCli.csproj"
30 | }
31 | },
32 | {
33 | "type": "docker-build",
34 | "label": "docker-build: release",
35 | "dependsOn": [
36 | "build"
37 | ],
38 | "dockerBuild": {
39 | "tag": "adscliclient:latest",
40 | "dockerfile": "${workspaceFolder}/Dockerfile",
41 | "context": "${workspaceFolder}",
42 | "pull": true
43 | },
44 | "netCore": {
45 | "appProject": "${workspaceFolder}/src/AdsCli.csproj"
46 | }
47 | },
48 | {
49 | "type": "docker-run",
50 | "label": "docker-run: debug",
51 | "dependsOn": [
52 | "docker-build: debug"
53 | ],
54 | "dockerRun": {},
55 | "netCore": {
56 | "appProject": "${workspaceFolder}/src/AdsCli.csproj",
57 | "enableDebugging": true
58 | }
59 | },
60 | {
61 | "type": "docker-run",
62 | "label": "docker-run: release",
63 | "dependsOn": [
64 | "docker-build: release"
65 | ],
66 | "dockerRun": {},
67 | "netCore": {
68 | "appProject": "${workspaceFolder}/src/AdsCli.csproj"
69 | }
70 | }
71 | ]
72 | }
--------------------------------------------------------------------------------
/Sources/ClientSamples/AdsCli/AdsCli.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.30114.105
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdsCli", "src\AdsCli.csproj", "{6E564C0C-648D-47F0-BAA1-7FD9F920DA9F}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Debug|x64 = Debug|x64
12 | Debug|x86 = Debug|x86
13 | Release|Any CPU = Release|Any CPU
14 | Release|x64 = Release|x64
15 | Release|x86 = Release|x86
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
21 | {6E564C0C-648D-47F0-BAA1-7FD9F920DA9F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
22 | {6E564C0C-648D-47F0-BAA1-7FD9F920DA9F}.Debug|Any CPU.Build.0 = Debug|Any CPU
23 | {6E564C0C-648D-47F0-BAA1-7FD9F920DA9F}.Debug|x64.ActiveCfg = Debug|Any CPU
24 | {6E564C0C-648D-47F0-BAA1-7FD9F920DA9F}.Debug|x64.Build.0 = Debug|Any CPU
25 | {6E564C0C-648D-47F0-BAA1-7FD9F920DA9F}.Debug|x86.ActiveCfg = Debug|Any CPU
26 | {6E564C0C-648D-47F0-BAA1-7FD9F920DA9F}.Debug|x86.Build.0 = Debug|Any CPU
27 | {6E564C0C-648D-47F0-BAA1-7FD9F920DA9F}.Release|Any CPU.ActiveCfg = Release|Any CPU
28 | {6E564C0C-648D-47F0-BAA1-7FD9F920DA9F}.Release|Any CPU.Build.0 = Release|Any CPU
29 | {6E564C0C-648D-47F0-BAA1-7FD9F920DA9F}.Release|x64.ActiveCfg = Release|Any CPU
30 | {6E564C0C-648D-47F0-BAA1-7FD9F920DA9F}.Release|x64.Build.0 = Release|Any CPU
31 | {6E564C0C-648D-47F0-BAA1-7FD9F920DA9F}.Release|x86.ActiveCfg = Release|Any CPU
32 | {6E564C0C-648D-47F0-BAA1-7FD9F920DA9F}.Release|x86.Build.0 = Release|Any CPU
33 | EndGlobalSection
34 | EndGlobal
35 |
--------------------------------------------------------------------------------
/Sources/ClientSamples/AdsCli/Dockerfile:
--------------------------------------------------------------------------------
1 | #See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
2 |
3 | FROM mcr.microsoft.com/dotnet/runtime:6.0 AS base
4 | WORKDIR /app
5 |
6 | FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
7 | WORKDIR /src
8 | COPY src/*.csproj .
9 | RUN dotnet restore
10 | COPY src/. .
11 | RUN dotnet build -c Release -o /app/build
12 |
13 | FROM build AS publish
14 | RUN dotnet publish -c Release -o /app/publish
15 |
16 | FROM base AS final
17 | WORKDIR /app
18 |
19 | ENV AmsConfiguration:LoopbackAddress=127.0.0.1 \
20 | AmsConfiguration:LoopbackPort=48898
21 |
22 | COPY --from=publish /app/publish .
23 |
24 | ENTRYPOINT ["dotnet", "AdsCli.dll"]
--------------------------------------------------------------------------------
/Sources/ClientSamples/AdsCli/README.md:
--------------------------------------------------------------------------------
1 | # ADS Command Line Interface (CLI) Client - Sample
2 |
3 | This project is intended as sample and should demonstarte the usage of the `Beckhoff.TwinCAT.Ads` package for the purpose of a simple ADS client application.
4 |
5 | Furthermore, it includes a `Dockerfile` to demonstarte the packaging of the client application as a container image and explains the execution of the client container in combination with the `AdsRouterConsoleApp` sample.
6 |
7 | ## Usage as Container
8 |
9 | To build the container image run `docker build -t ads-cli-client:latest .` from within the root path of this sample project.
10 |
11 | Afterwards `docker image ls` should list the `ads-cli-client` image in the local repository.
12 |
13 | ```
14 | $ docker image ls
15 | REPOSITORY TAG IMAGE ID CREATED SIZE
16 | ads-cli-client latest 5f8351ca68d3 9 minutes ago 191MB
17 | ...
18 | ```
19 |
20 | The sample application does not contain any ADS routing service.
21 | Therefore, an available ADS router service can be specified to the `ads-cli-client` application via the envrionment variables `AmsConfiguration:LoopbackAddress` and `AmsConfiguration:LoopbackPort`.
22 |
23 | Per default both variables are set to:
24 |
25 | ```
26 | AmsConfiguration:LoopbackAddress=127.0.0.1
27 | AmsConfiguration:LoopbackPort=48898
28 | ```
29 |
30 | To point the `ads-cli-client` application to an `AdsRouterConsoleApp` instance you can pass suitable values via the `--env =` option of the `docker run` command.
31 | For instance:
32 |
33 | ```
34 | docker run -it --rm \
35 | --env "AmsConfiguration:LoopbackAddress=172.17.0.2" \
36 | --env "AmsConfiguration:LoopbackPort=48900" \
37 | ads-cli-client -v 5.76.88.215.1.1 'INT' 'MAIN.counter' '16'
38 | ```
--------------------------------------------------------------------------------
/Sources/ClientSamples/AdsCli/src/AdsCli.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | TwinCAT.Ads.Cli.Programm
7 | TwinCAT.Ads.Cli
8 | AdsCli
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Sources/ClientSamples/AdsCli/src/Logger.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace TwinCAT.Ads.Cli
4 | {
5 | public static class Logger
6 | {
7 | public static bool enableLogging;
8 |
9 | public static void log(string message){
10 | if(! enableLogging)
11 | return;
12 |
13 | DateTime now = DateTime.UtcNow;
14 |
15 | Console.WriteLine($"{now:O}: {message}");
16 | }
17 | }
18 | }
--------------------------------------------------------------------------------
/Sources/ClientSamples/AdsCli/src/Programm.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using TwinCAT.Ams;
3 | using System.Net;
4 | using System.Runtime.CompilerServices;
5 | using Microsoft.Extensions.Logging;
6 |
7 | namespace TwinCAT.Ads.Cli
8 | {
9 | class Programm
10 | {
11 | static int Main(string[] args)
12 | {
13 |
14 | ApplicationArgs appArgs = null;
15 | try
16 | {
17 | appArgs = ArgsParser.parse(args);
18 | }
19 | catch (System.Exception ex)
20 | {
21 | Console.WriteLine(ex.Message);
22 | Console.WriteLine(ArgsParser.printUsage());
23 | return 1;
24 | }
25 |
26 | if(appArgs.help){
27 | Console.WriteLine(ArgsParser.printUsage());
28 | return 0;
29 | }
30 |
31 | if(appArgs.version){
32 | Console.WriteLine(typeof(Programm).Assembly.GetName().Version.ToString());
33 | return 0;
34 | }
35 |
36 | Logger.enableLogging = appArgs.verbosity;
37 |
38 | IPAddress ipEndpoint;
39 | if(IPAddress.TryParse(System.Environment.GetEnvironmentVariable("AmsConfiguration:LoopbackAddress"), out ipEndpoint))
40 | {
41 | Logger.log($"AmsConfiguration:LoopbackAddress={ipEndpoint.ToString()}");
42 | } else {
43 | ipEndpoint = IPAddress.Loopback;
44 | }
45 |
46 | int port;
47 | if(int.TryParse(System.Environment.GetEnvironmentVariable("AmsConfiguration:LoopbackPort"), out port))
48 | {
49 | Logger.log($"AmsConfiguration:LoopbackPort={port.ToString()}");
50 | } else {
51 | port = 48898;
52 | }
53 |
54 | AmsConfiguration.RouterEndPoint = new IPEndPoint( ipEndpoint, port);
55 | Logger.log($"AMS router endpoint set to: {AmsConfiguration.RouterEndPoint.ToString()}");
56 |
57 | using (AdsClient client = new AdsClient())
58 | {
59 | try
60 | {
61 | // Connect to Address
62 | Logger.log($"ADS client will connect to ADS service: {appArgs.netId}:{appArgs.port}");
63 | client.Connect(appArgs.netId, appArgs.port);
64 | Logger.log($"ADS client connected to ADS service: {appArgs.netId}:{appArgs.port}");
65 |
66 | IAdsCommand cmd = new AdsCommand(client, appArgs.symbolName, appArgs.symbolType, appArgs.value);
67 | string result = String.Empty;
68 | result = cmd.execute();
69 | Console.Write(result);
70 | return 0;
71 |
72 | }
73 | catch (System.Exception ex)
74 | {
75 | Logger.log(ex.Message);
76 | return 1;
77 | }
78 | }
79 | }
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/Sources/ClientSamples/AdsOverMqttApp/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | // Use IntelliSense to learn about possible attributes.
3 | // Hover to view descriptions of existing attributes.
4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 | "version": "0.2.0",
6 | "configurations": [
7 | {
8 | "name": "C#: AdsOverMqttApp Debug",
9 | "type": "dotnet",
10 | "request": "launch",
11 | "projectPath": "${workspaceFolder}/src/AdsOverMqttApp.csproj"
12 | }
13 | ]
14 | }
--------------------------------------------------------------------------------
/Sources/ClientSamples/AdsOverMqttApp/AdsOverMqttApp.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.7.34031.279
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AdsOverMqttApp", "src\AdsOverMqttApp.csproj", "{8BBD5E02-0027-4638-8431-BE93BFB01C4D}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {8BBD5E02-0027-4638-8431-BE93BFB01C4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {8BBD5E02-0027-4638-8431-BE93BFB01C4D}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {8BBD5E02-0027-4638-8431-BE93BFB01C4D}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {8BBD5E02-0027-4638-8431-BE93BFB01C4D}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {3DB6E660-311D-4B68-AE5F-D5750318800E}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/Sources/ClientSamples/AdsOverMqttApp/src/AdsOverMqttApp.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | Exe
4 | net6.0
5 | Simple Console App that can use AdsOverMqtt without TwinCAT Router.
6 | AdsOverMqtt Sample
7 | true
8 | AdsOverMqtt.Program
9 | true
10 | portable
11 | latest
12 | PackageReference
13 | enable
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 | PreserveNewest
31 | Always
32 | true
33 |
34 |
35 |
--------------------------------------------------------------------------------
/Sources/ClientSamples/AdsOverMqttApp/src/Program.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.Configuration;
2 | using Microsoft.Extensions.DependencyInjection;
3 | using Microsoft.Extensions.Hosting;
4 | using Microsoft.Extensions.Logging;
5 | using System;
6 | using System.Reflection.Metadata;
7 | using System.Threading;
8 | using System.Threading.Tasks;
9 | using TwinCAT.Ads.Configuration;
10 | using TwinCAT.Ads.Logging;
11 |
12 | namespace AdsOverMqtt
13 | {
14 | #region CODE_SAMPLE_ADSOVERMQTT
15 |
16 | class Program
17 | {
18 | ///
19 | /// Defines the entry point of the application.
20 | ///
21 | /// The arguments.
22 | public async static Task Main(string[] args)
23 | {
24 | var ret = CreateHostBuilder(args);
25 | await ret.RunConsoleAsync();
26 | }
27 |
28 | ///
29 | /// Creates the host builder.
30 | ///
31 | /// The arguments.
32 | /// IHostBuilder.
33 | public static IHostBuilder CreateHostBuilder(string[] args)
34 | {
35 | var ret = Host.CreateDefaultBuilder(args);
36 |
37 | ret.ConfigureServices((hostContext, services) =>
38 | {
39 | services.AddHostedService();
40 | })
41 | .ConfigureAppConfiguration((hostingContext, config) =>
42 | {
43 | // Add further AppConfigurationProvider here.
44 | config.Sources.Clear(); // Clear all default config sources
45 |
46 | // Different options for configuration
47 | //config.AddEnvironmentVariables(); // Use Environment variables
48 | //config.AddCommandLine(args); // Use Command Line
49 | config.AddJsonFile("appSettings.json"); // Use AppSettings configuration file as config
50 | //config.AddStaticRoutesXmlConfiguration(null); // Use configuration from StaticRoutes.Xml
51 | })
52 | .ConfigureLogging((context,logging) =>
53 | {
54 | // Create specific Ads Logger configuration for formatted output
55 | AdsLoggerConfiguration? loggerConfig = AdsLoggerConfiguration.CreateFromConfiguration(context.Configuration);
56 | // Overwrites the configured Loglevel programatically
57 | // loggerConfig.LogLevel = LogLevel.Debug;
58 |
59 | logging.ClearProviders();
60 | // Adding console logging here.
61 | logging.AddProvider(new AdsLoggerProvider(() => loggerConfig));
62 | logging.SetMinimumLevel(LogLevel.Debug);
63 | });
64 | return ret;
65 | }
66 | }
67 | #endregion
68 | }
69 |
--------------------------------------------------------------------------------
/Sources/ClientSamples/AdsOverMqttApp/src/appSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "TargetNetId": "3.79.104.236.1.1",
3 | "AmsRouter": {
4 | "Name": "MqttRouter",
5 | "NetId": "42.42.42.42.1.1",
6 | "ChannelProtocol": "All",
7 | "Mqtt": [
8 | {
9 | "NoRetain": false,
10 | "Unidirectional": false,
11 | "Port": 8883,
12 | "Address": "ba-0f8cfe2680560cffb.eu-central-1.demo.beckhoff-cloud-instances.com",
13 | "Topic": "VirtualAmsNetwork1",
14 | "Tls": {
15 | "IgnoreCn": false,
16 | "CA": [
17 | "C:\\Program Files (x86)\\Beckhoff\\TwinCAT\\3.1\\Target\\Certificates\\BA-0f8cfe2680560cffb\\intermediateCA.pem"
18 | ],
19 | "CERT": "C:\\Program Files (x86)\\Beckhoff\\TwinCAT\\3.1\\Target\\Certificates\\BA-0f8cfe2680560cffb\\MyDevice.pem",
20 | "KEY": "C:\\Program Files (x86)\\Beckhoff\\TwinCAT\\3.1\\Target\\Certificates\\BA-0f8cfe2680560cffb\\MyDevice.key",
21 | "Version": "tlsv1.2"
22 | }
23 | }
24 | ]
25 | },
26 | "Logging": {
27 | "LogLevel": {
28 | "Default": "Information",
29 | "System": "Information",
30 | "Microsoft": "Information"
31 | },
32 | "Console": {
33 | "IncludeScopes": true
34 | }
35 | }
36 | }
--------------------------------------------------------------------------------
/Sources/ClientSamples/AdsOverMqttApp/src/settings.env:
--------------------------------------------------------------------------------
1 | # Setting the TargetNetId for the Remote TwinCAT Device
2 | TargetNetId=3.79.104.236.1.1
3 |
4 | # These are the MQTT Broker settings for usage with TLS
5 | # In this case a predefined cloud instance Mosquitto Broker
6 | # plus TwinCAT is running at the configured address
7 | # Replace this with your own settings
8 |
9 | # Basic ADS-Router config which has to match StaticRoutes on TwinCAT-Host systems
10 |
11 | # Set the Router Name
12 | AmsRouter__Name=MqttRouter
13 | # Set the Local AmsNetId for this sample
14 | AmsRouter__NetId=42.42.42.42.1.1
15 |
16 | #Use All Channel protocols: 1st try standard AMS, 2nd fallback to Mqtt
17 | AmsRouter__ChannelProtocol=All
18 |
19 | AmsRouter__Mqtt__0__NORETAIN=false
20 | AmsRouter__Mqtt__0__UNIDIRECTIONAL=false
21 | AmsRouter__Mqtt__0__PORT=8883
22 | AmsRouter__Mqtt__0__ADDRESS=ba-0f8cfe2680560cffb.eu-central-1.demo.beckhoff-cloud-instances.com
23 | AmsRouter__Mqtt__0__TOPIC=VirtualAmsNetwork1
24 | AmsRouter__Mqtt__0__TLS__IGNORECN=false
25 | AmsRouter__Mqtt__0__TLS__CA__0=C:\Program Files (x86)\Beckhoff\TwinCAT\3.1\Target\Certificates\BA-0f8cfe2680560cffb\intermediateCA.pem
26 | AmsRouter__Mqtt__0__TLS__CERT=C:\Program Files (x86)\Beckhoff\TwinCAT\3.1\Target\Certificates\BA-0f8cfe2680560cffb\MyDevice.pem
27 | AmsRouter__Mqtt__0__TLS__KEY=C:\Program Files (x86)\Beckhoff\TwinCAT\3.1\Target\Certificates\BA-0f8cfe2680560cffb\MyDevice.key
28 | AmsRouter__Mqtt__0__TLS__VERSION=tlsv1.2
29 | AmsRouter__Mqtt__0__User="DockerUser"
30 |
31 | # Verbose log output
32 | Logging__LogLevel__Default=Debug
33 | #Logging__LogLevel__Default=Information
--------------------------------------------------------------------------------
/Sources/ClientSamples/WpfAdsSession/WpfAdsSession.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.7.34031.279
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WpfAdsSession", "WpfAdsSession\WpfAdsSession.csproj", "{D8F14070-87FC-427E-84FD-8B20C808B545}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Debug|x64 = Debug|x64
12 | Debug|x86 = Debug|x86
13 | Release|Any CPU = Release|Any CPU
14 | Release|x64 = Release|x64
15 | Release|x86 = Release|x86
16 | TeamRelease|Any CPU = TeamRelease|Any CPU
17 | TeamRelease|x64 = TeamRelease|x64
18 | TeamRelease|x86 = TeamRelease|x86
19 | EndGlobalSection
20 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
21 | {D8F14070-87FC-427E-84FD-8B20C808B545}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
22 | {D8F14070-87FC-427E-84FD-8B20C808B545}.Debug|Any CPU.Build.0 = Debug|Any CPU
23 | {D8F14070-87FC-427E-84FD-8B20C808B545}.Debug|x64.ActiveCfg = Debug|Any CPU
24 | {D8F14070-87FC-427E-84FD-8B20C808B545}.Debug|x64.Build.0 = Debug|Any CPU
25 | {D8F14070-87FC-427E-84FD-8B20C808B545}.Debug|x86.ActiveCfg = Debug|Any CPU
26 | {D8F14070-87FC-427E-84FD-8B20C808B545}.Debug|x86.Build.0 = Debug|Any CPU
27 | {D8F14070-87FC-427E-84FD-8B20C808B545}.Release|Any CPU.ActiveCfg = Release|Any CPU
28 | {D8F14070-87FC-427E-84FD-8B20C808B545}.Release|Any CPU.Build.0 = Release|Any CPU
29 | {D8F14070-87FC-427E-84FD-8B20C808B545}.Release|x64.ActiveCfg = Release|Any CPU
30 | {D8F14070-87FC-427E-84FD-8B20C808B545}.Release|x64.Build.0 = Release|Any CPU
31 | {D8F14070-87FC-427E-84FD-8B20C808B545}.Release|x86.ActiveCfg = Release|Any CPU
32 | {D8F14070-87FC-427E-84FD-8B20C808B545}.Release|x86.Build.0 = Release|Any CPU
33 | {D8F14070-87FC-427E-84FD-8B20C808B545}.TeamRelease|Any CPU.ActiveCfg = Release|Any CPU
34 | {D8F14070-87FC-427E-84FD-8B20C808B545}.TeamRelease|Any CPU.Build.0 = Release|Any CPU
35 | {D8F14070-87FC-427E-84FD-8B20C808B545}.TeamRelease|x64.ActiveCfg = Release|Any CPU
36 | {D8F14070-87FC-427E-84FD-8B20C808B545}.TeamRelease|x64.Build.0 = Release|Any CPU
37 | {D8F14070-87FC-427E-84FD-8B20C808B545}.TeamRelease|x86.ActiveCfg = Release|Any CPU
38 | {D8F14070-87FC-427E-84FD-8B20C808B545}.TeamRelease|x86.Build.0 = Release|Any CPU
39 | EndGlobalSection
40 | GlobalSection(SolutionProperties) = preSolution
41 | HideSolutionNode = FALSE
42 | EndGlobalSection
43 | GlobalSection(ExtensibilityGlobals) = postSolution
44 | SolutionGuid = {4896B0FC-5821-432F-8E5F-826EA7C4FDB1}
45 | EndGlobalSection
46 | EndGlobal
47 |
--------------------------------------------------------------------------------
/Sources/ClientSamples/WpfAdsSession/WpfAdsSession/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Sources/ClientSamples/WpfAdsSession/WpfAdsSession/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace AdsSessionTest
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Sources/ClientSamples/WpfAdsSession/WpfAdsSession/DataTypeTemplateSelector.cs:
--------------------------------------------------------------------------------
1 | //using System;
2 | //using System.Collections.Generic;
3 | //using System.Linq;
4 | //using System.Text;
5 | //using System.Threading.Tasks;
6 | //using System.Windows;
7 | //using System.Windows.Controls;
8 | //using TwinCAT.TypeSystem;
9 |
10 | //namespace AdsSessionTest
11 | //{
12 | // public class DataTypeTemplateSelector : DataTemplateSelector
13 | // {
14 | // public override DataTemplate SelectTemplate(object item, DependencyObject container)
15 | // {
16 | // FrameworkElement element = container as FrameworkElement;
17 |
18 | // if (element != null && item != null)
19 | // {
20 |
21 | // if (item is IStructType)
22 | // {
23 | // return element.FindResource("StructTemplate") as HierarchicalDataTemplate;
24 | // }
25 | // else if (item is IArrayType)
26 | // {
27 | // return element.FindResource("ArrayTemplate") as HierarchicalDataTemplate;
28 | // }
29 | // else if (item is IAliasType)
30 | // {
31 | // return element.FindResource("AliasTemplate") as HierarchicalDataTemplate;
32 | // }
33 | // else if (item is IEnumType)
34 | // {
35 | // return element.FindResource("EnumTemplate") as HierarchicalDataTemplate;
36 | // }
37 | // else if (item is IMember)
38 | // {
39 | // return element.FindResource("MemberTemplate") as HierarchicalDataTemplate;
40 | // }
41 | // else if (item is IReferenceType)
42 | // {
43 | // return element.FindResource("ReferenceTemplate") as HierarchicalDataTemplate;
44 | // }
45 | // else if (item is IPointerType)
46 | // {
47 | // return element.FindResource("PointerTemplate") as HierarchicalDataTemplate;
48 | // }
49 | // else if (item is IStringType)
50 | // {
51 | // return element.FindResource("StringTemplate") as DataTemplate;
52 | // }
53 | // else if (item is IDataType)
54 | // {
55 | // return element.FindResource("DataTypeTemplate") as DataTemplate;
56 | // }
57 | // }
58 |
59 | // return null;
60 | // }
61 | // }
62 | //}
63 |
--------------------------------------------------------------------------------
/Sources/ClientSamples/WpfAdsSession/WpfAdsSession/DataTypesControl.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 | using TwinCAT.TypeSystem;
16 |
17 | namespace AdsSessionTest
18 | {
19 | ///
20 | /// Interaction logic for SymbolsControl.xaml
21 | ///
22 | public partial class DataTypesControl : UserControl
23 | {
24 | public DataTypesControl()
25 | {
26 | InitializeComponent();
27 | }
28 |
29 | public void SetSymbols(IEnumerable symbols, IEnumerable dataTypes)
30 | {
31 | _model = new DataTypesTreeViewModel(dataTypes);
32 | base.DataContext = _model;
33 | }
34 |
35 | DataTypesTreeViewModel _model = null;
36 |
37 | private void searchTextBox_KeyDown(object sender, KeyEventArgs e)
38 | {
39 | if (e.Key == Key.Enter)
40 | _model.SearchCommand.Execute(null);
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/Sources/ClientSamples/WpfAdsSession/WpfAdsSession/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace WpfAdsSession.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Sources/ClientSamples/WpfAdsSession/WpfAdsSession/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Sources/ClientSamples/WpfAdsSession/WpfAdsSession/Resources/Alias.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Beckhoff/TF6000_ADS_DOTNET_V5_Samples/1622ecc67540352b385b200bda509dad9fcbc196/Sources/ClientSamples/WpfAdsSession/WpfAdsSession/Resources/Alias.ico
--------------------------------------------------------------------------------
/Sources/ClientSamples/WpfAdsSession/WpfAdsSession/Resources/Array.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Beckhoff/TF6000_ADS_DOTNET_V5_Samples/1622ecc67540352b385b200bda509dad9fcbc196/Sources/ClientSamples/WpfAdsSession/WpfAdsSession/Resources/Array.ico
--------------------------------------------------------------------------------
/Sources/ClientSamples/WpfAdsSession/WpfAdsSession/Resources/DataType.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Beckhoff/TF6000_ADS_DOTNET_V5_Samples/1622ecc67540352b385b200bda509dad9fcbc196/Sources/ClientSamples/WpfAdsSession/WpfAdsSession/Resources/DataType.ico
--------------------------------------------------------------------------------
/Sources/ClientSamples/WpfAdsSession/WpfAdsSession/Resources/Enum.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Beckhoff/TF6000_ADS_DOTNET_V5_Samples/1622ecc67540352b385b200bda509dad9fcbc196/Sources/ClientSamples/WpfAdsSession/WpfAdsSession/Resources/Enum.ico
--------------------------------------------------------------------------------
/Sources/ClientSamples/WpfAdsSession/WpfAdsSession/Resources/Primitive.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Beckhoff/TF6000_ADS_DOTNET_V5_Samples/1622ecc67540352b385b200bda509dad9fcbc196/Sources/ClientSamples/WpfAdsSession/WpfAdsSession/Resources/Primitive.ico
--------------------------------------------------------------------------------
/Sources/ClientSamples/WpfAdsSession/WpfAdsSession/Resources/String.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Beckhoff/TF6000_ADS_DOTNET_V5_Samples/1622ecc67540352b385b200bda509dad9fcbc196/Sources/ClientSamples/WpfAdsSession/WpfAdsSession/Resources/String.ico
--------------------------------------------------------------------------------
/Sources/ClientSamples/WpfAdsSession/WpfAdsSession/Resources/Struct.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Beckhoff/TF6000_ADS_DOTNET_V5_Samples/1622ecc67540352b385b200bda509dad9fcbc196/Sources/ClientSamples/WpfAdsSession/WpfAdsSession/Resources/Struct.ico
--------------------------------------------------------------------------------
/Sources/ClientSamples/WpfAdsSession/WpfAdsSession/Resources/Symbol.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Beckhoff/TF6000_ADS_DOTNET_V5_Samples/1622ecc67540352b385b200bda509dad9fcbc196/Sources/ClientSamples/WpfAdsSession/WpfAdsSession/Resources/Symbol.ico
--------------------------------------------------------------------------------
/Sources/ClientSamples/WpfAdsSession/WpfAdsSession/SymbolTemplateSelector.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using TwinCAT.TypeSystem;
9 |
10 | namespace AdsSessionTest
11 | {
12 | public class SymbolTemplateSelector : DataTemplateSelector
13 | {
14 | public override DataTemplate SelectTemplate(object item, DependencyObject container)
15 | {
16 | FrameworkElement element = container as FrameworkElement;
17 |
18 | if (element != null && item != null)
19 | {
20 |
21 | if (item is IStructInstance)
22 | {
23 | return element.FindResource("StructTemplate") as HierarchicalDataTemplate;
24 | }
25 | else if (item is IArrayInstance)
26 | {
27 | return element.FindResource("ArrayTemplate") as HierarchicalDataTemplate;
28 | }
29 | else if (item is IPointerInstance)
30 | {
31 | return element.FindResource("PointerTemplate") as HierarchicalDataTemplate;
32 | }
33 | else if (item is IReferenceInstance)
34 | {
35 | return element.FindResource("ReferenceTemplate") as HierarchicalDataTemplate;
36 | }
37 | else if (item is ISymbol)
38 | {
39 | return element.FindResource("SymbolTemplate") as DataTemplate;
40 | }
41 | }
42 |
43 | return null;
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/Sources/ClientSamples/WpfAdsSession/WpfAdsSession/SymbolsControl.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 | using TwinCAT.TypeSystem;
16 |
17 | namespace AdsSessionTest
18 | {
19 | ///
20 | /// Interaction logic for SymbolsControl.xaml
21 | ///
22 | public partial class SymbolsControl : UserControl
23 | {
24 | public SymbolsControl()
25 | {
26 | InitializeComponent();
27 | }
28 |
29 | public void SetSymbols(IEnumerable symbols, IEnumerable dataTypes)
30 | {
31 | _model = new SymbolsTreeViewModel(symbols);
32 | base.DataContext = _model;
33 | }
34 |
35 | SymbolsTreeViewModel _model = null;
36 |
37 | private void searchTextBox_KeyDown(object sender, KeyEventArgs e)
38 | {
39 | if (e.Key == Key.Enter)
40 | _model.SearchCommand.Execute(null);
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/Sources/ClientSamples/WpfAdsSession/WpfAdsSession/SymbolsWindow.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/Sources/ClientSamples/WpfAdsSession/WpfAdsSession/SymbolsWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Shapes;
14 | using TwinCAT.TypeSystem;
15 |
16 | namespace AdsSessionTest
17 | {
18 | ///
19 | /// Interaction logic for SymbolsWindow.xaml
20 | ///
21 | public partial class SymbolsWindow : Window
22 | {
23 | public SymbolsWindow()
24 | {
25 | InitializeComponent();
26 | }
27 |
28 | public void SetSymbols(IEnumerable symbols, IEnumerable dataTypes)
29 | {
30 | symbolsControl.SetSymbols(symbols, dataTypes);
31 | dataTypesControl.SetSymbols(symbols, dataTypes);
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/Sources/ClientSamples/WpfAdsSession/WpfAdsSession/WpfAdsSession.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net8.0-windows
6 | true
7 | AdsSessionTest.App
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 | True
41 | True
42 | Settings.settings
43 |
44 |
45 |
46 |
47 |
48 | SettingsSingleFileGenerator
49 | Settings.Designer.cs
50 |
51 |
52 |
--------------------------------------------------------------------------------
/Sources/DockerSamples/.dockerignore:
--------------------------------------------------------------------------------
1 | **/.classpath
2 | **/.dockerignore
3 | **/.env
4 | **/.git
5 | **/.gitignore
6 | **/.project
7 | **/.settings
8 | **/.toolstarget
9 | **/.vs
10 | **/.vscode
11 | **/*.*proj.user
12 | **/*.dbmdl
13 | **/*.jfm
14 | **/azds.yaml
15 | **/bin
16 | **/charts
17 | **/docker-compose*
18 | **/Dockerfile*
19 | **/node_modules
20 | **/npm-debug.log
21 | **/obj
22 | **/secrets.dev.yaml
23 | **/values.dev.yaml
24 | LICENSE
25 | README.md
26 | !**/.gitignore
27 | !.git/HEAD
28 | !.git/config
29 | !.git/packed-refs
30 | !.git/refs/heads/**
--------------------------------------------------------------------------------
/Sources/DockerSamples/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | // Use IntelliSense to learn about possible attributes.
3 | // Hover to view descriptions of existing attributes.
4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 | "version": "0.2.0",
6 | "configurations": [
7 | {
8 | "name": "Launch Docker Router",
9 | "type": "docker",
10 | "request": "launch",
11 | "preLaunchTask": "docker-run AdsRouter: debug",
12 | "netCore": {
13 | "appProject": "${workspaceFolder}/AdsRouterConsole/AdsRouterConsole.csproj"
14 | }
15 | },
16 | {
17 | "name": "Launch Docker Router Server",
18 | "type": "docker",
19 | "request": "launch",
20 | "preLaunchTask": "docker-run Router AdsServer: debug",
21 | "netCore": {
22 | "appProject": "${workspaceFolder}/AdsServer/AdsServer.csproj"
23 | }
24 | },
25 | {
26 | "name": "Launch Docker MQTT Server",
27 | "type": "docker",
28 | "request": "launch",
29 | "preLaunchTask": "docker-run MQTT AdsServer: debug",
30 | "netCore": {
31 | "appProject": "${workspaceFolder}/AdsServer/AdsServer.csproj"
32 | }
33 | },
34 | {
35 | "name": "Launch Docker Router Client",
36 | "type": "docker",
37 | "request": "launch",
38 | "preLaunchTask": "docker-run Router AdsClient: debug",
39 | "netCore": {
40 | "appProject": "${workspaceFolder}/AdsClient/AdsClient.csproj"
41 | }
42 | },
43 | {
44 | "name": "Launch Docker MQTT Client",
45 | "type": "docker",
46 | "request": "launch",
47 | "preLaunchTask": "docker-run MQTT AdsClient: debug",
48 | "netCore": {
49 | "appProject": "${workspaceFolder}/AdsClient/AdsClient.csproj"
50 | }
51 | }
52 | ]
53 | }
--------------------------------------------------------------------------------
/Sources/DockerSamples/AdsClient/AdsClient.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 | Linux
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Sources/DockerSamples/AdsClient/Dockerfile:
--------------------------------------------------------------------------------
1 | # See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
2 |
3 | # This stage is used when running from VS in fast mode (Default for Debug configuration)
4 | FROM mcr.microsoft.com/dotnet/runtime:8.0 AS base
5 | USER $APP_UID
6 | WORKDIR /app
7 |
8 |
9 | # This stage is used to build the service project
10 | FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
11 | ARG BUILD_CONFIGURATION=Release
12 |
13 | # Access to DevOps Server Feed TcBase (Beckhoff internal)
14 | ARG NuGetPackageSourceCredentials_TcBase
15 | ENV NuGetPackageSourceCredentials_TcBase=$NuGetPackageSourceCredentials_TcBase
16 | ARG PAT
17 | ENV PAT=$PAT
18 | RUN echo "NuGetPackageSourceCredentials_TcBase: $NuGetPackageSourceCredentials_TcBase"
19 | RUN echo "PAT: $PAT"
20 |
21 | WORKDIR /src
22 | COPY ["./NuGet.Config", "AdsClient/"]
23 | COPY ["AdsClient/AdsClient.csproj", "AdsClient/"]
24 | RUN dotnet restore "./AdsClient/AdsClient.csproj"
25 | COPY . .
26 | WORKDIR "/src/AdsClient"
27 |
28 | # Clear all nuget caches
29 | RUN dotnet nuget locals all --clear
30 | RUN dotnet build "./AdsClient.csproj" -c $BUILD_CONFIGURATION -o /app/build
31 |
32 | # This stage is used to publish the service project to be copied to the final stage
33 | FROM build AS publish
34 | ARG BUILD_CONFIGURATION=Release
35 | RUN dotnet publish "./AdsClient.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
36 |
37 | # This stage is used in production or when running from VS in regular mode (Default when not using the Debug configuration)
38 | FROM base AS final
39 | WORKDIR /app
40 | COPY --from=publish /app/publish .
41 |
42 | EXPOSE 48898/tcp
43 | EXPOSE 48899/udp
44 |
45 | ENTRYPOINT ["dotnet", "AdsClient.dll"]
--------------------------------------------------------------------------------
/Sources/DockerSamples/AdsClient/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "AdsClient": {
4 | "commandName": "Project"
5 | },
6 | "Container (Dockerfile)": {
7 | "commandName": "Docker"
8 | }
9 | }
10 | }
--------------------------------------------------------------------------------
/Sources/DockerSamples/AdsRouterConsole/AdsRouterConsole.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 | Linux
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/Sources/DockerSamples/AdsRouterConsole/Dockerfile:
--------------------------------------------------------------------------------
1 | # See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
2 |
3 | # This stage is used when running from VS in fast mode (Default for Debug configuration)
4 | FROM mcr.microsoft.com/dotnet/runtime:8.0 AS base
5 | USER $APP_UID
6 | WORKDIR /app
7 |
8 |
9 | # This stage is used to build the service project
10 | FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
11 |
12 | WORKDIR /src
13 | COPY ["./NuGet.Config", "AdsRouterConsole/"]
14 | COPY ["AdsRouterConsole/AdsRouterConsole.csproj", "AdsRouterConsole/"]
15 |
16 | ARG BUILD_CONFIGURATION=Release
17 |
18 | # Access to DevOps Server Feed TcBase (Beckhoff internal)
19 | ARG NuGetPackageSourceCredentials_TcBase
20 | ENV NuGetPackageSourceCredentials_TcBase=$NuGetPackageSourceCredentials_TcBase
21 | ARG PAT
22 | ENV PAT=$PAT
23 | RUN echo "NuGetPackageSourceCredentials_TcBase: $NuGetPackageSourceCredentials_TcBase"
24 | RUN echo "PAT: $PAT"
25 |
26 | COPY . .
27 | WORKDIR "/src/AdsRouterConsole"
28 |
29 | # Clear all nuget caches
30 | RUN dotnet nuget locals all --clear
31 | RUN dotnet build "./AdsRouterConsole.csproj" -c $BUILD_CONFIGURATION -o /app/build
32 |
33 | # This stage is used to publish the service project to be copied to the final stage
34 | FROM build AS publish
35 | RUN dotnet publish "./AdsRouterConsole.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
36 |
37 | # This stage is used in production or when running from VS in regular mode (Default when not using the Debug configuration)
38 | FROM base AS final
39 | WORKDIR /app
40 | COPY --from=publish /app/publish .
41 |
42 | EXPOSE 48898/tcp
43 | EXPOSE 48899/udp
44 |
45 | ENTRYPOINT ["dotnet", "AdsRouterConsole.dll"]
--------------------------------------------------------------------------------
/Sources/DockerSamples/AdsRouterConsole/Program.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.Configuration;
2 | using Microsoft.Extensions.DependencyInjection;
3 | using Microsoft.Extensions.Hosting;
4 | using Microsoft.Extensions.Logging;
5 | using TwinCAT.Ads.Logging;
6 |
7 | namespace AdsRouterConsole
8 | {
9 | class Program
10 | {
11 | ///
12 | /// Defines the entry point of the application.
13 | ///
14 | /// The arguments.
15 | public static void Main(string[] args)
16 | {
17 | try
18 | {
19 | CreateHostBuilder(args).Build().Run();
20 | }
21 | catch (OperationCanceledException /*cex*/)
22 | {
23 | Console.WriteLine("Router cancelledd!");
24 | }
25 | catch (Exception ex)
26 | {
27 | Console.WriteLine($"Router failed with '{ex.Message}'");
28 | }
29 | }
30 |
31 | ///
32 | /// Creates the host builder.
33 | ///
34 | /// The arguments.
35 | /// IHostBuilder.
36 | public static IHostBuilder CreateHostBuilder(string[] args)
37 | {
38 | var ret = Host.CreateDefaultBuilder(args);
39 |
40 | ret.ConfigureServices((hostContext, services) =>
41 | {
42 | services.AddHostedService();
43 | })
44 | .ConfigureAppConfiguration((hostingContext, config) =>
45 | {
46 | // Add further AppConfigurationProvider here.
47 | config.Sources.Clear(); // Clear all default config sources
48 | config.AddEnvironmentVariables(); // Use Environment variables
49 | //config.AddCommandLine(args); // Use Command Line
50 | //config.AddJsonFile("appSettings.Development.json"); // Use Appsettings
51 | //config.AddStaticRoutesXmlConfiguration(); // Overriding settings with StaticRoutes.Xml
52 | })
53 | .ConfigureLogging((context, logging) =>
54 | {
55 | var loggerConfig = AdsLoggerConfiguration.CreateFromConfiguration(context.Configuration);
56 | logging.ClearProviders();
57 | // Adding console logging here.
58 | logging.AddProvider(new AdsLoggerProvider(() => loggerConfig));
59 | logging.SetMinimumLevel(LogLevel.Debug);
60 | });
61 | return ret;
62 | }
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/Sources/DockerSamples/AdsRouterConsole/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "AdsRouterConsole": {
4 | "commandName": "Project"
5 | },
6 | "Container (Dockerfile)": {
7 | "commandName": "Docker"
8 | }
9 | }
10 | }
--------------------------------------------------------------------------------
/Sources/DockerSamples/AdsServer/AdsServer.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 | Linux
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/Sources/DockerSamples/AdsServer/Dockerfile:
--------------------------------------------------------------------------------
1 | # See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
2 |
3 | # This stage is used when running from VS in fast mode (Default for Debug configuration)
4 | FROM mcr.microsoft.com/dotnet/runtime:8.0 AS base
5 | USER $APP_UID
6 | WORKDIR /app
7 |
8 |
9 | # This stage is used to build the service project
10 | FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
11 | ARG BUILD_CONFIGURATION=Release
12 |
13 | # Access to DevOps Server Feed TcBase (Beckhoff internal)
14 | ARG NuGetPackageSourceCredentials_TcBase
15 | ENV NuGetPackageSourceCredentials_TcBase=$NuGetPackageSourceCredentials_TcBase
16 | ARG PAT
17 | ENV PAT=$PAT
18 | RUN echo "NuGetPackageSourceCredentials_TcBase: $NuGetPackageSourceCredentials_TcBase"
19 | RUN echo "PAT: $PAT"
20 |
21 | WORKDIR /src
22 | COPY ["./NuGet.Config", "AdsServer/"]
23 | COPY ["AdsServer/AdsServer.csproj", "AdsServer/"]
24 | RUN dotnet restore "./AdsServer/AdsServer.csproj"
25 | COPY . .
26 | WORKDIR "/src/AdsServer"
27 |
28 | # Clear all nuget caches
29 | RUN dotnet nuget locals all --clear
30 | RUN dotnet build "./AdsServer.csproj" -c $BUILD_CONFIGURATION -o /app/build
31 |
32 | # This stage is used to publish the service project to be copied to the final stage
33 | FROM build AS publish
34 | ARG BUILD_CONFIGURATION=Debug
35 | RUN dotnet publish "./AdsServer.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
36 |
37 | # This stage is used in production or when running from VS in regular mode (Default when not using the Debug configuration)
38 | FROM base AS final
39 | WORKDIR /app
40 | COPY --from=publish /app/publish .
41 |
42 | EXPOSE 48898/tcp
43 | EXPOSE 48899/udp
44 |
45 | ENTRYPOINT ["dotnet", "AdsServer.dll"]
--------------------------------------------------------------------------------
/Sources/DockerSamples/AdsServer/Program.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.Configuration;
2 | using Microsoft.Extensions.DependencyInjection;
3 | using Microsoft.Extensions.Hosting;
4 | using Microsoft.Extensions.Logging;
5 | using TwinCAT.Ads.Logging;
6 |
7 | namespace Server
8 | {
9 | class Program
10 | {
11 | ///
12 | /// Defines the entry point of the application.
13 | ///
14 | /// The arguments.
15 | public static void Main(string[] args)
16 | {
17 | try
18 | {
19 | CreateHostBuilder(args).Build().Run();
20 | }
21 | catch (OperationCanceledException /*cex*/)
22 | {
23 | Console.WriteLine("Server stopped!");
24 | }
25 | catch (Exception ex)
26 | {
27 | Console.WriteLine($"Server failed with '{ex.Message}'");
28 | }
29 | }
30 |
31 | ///
32 | /// Creates the host builder.
33 | ///
34 | /// The arguments.
35 | /// IHostBuilder.
36 | public static IHostBuilder CreateHostBuilder(string[] args)
37 | {
38 | var ret = Host.CreateDefaultBuilder(args);
39 |
40 | ret.ConfigureServices((hostContext, services) =>
41 | {
42 | services.AddHostedService();
43 | })
44 | .ConfigureAppConfiguration((hostingContext, config) =>
45 | {
46 | // Add further AppConfigurationProvider here.
47 | config.Sources.Clear(); // Clear all default config sources
48 | config.AddEnvironmentVariables(); // Use Environment variables (Without prefix)
49 | //config.AddCommandLine(args); // Use Command Lined
50 | //config.AddJsonFile("appSettings.Development.json"); // Use Appsettings
51 | //config.AddStaticRoutesXmlConfiguration(); // Overriding settings with StaticRoutes.Xml
52 | })
53 | .ConfigureLogging((context, logging) =>
54 | {
55 | var loggerConfig = AdsLoggerConfiguration.CreateFromConfiguration(context.Configuration);
56 | // var loggerConfig = AdsLoggerConfiguration.CreateFromEnvironment();
57 |
58 | // Overwrites the configured Loglevel programatically
59 | loggerConfig.LogLevel = LogLevel.Debug;
60 |
61 | // Remove the default logging
62 | logging.ClearProviders();
63 | // Adding customized formatted Ads logging here.
64 | logging.AddProvider(new AdsLoggerProvider(() => loggerConfig));
65 | logging.SetMinimumLevel(LogLevel.Debug);
66 | //logging.SetMinimumLevel(LogLevel.Debug);
67 | });
68 | return ret;
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/Sources/DockerSamples/AdsServer/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "AdsServer": {
4 | "commandName": "Project"
5 | },
6 | "Container (Dockerfile)": {
7 | "commandName": "Docker"
8 | }
9 | }
10 | }
--------------------------------------------------------------------------------
/Sources/DockerSamples/DockerSample.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.0.31903.59
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdsClient", "AdsClient\AdsClient.csproj", "{87DB58F1-D3DA-4CFB-82C2-7F115643DFD0}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdsServer", "AdsServer\AdsServer.csproj", "{D870FE37-41D2-42A9-9CFD-4CF76B65EAFC}"
9 | EndProject
10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdsRouterConsole", "AdsRouterConsole\AdsRouterConsole.csproj", "{9E255E1C-4929-419A-BE84-F8EF613A9D83}"
11 | EndProject
12 | Global
13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
14 | Debug|Any CPU = Debug|Any CPU
15 | Release|Any CPU = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
18 | {87DB58F1-D3DA-4CFB-82C2-7F115643DFD0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
19 | {87DB58F1-D3DA-4CFB-82C2-7F115643DFD0}.Debug|Any CPU.Build.0 = Debug|Any CPU
20 | {87DB58F1-D3DA-4CFB-82C2-7F115643DFD0}.Release|Any CPU.ActiveCfg = Release|Any CPU
21 | {87DB58F1-D3DA-4CFB-82C2-7F115643DFD0}.Release|Any CPU.Build.0 = Release|Any CPU
22 | {D870FE37-41D2-42A9-9CFD-4CF76B65EAFC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
23 | {D870FE37-41D2-42A9-9CFD-4CF76B65EAFC}.Debug|Any CPU.Build.0 = Debug|Any CPU
24 | {D870FE37-41D2-42A9-9CFD-4CF76B65EAFC}.Release|Any CPU.ActiveCfg = Release|Any CPU
25 | {D870FE37-41D2-42A9-9CFD-4CF76B65EAFC}.Release|Any CPU.Build.0 = Release|Any CPU
26 | {9E255E1C-4929-419A-BE84-F8EF613A9D83}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
27 | {9E255E1C-4929-419A-BE84-F8EF613A9D83}.Debug|Any CPU.Build.0 = Debug|Any CPU
28 | {9E255E1C-4929-419A-BE84-F8EF613A9D83}.Release|Any CPU.ActiveCfg = Release|Any CPU
29 | {9E255E1C-4929-419A-BE84-F8EF613A9D83}.Release|Any CPU.Build.0 = Release|Any CPU
30 | EndGlobalSection
31 | GlobalSection(SolutionProperties) = preSolution
32 | HideSolutionNode = FALSE
33 | EndGlobalSection
34 | EndGlobal
35 |
--------------------------------------------------------------------------------
/Sources/DockerSamples/NuGet.Config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/Sources/DockerSamples/PwshClient/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM mcr.microsoft.com/powershell:latest AS final
2 |
3 | #Use a local TcXaeMgmt Module for debugging purposes
4 | #COPY TcXaeMgmt/ /TcXaeMgmt
5 |
6 | # Install the TcXaeMgmt module
7 | RUN pwsh -Command "Install-Module -Name TcXaeMgmt -Force -Scope AllUsers -AllowClobber -AcceptLicense"
8 |
9 | # Copy your script into the container
10 | COPY PwshClient/init.ps1 /scripts/init.ps1
11 |
12 | # Run the script and keep the container running
13 | CMD ["pwsh", "-NoExit", "-File", "/scripts/init.ps1"]
14 |
--------------------------------------------------------------------------------
/Sources/DockerSamples/PwshClient/init.ps1:
--------------------------------------------------------------------------------
1 | # Print out the Environment-Variables (IConfiguation settings)
2 | #Get-ChildItem env:
3 |
4 | # Only for debugging purposes (when the TcXaeMgmt is provided as COPY instruction in dockerfile)
5 | $debugModuleExist = Test-Path -path .\TcXaeMgmt
6 | if ($debugModuleExist)
7 | {
8 | import-module -name .\TcXaeMgmt\TcXaeMgmt.psm1
9 | update-FormatData -AppendPath .\TcXaeMgmt\TcXaeMgmt.format.ps1xml
10 | }
11 |
12 | get-module TcXaeMgmt
13 |
14 | # Wait, the router/broker needs time to start ...
15 | Start-Sleep -Seconds 1
16 |
17 | # Show the AmsRouter Endpoint (the Loopback settings)
18 | Write-Host 'LocalEndpoint:'
19 | Get-AmsRouterEndpoint
20 | # Show the Local AmsNetId
21 | Write-Host 'Local AmsNetId:'
22 | Get-AmsNetId
23 |
24 | Write-Host '+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++'
25 | Write-Host 'Attach to the powershell console within this docker instance with:'
26 | Write-Host 'PS> docker exec -it [containerID] pwsh'
27 | Write-Host '+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++'
28 |
29 | #Connect to the AdsTestServer on Port 25000
30 | $s = New-TcSession -port 25000
31 | Write-Host 'Connection established to:'
32 | Write-Host $s
33 |
34 | # Testing connections for 10000 Seconds
35 | #$s | test-adsRoute -port 25000 -count 10000
36 | while($true)
37 | {
38 | $state = get-AdsState -session $s -StateOnly
39 | Write-Host "[PowershellClient] State of Server '$($s.NetId):$($s.Port)' is: $state"
40 | Start-Sleep -Seconds 1
41 | }
42 |
--------------------------------------------------------------------------------
/Sources/DockerSamples/config-mqtt.env:
--------------------------------------------------------------------------------
1 | # Environment variables configuration for the docker-compose.mqtt.yml sample
2 |
3 | # Forces the AdsOverMqtt ChannelProtocol
4 | AmsRouter__ChannelProtocol=AdsOverMqtt
5 |
6 | # Basic ADS-Router config
7 | AmsRouter__Name=MqttRouter
8 | AmsRouter__NetId=42.42.42.42.1.1
9 |
10 | # Mqtt Broker configuration
11 | # No security here
12 | AmsRouter__Mqtt__0__Address=192.168.20.2
13 | AmsRouter__Mqtt__0__Port=1883
14 | AmsRouter__Mqtt__0__Topic=VirtualAmsNetwork1
15 | #AmsRouter__Mqtt__0__User="DockerUser"
16 |
17 | # Log output (Warning level)
18 | Logging__LogLevel__Default=Warning
19 |
--------------------------------------------------------------------------------
/Sources/DockerSamples/config-routerconsole.env:
--------------------------------------------------------------------------------
1 | # Environment variables configuration for the docker-compose.routerconsole.yml sample
2 |
3 | # Basic ADS-Router config which has to match StaticRoutes on TwinCAT-Host systems
4 | AmsRouter__Name=AdsRouterConsole
5 | AmsRouter__NetId=42.42.42.42.1.1
6 |
7 | # Forces the ADS protocol
8 | AmsRouter__ChannelProtocol=Ads
9 |
10 | # IP and TCP socket on which the ADS-Router should listen on for incoming (internal) client connections
11 | # Changed IP/Port here to use a dedicated Ip Port for internal Router communication
12 | AmsRouter__LoopbackIP=192.168.20.2
13 | AmsRouter__LoopbackPort=48900
14 |
15 | # Setting to accept incoming ADS-Client connections from the private container subnetwork
16 | AmsRouter__LoopbackExternalSubnet=192.168.20.0/24
17 |
18 | # Indexed List of remote connections to TwinCAT Hosts (Example)
19 | # First TwinCAT-Host
20 | # AmsRouter__RemoteConnections__0__Name=TwinCAT-Host
21 | # AmsRouter__RemoteConnections__0__Address=192.168.178.72
22 | # AmsRouter__RemoteConnections__0__NetId=192.168.178.72.1.1
23 |
24 | # Another sample TwinCAT-Host
25 | # AmsRouter__RemoteConnections__1__Name=Another-TwinCAT-Host
26 | # AmsRouter__RemoteConnections__1__Address=192.168.178.73
27 | # AmsRouter__RemoteConnections__1__NetId=192.168.178.73.1.1
28 |
29 | # Verbose log output
30 | # Use this to get (ADS) ads logging out of the different containers
31 | Logging__LogLevel__Default=Warning
--------------------------------------------------------------------------------
/Sources/DockerSamples/docker-compose.mqtt.yml:
--------------------------------------------------------------------------------
1 | # Docker Compose file creating MqttBroker-AdsServer-AdsClient-PwshClient
2 |
3 | name: "mqttsample"
4 | services:
5 |
6 | mosquitto:
7 | image: eclipse-mosquitto
8 | container_name: mosquitto
9 | hostname: mosquitto
10 | ports:
11 | - "1883:1883"
12 | restart: unless-stopped
13 | volumes:
14 | - ./simple-mosquitto.conf:/mosquitto/config/mosquitto.conf
15 | networks:
16 | twincatads:
17 | ipv4_address: 192.168.20.2
18 |
19 | # AdsServer instance
20 | server:
21 | env_file: "config-mqtt.env"
22 | environment:
23 | - ChannelProtocol=AdsOverMqtt
24 | depends_on:
25 | - mosquitto
26 | build:
27 | context: .
28 | dockerfile: ./AdsServer/Dockerfile
29 | args:
30 | # Access to DevOps Server Feed TcBase (Beckhoff internal)
31 | NuGetPackageSourceCredentials_TcBase: ${NuGetPackageSourceCredentials_TcBase}
32 | PAT: ${AZDEVOPS_ACCESS_TOKEN}
33 | networks:
34 | twincatads:
35 | ipv4_address: 192.168.20.3
36 |
37 | # AdsClient instance
38 | client:
39 | env_file: "config-mqtt.env"
40 | environment:
41 | - ChannelProtocol=AdsOverMqtt
42 | depends_on:
43 | - mosquitto
44 | - server
45 | build:
46 | context: .
47 | dockerfile: ./AdsClient/Dockerfile
48 | args:
49 | # Access to DevOps Server Feed TcBase (Beckhoff internal)
50 | NuGetPackageSourceCredentials_TcBase: ${NuGetPackageSourceCredentials_TcBase}
51 | PAT: ${AZDEVOPS_ACCESS_TOKEN}
52 | networks:
53 | twincatads:
54 | ipv4_address: 192.168.20.4
55 |
56 | # Powershell client with installed TcXaeMgmt Module (ADS for Powershell)
57 | pwshclient:
58 | env_file: "config-mqtt.env"
59 | environment:
60 | - ChannelProtocol=AdsOverMqtt
61 | build:
62 | context: .
63 | dockerfile: ./PwshClient/Dockerfile
64 | networks:
65 | twincatads:
66 | ipv4_address: 192.168.20.5
67 | stdin_open: true
68 | tty: true
69 |
70 | networks:
71 | twincatads:
72 | name: twincatads
73 | ipam:
74 | driver: default
75 | config:
76 | - subnet: 192.168.20.0/24
77 | gateway: 192.168.20.1
--------------------------------------------------------------------------------
/Sources/DockerSamples/docker-compose.routerconsole.yml:
--------------------------------------------------------------------------------
1 | # Docker Compose file creating RouterConsole-AdsServer-AdsClient-PwshClient
2 |
3 | name: "routerconsolesample"
4 | services:
5 |
6 | router:
7 | env_file: "config-routerconsole.env"
8 | build:
9 | context: .
10 | dockerfile: ./AdsRouterConsole/Dockerfile
11 | args:
12 | # Access to DevOps Server Feed TcBase (Beckhoff internal)
13 | NuGetPackageSourceCredentials_TcBase: ${NuGetPackageSourceCredentials_TcBase}
14 | PAT: ${AZDEVOPS_ACCESS_TOKEN}
15 | networks:
16 | twincatads:
17 | # The router address is defined fixed in the Environment Variables (config-routerconsole.env)
18 | ipv4_address: 192.168.20.2
19 |
20 | server:
21 | env_file: "config-routerconsole.env"
22 | depends_on:
23 | - router
24 | build:
25 | context: .
26 | dockerfile: ./AdsServer/Dockerfile
27 | args:
28 | # Access to DevOps Server Feed TcBase (Beckhoff internal)
29 | NuGetPackageSourceCredentials_TcBase: ${NuGetPackageSourceCredentials_TcBase}
30 | PAT: ${AZDEVOPS_ACCESS_TOKEN}
31 | networks:
32 | twincatads:
33 | ipv4_address: 192.168.20.3
34 |
35 | client:
36 | env_file: "config-routerconsole.env"
37 | depends_on:
38 | - router
39 | - server
40 | build:
41 | context: .
42 | dockerfile: ./AdsClient/Dockerfile
43 | args:
44 | # Access to DevOps Server Feed TcBase (Beckhoff internal)
45 | NuGetPackageSourceCredentials_TcBase: ${NuGetPackageSourceCredentials_TcBase}
46 | PAT: ${AZDEVOPS_ACCESS_TOKEN}
47 | networks:
48 | twincatads:
49 | ipv4_address: 192.168.20.4
50 |
51 | # Powershell client with installed TcXaeMgmt Module (ADS for Powershell)
52 | pwshclient:
53 | env_file: "config-routerconsole.env"
54 | build:
55 | context: .
56 | dockerfile: ./PwshClient/Dockerfile
57 | networks:
58 | twincatads:
59 | ipv4_address: 192.168.20.5
60 | stdin_open: true
61 | tty: true
62 |
63 | networks:
64 | twincatads:
65 | name: twincatads
66 | ipam:
67 | driver: default
68 | config:
69 | - subnet: 192.168.20.0/24
70 | gateway: 192.168.20.1
--------------------------------------------------------------------------------
/Sources/DockerSamples/simple-mosquitto.conf:
--------------------------------------------------------------------------------
1 | listener 1883
2 | persistence true
3 | persistence_location /mosquitto/data
4 | allow_anonymous true
--------------------------------------------------------------------------------
/Sources/ManagementSamples/PwshBroadcastSearch/Program.cs:
--------------------------------------------------------------------------------
1 | using System.Linq;
2 | using System.Management.Automation;
3 |
4 |
5 | // TcXaeMgmt must be installed from powershell Gallery
6 | string name = "TcXaeMgmt";
7 |
8 | // Alternatively the TcXaeMgmt Module can be loaded from an XCopy Deployed folder
9 | // string path = c:\tmp\TcXaeMgmt\6.0.68\TcXaeMgmt.psd1
10 | PowerShell sh = PowerShell.Create();
11 |
12 | //Import Module
13 | sh.AddStatement()
14 | .AddCommand("Import-Module")
15 | .AddParameter("Name", name).Invoke();
16 |
17 | //Broadcast Search
18 | Console.WriteLine("Starting BroadCast Search ...");
19 |
20 | var result = sh.AddStatement()
21 | .AddCommand("Get-AdsRoute")
22 | .AddParameter("all", true)
23 | .Invoke();
24 |
25 | foreach(var r in result)
26 | {
27 | Console.WriteLine(r.BaseObject.ToString());
28 | }
29 |
30 | Console.WriteLine("");
31 | Console.WriteLine("Completed");
32 | Console.WriteLine("");
33 | Console.WriteLine("Press Enter");
34 | Console.ReadLine();
35 |
--------------------------------------------------------------------------------
/Sources/ManagementSamples/PwshBroadcastSearch/PwshBroadcastSearch.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | Exe
4 | net8.0
5 | enable
6 | enable
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Sources/ManagementSamples/PwshBroadcastSearch/PwshBroadcastSearch.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.4.33110.190
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PwshBroadcastSearch", "PwshBroadcastSearch.csproj", "{4A1EF723-5363-4BD5-ADBB-E0AB07B2DEB2}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {4A1EF723-5363-4BD5-ADBB-E0AB07B2DEB2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {4A1EF723-5363-4BD5-ADBB-E0AB07B2DEB2}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {4A1EF723-5363-4BD5-ADBB-E0AB07B2DEB2}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {4A1EF723-5363-4BD5-ADBB-E0AB07B2DEB2}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {9A215B7F-C4CA-4B4D-96CF-DE773EF4FB2C}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/Sources/ProviderSamples/CustomSessionProvider/CustomSessionProvider.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | true
4 |
5 |
6 | net6.0;netstandard2.0;net8.0
7 | Beckhoff.TwinCAT.Ads.CustomSessionProvider
8 | Ralf Heitmann
9 |
10 | Beckhoff.CustomSymbolProvider
11 | latest
12 | enable
13 |
14 |
15 |
16 |
17 |
18 |
19 | all
20 | runtime; build; native; contentfiles; analyzers
21 |
22 |
23 |
--------------------------------------------------------------------------------
/Sources/ProviderSamples/CustomSessionProvider/CustomSessionProvider.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.31729.503
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CustomSessionProvider", "CustomSessionProvider.csproj", "{C45A2ABF-C54F-4DA4-A8DE-0B14E66F6D63}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {C45A2ABF-C54F-4DA4-A8DE-0B14E66F6D63}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {C45A2ABF-C54F-4DA4-A8DE-0B14E66F6D63}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {C45A2ABF-C54F-4DA4-A8DE-0B14E66F6D63}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {C45A2ABF-C54F-4DA4-A8DE-0B14E66F6D63}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {EE6FD77E-FB71-4407-9542-8AB1D9E292BE}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/Sources/ProviderSamples/CustomSessionProvider/ReadMe.md:
--------------------------------------------------------------------------------
1 | # Using of the CustomSessionProvider Sample
2 | A custom Session provider extends the Session handling of the Beckhoff.TwinCAT.Ads package by your custom protocol.
3 | The provider is integrated in the TwinCAT System as MEF component, so just compile the Sample and copy the resulting dll beneath the TwinCAT.Ads.dll (which acts as MEF controller) or inside the TcXaeMgmt Module folder (for testing purposes with the TcXaeMgmt Powershell Cmdlets).
4 |
5 | - Using customized protocols for the Session object
6 | - Browsing datatypes and Symbols
7 | - Reading and Writing Values by Symbols and/or by IndexGroup/IndexOffset
8 | - MEF Integration into the Beckhoff.TwinCAT.Ads package (actually TwinCAT Scope Browser, TcXaeMgmt Powershell module)
9 |
10 | ## Testing the Provider with the [TcXaeMgmt](https://www.powershellgallery.com/packages/TcXaeMgmt) Module
11 | ### Creating a Session in a CustomSessionProvider
12 | ```powershell
13 | PS> $session = New-TcSession -Provider Custom -address Anything
14 | PS> $session
15 |
16 | ID Address IsConnected ConnectionState Cycles Errors LastError EstablishedAt LastSucceeded
17 | -- ------- ----------- --------------- ------ ------ --------- ------------- -------------
18 | 11 Anything True Connected 07.12.2021 10:35:13
19 | ```
20 | ### Browsing DataTypes
21 | ```powershell
22 | PS> ($session | get-tcdatatype).FullName
23 | BuildInBool
24 | BuildInInt
25 | BuildInString
26 | BuildInStruct
27 | BuildInArray
28 | ```
29 | ### Browsing Symbols
30 | ```powershell
31 | PS> ($session | get-tcSymbol -recurse).InstancePath
32 | MAIN
33 | MAIN.sym1
34 | MAIN.sym2
35 | MAIN.sym2.a
36 | MAIN.sym2.b
37 | MAIN.sym2.c
38 | MAIN.sym2.d
39 | MAIN.sym2.e
40 | MAIN.sym3
41 | Yoda
42 | Yoda.Quota1
43 | Yoda.Quota2
44 | Yoda.Quota3
45 | ```
46 | ### Reading/Writing Symbol Values
47 | ``` powershell
48 | PS> $session | Read-TcValue -Path Main.sym1
49 | true
50 | ```
51 |
52 | ``` powershell
53 | PS> $session | Write-TcValue -Path Main.sym1 -value $false
54 | true
55 | ```
--------------------------------------------------------------------------------
/Sources/RouterSamples/AdsRouterAndClientConsoleApp/AdsRouterAndClientConsoleApp.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.7.34031.279
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AdsRouterAndClientConsoleApp", "AdsRouterAndClientConsoleApp\AdsRouterAndClientConsoleApp.csproj", "{B809D3D4-1B59-4167-AD58-66D880D95BEB}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | TeamRelease|Any CPU = TeamRelease|Any CPU
13 | EndGlobalSection
14 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
15 | {B809D3D4-1B59-4167-AD58-66D880D95BEB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
16 | {B809D3D4-1B59-4167-AD58-66D880D95BEB}.Debug|Any CPU.Build.0 = Debug|Any CPU
17 | {B809D3D4-1B59-4167-AD58-66D880D95BEB}.Release|Any CPU.ActiveCfg = Release|Any CPU
18 | {B809D3D4-1B59-4167-AD58-66D880D95BEB}.Release|Any CPU.Build.0 = Release|Any CPU
19 | {B809D3D4-1B59-4167-AD58-66D880D95BEB}.TeamRelease|Any CPU.ActiveCfg = Release|Any CPU
20 | {B809D3D4-1B59-4167-AD58-66D880D95BEB}.TeamRelease|Any CPU.Build.0 = Release|Any CPU
21 | EndGlobalSection
22 | GlobalSection(SolutionProperties) = preSolution
23 | HideSolutionNode = FALSE
24 | EndGlobalSection
25 | GlobalSection(ExtensibilityGlobals) = postSolution
26 | SolutionGuid = {0FE21662-2CB0-4D16-A273-6E39ECDF1AED}
27 | EndGlobalSection
28 | EndGlobal
29 |
--------------------------------------------------------------------------------
/Sources/RouterSamples/AdsRouterAndClientConsoleApp/AdsRouterAndClientConsoleApp/AdsRouterAndClientConsoleApp.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | AdsRouterAndClientConsoleApp.SimpleProgram
7 | enable
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | PreserveNewest
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/Sources/RouterSamples/AdsRouterAndClientConsoleApp/AdsRouterAndClientConsoleApp/Services/AdsBaseService.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.Hosting;
2 | using Microsoft.Extensions.Logging;
3 | using System;
4 | using System.Threading;
5 | using System.Threading.Tasks;
6 | using TwinCAT.Ads;
7 |
8 | namespace AdsRouterAndClientConsoleApp
9 | {
10 | internal abstract class AdsBaseService : BackgroundService
11 | {
12 | protected readonly ILogger logger;
13 | protected readonly AmsAddress address;
14 |
15 | protected AdsClient? _client = null;
16 |
17 | public AdsBaseService(AmsAddress address, ILogger logger)
18 | {
19 | this.address = address;
20 | this.logger = logger;
21 | }
22 |
23 | ~AdsBaseService()
24 | {
25 | Dispose(false);
26 | }
27 |
28 | bool _disposed = false;
29 |
30 | public override void Dispose()
31 | {
32 | if (!_disposed)
33 | Dispose(true);
34 |
35 | base.Dispose();
36 |
37 | _disposed = true;
38 | GC.SuppressFinalize(this);
39 | }
40 |
41 | protected virtual void Dispose(bool disposing)
42 | {
43 | if (disposing)
44 | {
45 | if (_client != null)
46 | _client.Dispose();
47 | }
48 | }
49 |
50 | protected override async Task ExecuteAsync(CancellationToken cancel)
51 | {
52 | // Wait for router to start
53 | await Task.Delay(TimeSpan.FromSeconds(2), cancel);
54 |
55 | // Establish connection and read State
56 | _client = new AdsClient { Timeout = 5000 };
57 | _client.Connect(address);
58 |
59 | ResultReadDeviceState result = await _client.ReadStateAsync(CancellationToken.None);
60 | logger.LogInformation($"Target system '{address}' is in state '{result.State.AdsState}'");
61 |
62 | // Execute the Work handler!
63 | await OnExecuteAsync(cancel);
64 | }
65 |
66 | protected abstract Task OnExecuteAsync(CancellationToken cancellationToken);
67 | }
68 | }
--------------------------------------------------------------------------------
/Sources/RouterSamples/AdsRouterAndClientConsoleApp/AdsRouterAndClientConsoleApp/Services/ClientService1.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.Logging;
2 | using System.Threading;
3 | using System.Threading.Tasks;
4 | using TwinCAT.Ads;
5 |
6 | namespace AdsRouterAndClientConsoleApp
7 | {
8 | internal class ClientService1 : AdsBaseService
9 | {
10 | public ClientService1(AmsAddress address, ILogger logger) : base(address, logger)
11 | {
12 | }
13 |
14 | protected override async Task OnExecuteAsync(CancellationToken cancel)
15 | {
16 | string symbolName = "TwinCAT_SystemInfoVarList._AppInfo.ProjectName";
17 | ResultAnyValue result = await _client!.ReadValueAsync(symbolName, typeof(string), cancel);
18 |
19 | if (result.Succeeded)
20 | logger.LogInformation($"ProjectName of target '{address}' is: '{result.Value}'");
21 | else
22 | logger.LogError($"Cannot get ProjectName from target '{address}'");
23 | }
24 | }
25 | }
--------------------------------------------------------------------------------
/Sources/RouterSamples/AdsRouterAndClientConsoleApp/AdsRouterAndClientConsoleApp/Services/ClientService2.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.Hosting;
2 | using Microsoft.Extensions.Logging;
3 | using System;
4 | using System.Threading;
5 | using System.Threading.Tasks;
6 | using TwinCAT.Ads;
7 |
8 | namespace AdsRouterAndClientConsoleApp
9 | {
10 | internal class ClientService2 : AdsBaseService
11 | {
12 | public ClientService2(AmsAddress address, ILogger logger) : base(address, logger)
13 | {
14 | }
15 |
16 | protected override async Task OnExecuteAsync(CancellationToken cancel)
17 | {
18 | string symbolName = "TwinCAT_SystemInfoVarList._AppInfo.ProjectName";
19 | ResultAnyValue result = await _client!.ReadValueAsync(symbolName, typeof(string), cancel);
20 |
21 | if (result.Succeeded)
22 | logger.LogInformation($"ProjectName of target '{address}' is: '{result.Value}'");
23 | else
24 | logger.LogError($"Cannot get ProjectName from target '{address}'");
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/Sources/RouterSamples/AdsRouterAndClientConsoleApp/AdsRouterAndClientConsoleApp/Services/RouterService.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.Configuration;
2 | using Microsoft.Extensions.Hosting;
3 | using Microsoft.Extensions.Logging;
4 | using System.Threading;
5 | using System.Threading.Tasks;
6 | using TwinCAT.Ads;
7 | using TwinCAT.Ads.TcpRouter;
8 |
9 | namespace AdsRouterAndClientConsoleApp
10 | {
11 | internal class RouterService : BackgroundService
12 | {
13 | private readonly ILoggerFactory _loggerFactory;
14 | private readonly ILogger _logger;
15 | private readonly IConfiguration _configuration;
16 |
17 | public RouterService(IConfiguration configuration, ILoggerFactory loggerFactory)
18 | {
19 | _loggerFactory = loggerFactory;
20 | _logger = loggerFactory.CreateLogger();
21 | _configuration = configuration;
22 | }
23 |
24 | protected override Task ExecuteAsync(CancellationToken stoppingToken)
25 | {
26 | var router = new AmsTcpIpRouter(_configuration,_loggerFactor);
27 | //_logger.LogInformation("Information!");
28 | //_logger.LogDebug("Debug!");
29 | //_logger.LogTrace("Trace!");
30 | //_logger.LogError("Error!");
31 |
32 | return router.StartAsync(stoppingToken);
33 | }
34 | }
35 | }
--------------------------------------------------------------------------------
/Sources/RouterSamples/AdsRouterAndClientConsoleApp/AdsRouterAndClientConsoleApp/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "AmsRouter": {
3 | "Name": "MyComputer",
4 | "NetId": "1.1.1.1.1.1",
5 | "TcpPort": 48898,
6 | "RemoteConnections": [
7 | {
8 | "Name": "RemoteSystem",
9 | "Address": "192.168.0.2",
10 | "NetId": "2.2.2.2.1.1",
11 | "Type": "TCP_IP"
12 | }
13 | ]
14 | },
15 | "Logging": {
16 | "LogLevel": {
17 | "Default": "Information",
18 | "System": "Information",
19 | "Microsoft": "Information"
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/Sources/RouterSamples/AdsRouterConsoleApp/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | // Use IntelliSense to find out which attributes exist for C# debugging
3 | // Use hover for the description of the existing attributes
4 | // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
5 | "version": "0.2.0",
6 | "configurations": [
7 | {
8 | "name": "C#: AdsRouterConsoleApp",
9 | "type": "dotnet",
10 | "request": "launch",
11 | "projectPath": "${workspaceFolder}/src/AdsRouterConsoleApp.csproj"
12 | },
13 | // Use this on WSL!
14 | {
15 | "name": "WSL Docker .NET Core Launch",
16 | "type": "docker",
17 | "request": "launch",
18 | "preLaunchTask": "docker-run: debug",
19 | "netCore": {
20 | "appProject": "${workspaceFolder}/src/AdsRouterConsoleApp.csproj"
21 | }
22 | }
23 | ]
24 | }
--------------------------------------------------------------------------------
/Sources/RouterSamples/AdsRouterConsoleApp/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "csharp.preview.improvedLaunchExperience": true
3 | }
--------------------------------------------------------------------------------
/Sources/RouterSamples/AdsRouterConsoleApp/AdsRouterConsoleApp.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.7.34031.279
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AdsRouterConsoleApp", "src\AdsRouterConsoleApp.csproj", "{8BBD5E02-0027-4638-8431-BE93BFB01C4D}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | TeamRelease|Any CPU = TeamRelease|Any CPU
13 | EndGlobalSection
14 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
15 | {8BBD5E02-0027-4638-8431-BE93BFB01C4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
16 | {8BBD5E02-0027-4638-8431-BE93BFB01C4D}.Debug|Any CPU.Build.0 = Debug|Any CPU
17 | {8BBD5E02-0027-4638-8431-BE93BFB01C4D}.Release|Any CPU.ActiveCfg = Release|Any CPU
18 | {8BBD5E02-0027-4638-8431-BE93BFB01C4D}.Release|Any CPU.Build.0 = Release|Any CPU
19 | {8BBD5E02-0027-4638-8431-BE93BFB01C4D}.TeamRelease|Any CPU.ActiveCfg = TeamRelease|Any CPU
20 | {8BBD5E02-0027-4638-8431-BE93BFB01C4D}.TeamRelease|Any CPU.Build.0 = TeamRelease|Any CPU
21 | EndGlobalSection
22 | GlobalSection(SolutionProperties) = preSolution
23 | HideSolutionNode = FALSE
24 | EndGlobalSection
25 | GlobalSection(ExtensibilityGlobals) = postSolution
26 | SolutionGuid = {3DB6E660-311D-4B68-AE5F-D5750318800E}
27 | EndGlobalSection
28 | EndGlobal
29 |
--------------------------------------------------------------------------------
/Sources/RouterSamples/AdsRouterConsoleApp/Dockerfile:
--------------------------------------------------------------------------------
1 | #See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
2 |
3 | FROM mcr.microsoft.com/dotnet/runtime:8.0 AS base
4 | WORKDIR /app
5 |
6 | FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
7 | WORKDIR /src
8 | COPY src/*.csproj .
9 | RUN dotnet restore
10 | COPY src/. .
11 | RUN dotnet build -c Release -o /app/build --framework net8.0
12 |
13 | FROM build AS publish
14 | RUN dotnet publish -c Release -o /app/publish --framework net8.0
15 |
16 | FROM base AS final
17 | WORKDIR /app
18 | COPY --from=publish /app/publish .
19 |
20 | ENTRYPOINT ["dotnet", "AdsRouterConsoleApp.dll"]
--------------------------------------------------------------------------------
/Sources/RouterSamples/AdsRouterConsoleApp/src/AdsRouterConsoleApp.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | Exe
4 | net8.0
5 | Simple TCP/IP ADS Router Console Application for use on systems without TwinCAT installation / setup.
6 | TCP/IP ADS Router Console Application
7 | true
8 | TwinCAT.Ads.AdsRouterService.Program
9 | true
10 | portable
11 | latest
12 | PackageReference
13 | enable
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | PreserveNewest
30 | Always
31 | true
32 |
33 |
34 |
--------------------------------------------------------------------------------
/Sources/RouterSamples/AdsRouterConsoleApp/src/Program.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.Configuration;
2 | using Microsoft.Extensions.DependencyInjection;
3 | using Microsoft.Extensions.Hosting;
4 | using Microsoft.Extensions.Logging;
5 | using System;
6 | using System.Threading;
7 | using TwinCAT.Ads.Logging;
8 | using TwinCAT.Ads.TcpRouter;
9 |
10 | namespace TwinCAT.Ads.AdsRouterService
11 | {
12 | #region CODE_SAMPLE_ROUTERCONSOLE
13 |
14 | class Program
15 | {
16 | ///
17 | /// Defines the entry point of the application.
18 | ///
19 | /// The arguments.
20 | public static void Main(string[] args)
21 | {
22 | try
23 | {
24 | CreateHostBuilder(args).Build().Run();
25 | }
26 | catch (OperationCanceledException /*cex*/)
27 | {
28 | Console.WriteLine("Router cancelled!");
29 | }
30 | catch (Exception ex)
31 | {
32 | Console.WriteLine($"Router failed with '{ex.Message}'");
33 | }
34 | }
35 |
36 | ///
37 | /// Creates the host builder.
38 | ///
39 | /// The arguments.
40 | /// IHostBuilder.
41 | public static IHostBuilder CreateHostBuilder(string[] args)
42 | {
43 | var ret = Host.CreateDefaultBuilder(args);
44 |
45 | ret.ConfigureServices((hostContext, services) =>
46 | {
47 | services.AddHostedService();
48 | })
49 | .ConfigureAppConfiguration((hostingContext, config) =>
50 | {
51 | // Add further AppConfigurationProvider here.
52 | //config.Sources.Clear(); // Clear all default config sources
53 | config.AddEnvironmentVariables("ENV_"); // Use Environment variables
54 | //config.AddCommandLine(args); // Use Command Line
55 | //config.AddJsonFile("appSettings.json"); // Use Appsettings
56 | //config.AddStaticRoutesXmlConfiguration(); // Overriding settings with StaticRoutes.Xml
57 | })
58 | .ConfigureLogging((context, logging) =>
59 | {
60 | //var loggerConfig = AdsLoggerConfiguration.CreateFromEnvironment();
61 | var loggerConfig = AdsLoggerConfiguration.CreateFromConfiguration(context.Configuration);
62 |
63 | logging.SetMinimumLevel(LogLevel.Debug);
64 | logging.ClearProviders();
65 |
66 | // Using simplified logging instead of standard console logging.
67 | logging.AddProvider(new AdsLoggerProvider(() => loggerConfig));
68 | // Adding Standard console logging here.
69 | //logging.AddConsole();
70 | });
71 | return ret;
72 | }
73 | }
74 | #endregion
75 | }
76 |
--------------------------------------------------------------------------------
/Sources/RouterSamples/AdsRouterConsoleApp/src/appSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "AmsRouter": {
3 | "Name": "LocalSystem",
4 | "NetId": "1.1.1.1.1.1",
5 | "TcpPort": 48898,
6 | "RemoteConnections": [
7 | {
8 | "Name": "RemoteSystem",
9 | "Address": "192.168.0.2",
10 | "NetId": "2.2.2.2.1.1",
11 | "Type": "TCP_IP"
12 | }
13 | ]
14 | },
15 | "Logging": {
16 | "LogLevel": {
17 | "Default": "Information",
18 | "System": "Information",
19 | "Microsoft": "Information"
20 | },
21 | "Console": {
22 | "IncludeScopes": true
23 | }
24 | }
25 | }
--------------------------------------------------------------------------------
/Sources/RouterSamples/AdsRouterConsoleApp/src/settings-bridged-network.env:
--------------------------------------------------------------------------------
1 | # Alternative settings via Environment Variables
2 | # using config.AddEnvironmentVariables("ENV_") in ConfigureAppConfiguration
3 |
4 | # Basic ADS-Router config which has to match StaticRoutes on TwinCAT-Host systems
5 | ENV_AmsRouter__Name=AdsRouterConsole
6 | ENV_AmsRouter__NetId=55.123.98.42.1.1
7 |
8 | # IP and TCP socket on which the ADS-Router should listen on for incoming client connections
9 | ENV_AmsRouter__LoopbackIP=172.17.0.2
10 | ENV_AmsRouter__LoopbackPort=48900
11 |
12 | # Setting to accept incoming ADS-Client connections from the private container subnetwork
13 | ENV_AmsRouter__LoopbackExternalSubnet=172.17.0.0/16
14 |
15 | # Indexed List of remote connections to TwinCAT Hosts
16 | # First TwinCAT-Host
17 | ENV_AmsRouter__RemoteConnections__0__Name=TwinCAT-Host
18 | ENV_AmsRouter__RemoteConnections__0__Address=192.168.178.72
19 | ENV_AmsRouter__RemoteConnections__0__NetId=5.29.122.232.1.1
20 |
21 | # Another sample TwinCAT-Host
22 | ENV_AmsRouter__RemoteConnections__1__Name=Another-TwinCAT-Host
23 | ENV_AmsRouter__RemoteConnections__1__Address=192.168.178.74
24 | ENV_AmsRouter__RemoteConnections__1__NetId=19.58.12.202.1.1
25 |
26 | # Verbose log output
27 | ENV_Logging__LogLevel__Default=Debug
--------------------------------------------------------------------------------
/Sources/RouterSamples/AdsRouterConsoleApp/src/settings-host-network.env:
--------------------------------------------------------------------------------
1 | # Alternative settings via Environment Variables
2 | # using config.AddEnvironmentVariables("ENV_") in ConfigureAppConfiguration
3 |
4 | # Basic ADS-Router config which has to match StaticRoutes on TwinCAT-Host systems
5 | ENV_AmsRouter__Name=AdsRouterConsoleApp
6 | ENV_AmsRouter__NetId=55.123.98.42.1.1
7 |
8 | # Indexed List of remote connections to TwinCAT Hosts
9 | # First TwinCAT-Host
10 | ENV_AmsRouter__RemoteConnections__0__Name=TwinCAT-Host
11 | ENV_AmsRouter__RemoteConnections__0__Address=192.168.178.72
12 | ENV_AmsRouter__RemoteConnections__0__NetId=5.29.122.232.1.1
13 |
14 | # Another sample TwinCAT-Host
15 | ENV_AmsRouter__RemoteConnections__1__Name=Another-TwinCAT-Host
16 | ENV_AmsRouter__RemoteConnections__1__Address=192.168.178.74
17 | ENV_AmsRouter__RemoteConnections__1__NetId=19.58.12.202.1.1
18 |
19 | # Verbose log output
20 | #ENV_Logging__LogLevel__Default=Debug
21 | ENV_Logging__LogLevel__Default=Information
--------------------------------------------------------------------------------
/Sources/RouterSamples/AdsRouterWpfApp/AdsRouterWpfApp.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net8.0-windows
6 | true
7 | TcpIpRouterWpf.App
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/Sources/RouterSamples/AdsRouterWpfApp/AdsRouterWpfApp.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.7.34031.279
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AdsRouterWpfApp", "AdsRouterWpfApp.csproj", "{D3D93320-12FB-414E-9ABC-1E3BEEA93676}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {D3D93320-12FB-414E-9ABC-1E3BEEA93676}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {D3D93320-12FB-414E-9ABC-1E3BEEA93676}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {D3D93320-12FB-414E-9ABC-1E3BEEA93676}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {D3D93320-12FB-414E-9ABC-1E3BEEA93676}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {B31829FE-023D-499F-AE23-C59CF802D51E}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/Sources/RouterSamples/AdsRouterWpfApp/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Sources/RouterSamples/AdsRouterWpfApp/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace TcpIpRouterWpf
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Sources/RouterSamples/AdsRouterWpfApp/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/Sources/RouterSamples/AdsRouterWpfApp/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/Sources/ServerSamples/AdsServerSample/AdsServerConsoleApp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Beckhoff/TF6000_ADS_DOTNET_V5_Samples/1622ecc67540352b385b200bda509dad9fcbc196/Sources/ServerSamples/AdsServerSample/AdsServerConsoleApp.png
--------------------------------------------------------------------------------
/Sources/ServerSamples/AdsServerSample/AdsServerConsoleApp/AdsServerConsoleApp.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | Exe
4 | AdsServerConsoleApp
5 | AdsServerConsoleApp
6 | net8.0
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/Sources/ServerSamples/AdsServerSample/AdsServerConsoleApp/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Sources/ServerSamples/AdsServerSample/AdsServerConsoleApp/NotificationRequestEntry.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using TwinCAT.Ads;
5 |
6 | namespace TestServer
7 | {
8 | internal class NotificationRequestEntry
9 | {
10 | private AmsAddress _rAddr; // the AmsNetId of the requestor
11 | private uint _indexGroup; // the requested index group
12 | private uint _indexOffset; // the requested index offset
13 | private int _cbLength; // the number of bytes to send
14 | //private AdsTransMode _transMode; // the transmission mode for this notification
15 | //private uint _maxDelay; // maximum delay until notification should be sent
16 | //private uint _cycleTime; // cycle time for checking changes
17 | NotificationSettings _settings;
18 |
19 | internal NotificationRequestEntry(AmsAddress rAddr,
20 | uint indexGroup,
21 | uint indexOffset,
22 | int cbLength,
23 | NotificationSettings settings)
24 | {
25 | _rAddr = rAddr;
26 | _indexGroup = indexGroup;
27 | _indexOffset = indexOffset;
28 | _cbLength = cbLength;
29 | //_transMode = transMode;
30 | //_maxDelay = maxDelay;
31 | //_cycleTime = cycleTime;
32 | _settings = settings;
33 | }
34 |
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/Sources/ServerSamples/AdsServerSample/AdsServerConsoleApp/Program.cs:
--------------------------------------------------------------------------------
1 | //extern alias tcpRouter;
2 |
3 | using Microsoft.Extensions.DependencyInjection;
4 | using Microsoft.Extensions.Hosting;
5 |
6 | namespace Sample.Ads.AdsServerCore
7 | {
8 |
9 | class Program
10 | {
11 | //static ILogger s_logger = null;
12 |
13 | public static void Main(string[] args)
14 | {
15 | CreateHostBuilder(args).Build().Run();
16 | }
17 |
18 | public static IHostBuilder CreateHostBuilder(string[] args) =>
19 | Host.CreateDefaultBuilder(args)
20 | .ConfigureServices((hostContext, services) =>
21 | {
22 | services.AddHostedService();
23 | });
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Sources/ServerSamples/AdsServerSample/AdsServerConsoleApp/Worker.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading;
5 | using System.Threading.Tasks;
6 | using Microsoft.Extensions.Hosting;
7 | using Microsoft.Extensions.Logging;
8 | using TestServer;
9 |
10 | namespace Sample.Ads.AdsServerCore
11 | {
12 | public class ServerWorker : BackgroundService
13 | {
14 | private readonly ILogger _logger;
15 |
16 | public ServerWorker(ILogger logger)
17 | {
18 | _logger = logger;
19 |
20 | }
21 |
22 | protected override async Task ExecuteAsync(CancellationToken cancel)
23 | {
24 | //ServerLogger logger = new ServerLogger(s_logger);
25 |
26 | // User Server Ports must be in between
27 | // AmsPortRange.CUSTOMER_FIRST (25000) <= PORT <= AmsPort.CUSTOMER_LAST (25999)
28 | // or
29 | // AmsPortRange.CUSTOMERPRIVATE_FIRST (26000) <= PORT <= AmsPort.CUSTOMERPRIVATE_LAST (26999)
30 | // to not conflict with Beckhoff prereserved servers!
31 | // see https://infosys.beckhoff.com/content/1033/tc3_ads.net/9408352011.html?id=1801810347107555608
32 |
33 | // This presumes that a TwinCAT Router is already running!
34 |
35 | AdsSampleServer server1 = new AdsSampleServer(26000, "TestAdsServer1", _logger);
36 | AdsSampleServer server2 = new AdsSampleServer(26001, "TestAdsServer2", _logger);
37 |
38 | Task[] serverTasks = new Task[2];
39 |
40 | serverTasks[0] = server1.ConnectServerAndWaitAsync(cancel);
41 | serverTasks[1] = server2.ConnectServerAndWaitAsync(cancel);
42 |
43 | Task shutdownTask = Task.Run(async () =>
44 | {
45 | await Task.WhenAll(serverTasks);
46 | _logger.LogInformation("All AdsServers closed down.!");
47 | });
48 |
49 | Console.WriteLine("Press enter to shutdown servers ...");
50 | Console.ReadLine();
51 |
52 | server1.Disconnect();
53 | server2.Disconnect();
54 |
55 | await shutdownTask; // Wait for Shutdown of both Servers
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/Sources/ServerSamples/AdsServerSample/AdsServerSample.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.31205.134
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AdsServerConsoleApp", "AdsServerConsoleApp\AdsServerConsoleApp.csproj", "{2BBCD625-0595-401C-8AD2-D6FFD963AA77}"
7 | EndProject
8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AdsServerTester", "AdsServerTester\AdsServerTester.csproj", "{C46DCFD0-845F-4AD5-A1FC-16F9DAC3DE6C}"
9 | EndProject
10 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{A4F715DC-76CD-480E-B185-2895DFAEBEFA}"
11 | ProjectSection(SolutionItems) = preProject
12 | AdsServerConsoleApp.png = AdsServerConsoleApp.png
13 | AdsServerTester.png = AdsServerTester.png
14 | ReadMe.md = ReadMe.md
15 | EndProjectSection
16 | EndProject
17 | Global
18 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
19 | Debug|Any CPU = Debug|Any CPU
20 | Release|Any CPU = Release|Any CPU
21 | TeamRelease|Any CPU = TeamRelease|Any CPU
22 | EndGlobalSection
23 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
24 | {2BBCD625-0595-401C-8AD2-D6FFD963AA77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
25 | {2BBCD625-0595-401C-8AD2-D6FFD963AA77}.Debug|Any CPU.Build.0 = Debug|Any CPU
26 | {2BBCD625-0595-401C-8AD2-D6FFD963AA77}.Release|Any CPU.ActiveCfg = Release|Any CPU
27 | {2BBCD625-0595-401C-8AD2-D6FFD963AA77}.Release|Any CPU.Build.0 = Release|Any CPU
28 | {2BBCD625-0595-401C-8AD2-D6FFD963AA77}.TeamRelease|Any CPU.ActiveCfg = Release|Any CPU
29 | {2BBCD625-0595-401C-8AD2-D6FFD963AA77}.TeamRelease|Any CPU.Build.0 = Release|Any CPU
30 | {C46DCFD0-845F-4AD5-A1FC-16F9DAC3DE6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
31 | {C46DCFD0-845F-4AD5-A1FC-16F9DAC3DE6C}.Debug|Any CPU.Build.0 = Debug|Any CPU
32 | {C46DCFD0-845F-4AD5-A1FC-16F9DAC3DE6C}.Release|Any CPU.ActiveCfg = Release|Any CPU
33 | {C46DCFD0-845F-4AD5-A1FC-16F9DAC3DE6C}.Release|Any CPU.Build.0 = Release|Any CPU
34 | {C46DCFD0-845F-4AD5-A1FC-16F9DAC3DE6C}.TeamRelease|Any CPU.ActiveCfg = Release|Any CPU
35 | {C46DCFD0-845F-4AD5-A1FC-16F9DAC3DE6C}.TeamRelease|Any CPU.Build.0 = Release|Any CPU
36 | EndGlobalSection
37 | GlobalSection(SolutionProperties) = preSolution
38 | HideSolutionNode = FALSE
39 | EndGlobalSection
40 | GlobalSection(ExtensibilityGlobals) = postSolution
41 | SolutionGuid = {16D657C9-038D-4BBA-A4C2-4A11FCA03BCA}
42 | EndGlobalSection
43 | EndGlobal
44 |
--------------------------------------------------------------------------------
/Sources/ServerSamples/AdsServerSample/AdsServerTester.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Beckhoff/TF6000_ADS_DOTNET_V5_Samples/1622ecc67540352b385b200bda509dad9fcbc196/Sources/ServerSamples/AdsServerSample/AdsServerTester.png
--------------------------------------------------------------------------------
/Sources/ServerSamples/AdsServerSample/AdsServerTester/AdsSampleServerTester.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 | text/microsoft-resx
50 |
51 |
52 | 2.0
53 |
54 |
55 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
56 |
57 |
58 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
59 |
60 |
--------------------------------------------------------------------------------
/Sources/ServerSamples/AdsServerSample/AdsServerTester/AdsServerTester.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | AdsServerTester
5 | AdsServerTester
6 | net8.0-windows
7 | true
8 | WinExe
9 | AdsSampleServerTester
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Sources/ServerSamples/AdsServerSample/AdsServerTester/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/Sources/ServerSamples/AdsSymbolicServerSample/AdsSymbolicServerSample.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | Exe
4 | net8.0
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Sources/ServerSamples/AdsSymbolicServerSample/AdsSymbolicServerSample.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.1.32228.430
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AdsSymbolicServerSample", "AdsSymbolicServerSample.csproj", "{4CEBDD6E-680A-44ED-B17F-62E5CB4D9773}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | TeamRelease|Any CPU = TeamRelease|Any CPU
13 | EndGlobalSection
14 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
15 | {4CEBDD6E-680A-44ED-B17F-62E5CB4D9773}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
16 | {4CEBDD6E-680A-44ED-B17F-62E5CB4D9773}.Debug|Any CPU.Build.0 = Debug|Any CPU
17 | {4CEBDD6E-680A-44ED-B17F-62E5CB4D9773}.Release|Any CPU.ActiveCfg = Release|Any CPU
18 | {4CEBDD6E-680A-44ED-B17F-62E5CB4D9773}.Release|Any CPU.Build.0 = Release|Any CPU
19 | {4CEBDD6E-680A-44ED-B17F-62E5CB4D9773}.TeamRelease|Any CPU.ActiveCfg = Release|Any CPU
20 | {4CEBDD6E-680A-44ED-B17F-62E5CB4D9773}.TeamRelease|Any CPU.Build.0 = Release|Any CPU
21 | EndGlobalSection
22 | GlobalSection(SolutionProperties) = preSolution
23 | HideSolutionNode = FALSE
24 | EndGlobalSection
25 | GlobalSection(ExtensibilityGlobals) = postSolution
26 | SolutionGuid = {6EDBCDA3-4CF4-4860-9E54-E72AD010BAF6}
27 | EndGlobalSection
28 | EndGlobal
29 |
--------------------------------------------------------------------------------
/Sources/ServerSamples/AdsSymbolicServerSample/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "AdsSymbolicServerSample": {
4 | "commandName": "Project"
5 | },
6 | "Container (Dockerfile)": {
7 | "commandName": "Docker"
8 | }
9 | }
10 | }
--------------------------------------------------------------------------------