├── test
├── PlcInterface.Ads.PLC
│ ├── PLC_Main
│ │ ├── PLC_Main.noprjfile
│ │ ├── DUTs
│ │ │ ├── TestEnum.TcDUT
│ │ │ ├── SymbolTest.TcDUT
│ │ │ ├── DUT_TestStruct2.TcDUT
│ │ │ ├── WriteTest.TcDUT
│ │ │ ├── MonitorTestData.TcDUT
│ │ │ ├── ReadTest.TcDUT
│ │ │ ├── MonitorTest.TcDUT
│ │ │ ├── DUT_TestStruct.TcDUT
│ │ │ └── ReadTestData.TcDUT
│ │ ├── GVLs
│ │ │ ├── AdsNet9.TcGVL
│ │ │ ├── AdsNet8.TcGVL
│ │ │ ├── OpcNet9.TcGVL
│ │ │ └── OpcNet8.TcGVL
│ │ ├── PlcTask.TcTTO
│ │ └── POUs
│ │ │ └── MAIN.TcPOU
│ └── PlcInterface.Ads.PLC.tsproj
├── PlcInterface.Ads.IntegrationTests
│ ├── Assembly.cs
│ ├── DummyTest.cs
│ ├── Settings.cs
│ ├── PlcInterface.Ads.IntegrationTests.csproj
│ ├── MonitorTest.cs
│ ├── WriteValueTest.cs
│ ├── ReadValueTest.cs
│ ├── SymbolHandlerTest.cs
│ └── PlcConnectionTest.cs
├── PlcInterface.Opc.IntegrationTests
│ ├── Assembly.cs
│ ├── DummyTest.cs
│ ├── Settings.cs
│ ├── PlcInterface.Opc.IntegrationTests.csproj
│ ├── MonitorTest.cs
│ ├── ReadValueTest.cs
│ ├── WriteValueTest.cs
│ ├── SymbolHandlerTest.cs
│ └── PlcConnectionTest.cs
├── PlcInterface.Ads.Tests
│ ├── Assembly.cs
│ ├── PlcInterface.Ads.Tests.csproj
│ ├── IValueSymbolExtensionsTests.cs
│ ├── ISymbolInfoExtensionTests.cs
│ └── TcAdsClientExtensionTests.cs
├── PlcInterface.OpcUa.Tests
│ ├── Assembly.cs
│ ├── PlcInterface.OpcUa.Tests.csproj
│ ├── ISymbolInfoExtensionTests.cs
│ └── SymbolHandlerTests.cs
├── PlcInterface.Abstraction
│ ├── TypeConverterMock.cs
│ ├── PlcInterface.Abstraction.Tests.csproj
│ ├── PropertySetterHelperTests.cs
│ ├── StructActivatorTests.cs
│ ├── MyTypeBuilder.cs
│ ├── ConnectedTests.cs
│ ├── ObjectActivatorTests.cs
│ └── IPlcConnectionExtensionTests.cs
├── PlcInterface.IntegrationTests
│ ├── DataTypes
│ │ ├── TestEnum.cs
│ │ ├── DUT_TestClass2.cs
│ │ └── DUT_TestStruct2.cs
│ ├── PlcInterface.IntegrationTests.csproj
│ ├── MultiAssert.cs
│ ├── Extension
│ │ └── MethodInfoExtensions.cs
│ └── IPlcConnectionTestBase.cs
├── PlcInterface.OpcUa.OpcServer
│ ├── OPCServer
│ │ ├── Alarms and Conditions
│ │ │ └── Alarms and Conditions.ac
│ │ ├── Historical Access
│ │ │ └── Historical Access.opcuaha
│ │ ├── Resources
│ │ │ └── English (United States).reslang
│ │ ├── Data Access
│ │ │ └── Data Access.opcuada
│ │ └── Security Access
│ │ │ └── Security Access.sec
│ ├── OPCServer.tcopcuasrv
│ └── PlcInterface.OpcUa.OpcServer.tcconnproj
├── TestUtilities
│ ├── TestUtilities.csproj
│ ├── MockDelegates.cs
│ └── MockHelpers..cs
├── PlcInterface.Common.Tests
│ ├── PlcInterface.Common.Tests.csproj
│ ├── IServiceCollectionExtensionTests.cs
│ ├── TaskExtensionsTests.cs
│ ├── IObservableExtensionsTests.cs
│ └── IndicesHelperTests.cs
├── Directory.Build.props
└── testconfig.json
├── global.json
├── src
├── PlcInterface.Ads
│ ├── IAdsMonitor.cs
│ ├── IAdsReadWrite.cs
│ ├── IAdsPlcConnection.cs
│ ├── ISymbolLoaderFactory.cs
│ ├── TwincatAbstractions
│ │ ├── ISumSymbolRead.cs
│ │ ├── ISumSymbolWrite.cs
│ │ ├── SymbolLoaderFactoryAbstraction.cs
│ │ ├── SumSymbolFactory.cs
│ │ ├── SumSymbolWriteAbstraction.cs
│ │ ├── SumSymbolReadAbstraction.cs
│ │ └── ISumSymbolFactory.cs
│ ├── MonitorResult.cs
│ ├── DefaultAdsPlcConnectionConfigureOptions.cs
│ ├── DefaultAdsSymbolHandlerSettingsConfigureOptions.cs
│ ├── IAdsSymbolInfo.cs
│ ├── AdsSymbolHandlerOptions.cs
│ ├── ISymbolInfoExtension.cs
│ ├── IValueSymbolExtensions.cs
│ ├── IAdsTypeConverter.cs
│ ├── IAdsSymbolHandler.cs
│ ├── SymbolHandler.Logging.cs
│ ├── AdsPlcConnectionOptions.cs
│ ├── Monitor.Logging.cs
│ ├── TcAdsClientExtension.cs
│ ├── PlcInterface.Ads.csproj
│ ├── IServiceCollectionExtension.cs
│ ├── ObjectExtension.cs
│ ├── SymbolInfo.cs
│ ├── DisposableMonitorItem.cs
│ └── AdsTypeConverter.cs
├── PlcInterface.OpcUa
│ ├── IOpcMonitor.cs
│ ├── IOpcReadWrite.cs
│ ├── IOpcPlcConnection.cs
│ ├── OpcSymbolHandlerOptions.cs
│ ├── TreeBrowser.Logging.cs
│ ├── DefaultOpcSymbolHandlerSettingsConfigureOptions.cs
│ ├── MonitorResult.cs
│ ├── ISymbolInfoExtension.cs
│ ├── IOpcSymbolHandler.cs
│ ├── SymbolHandler.Logging.cs
│ ├── Monitor.Logging.cs
│ ├── ICollectionExtensions.cs
│ ├── PlcInterface.OpcUa.csproj
│ ├── IServiceCollectionExtension.cs
│ ├── IOpcSymbolInfo.cs
│ ├── OpcPlcConnectionOptions.cs
│ ├── NodeInfo.cs
│ ├── IOpcTypeConverter.cs
│ └── DefaultOpcPlcConnectionConfigureOptions.cs
├── PlcInterface.Abstraction
│ ├── SymbolException.cs
│ ├── IMonitorResult.cs
│ ├── IArrayWrapper.cs
│ ├── PlcInterface.Abstraction.csproj
│ ├── ArrayWrapperExtensions.cs
│ ├── ITypeConverter.cs
│ ├── IConnected.cs
│ ├── Connected.cs
│ ├── ITypeActivator.cs
│ ├── Connected{T}.cs
│ ├── ISymbolHandler.cs
│ ├── ISymbolInfo.cs
│ ├── IMonitor.cs
│ ├── IPlcConnection.cs
│ ├── PropertySetterHelper.cs
│ ├── StructActivator.cs
│ ├── IReadWriteExtension.cs
│ └── IPlcConnectionExtension.cs
├── PlcInterface.Sandbox
│ ├── Properties
│ │ └── PublishProfiles
│ │ │ └── FolderProfile.pubxml
│ ├── PLCCommands
│ │ ├── AdsPlcDisconnectCommand.cs
│ │ ├── PlcConnectCommand.cs
│ │ ├── PlcDisconnectCommand.cs
│ │ ├── PlcToggleCommand.cs
│ │ ├── PlcStopMonitorCommand.cs
│ │ ├── PlcSymbolDumpCommand.cs
│ │ ├── AdsPlcConnectCommand.cs
│ │ ├── PlcMonitorCommand.cs
│ │ ├── PlcWriteCommand.cs
│ │ └── AdsWriteCommand.cs
│ ├── PlcInterface.Sandbox.csproj
│ ├── appsettings.json
│ └── nlog.config
└── Common
│ ├── ThrowHelper.cs
│ ├── IObservableExtensions.cs
│ ├── IServiceCollectionExtension.cs
│ ├── TaskExtensions.cs
│ ├── ISymbolInfoExtension.cs
│ └── IndicesHelper.cs
├── .github
├── release.yml
├── workflows
│ ├── DependabotAutoMerge.yml
│ └── BuildTestDeploy.yml
└── dependabot.yml
├── version.json
├── PlcInterface.CI.slnf
├── LICENSE.txt
├── README.md
├── PlcInterface.slnx
└── .gitattributes
/test/PlcInterface.Ads.PLC/PLC_Main/PLC_Main.noprjfile:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/global.json:
--------------------------------------------------------------------------------
1 | {
2 | "msbuild-sdks": {
3 | "MSTest.Sdk": "3.8.3"
4 | }
5 | }
--------------------------------------------------------------------------------
/test/PlcInterface.Ads.IntegrationTests/Assembly.cs:
--------------------------------------------------------------------------------
1 | [assembly: TestCategory("Integration")]
2 |
--------------------------------------------------------------------------------
/test/PlcInterface.Opc.IntegrationTests/Assembly.cs:
--------------------------------------------------------------------------------
1 | [assembly: TestCategory("Integration")]
2 |
--------------------------------------------------------------------------------
/test/PlcInterface.Ads.Tests/Assembly.cs:
--------------------------------------------------------------------------------
1 | [assembly: Parallelize(Workers = 0, Scope = ExecutionScope.MethodLevel)]
2 | [assembly: TestCategory("Unit")]
3 |
--------------------------------------------------------------------------------
/test/PlcInterface.OpcUa.Tests/Assembly.cs:
--------------------------------------------------------------------------------
1 | [assembly: Parallelize(Workers = 0, Scope = ExecutionScope.MethodLevel)]
2 | [assembly: TestCategory("Unit")]
3 |
--------------------------------------------------------------------------------
/test/PlcInterface.Abstraction/TypeConverterMock.cs:
--------------------------------------------------------------------------------
1 | namespace PlcInterface.Abstraction.Tests;
2 |
3 | internal sealed class TypeConverterMock : TypeConverter
4 | {
5 | }
6 |
--------------------------------------------------------------------------------
/test/PlcInterface.IntegrationTests/DataTypes/TestEnum.cs:
--------------------------------------------------------------------------------
1 | namespace PlcInterface.IntegrationTests.DataTypes;
2 |
3 | internal enum TestEnum
4 | {
5 | First = 0,
6 | Second = 1,
7 | Third = 2,
8 | }
9 |
--------------------------------------------------------------------------------
/src/PlcInterface.Ads/IAdsMonitor.cs:
--------------------------------------------------------------------------------
1 | namespace PlcInterface.Ads;
2 |
3 | ///
4 | /// The Ads implementation of a .
5 | ///
6 | public interface IAdsMonitor : IMonitor
7 | {
8 | }
9 |
--------------------------------------------------------------------------------
/src/PlcInterface.Ads/IAdsReadWrite.cs:
--------------------------------------------------------------------------------
1 | namespace PlcInterface.Ads;
2 |
3 | ///
4 | /// The Ads implementation of a .
5 | ///
6 | public interface IAdsReadWrite : IReadWrite
7 | {
8 | }
9 |
--------------------------------------------------------------------------------
/src/PlcInterface.OpcUa/IOpcMonitor.cs:
--------------------------------------------------------------------------------
1 | namespace PlcInterface.OpcUa;
2 |
3 | ///
4 | /// The Opc implementation of a .
5 | ///
6 | public interface IOpcMonitor : IMonitor
7 | {
8 | }
9 |
--------------------------------------------------------------------------------
/src/PlcInterface.OpcUa/IOpcReadWrite.cs:
--------------------------------------------------------------------------------
1 | namespace PlcInterface.OpcUa;
2 |
3 | ///
4 | /// The Ads implementation of a .
5 | ///
6 | public interface IOpcReadWrite : IReadWrite
7 | {
8 | }
9 |
--------------------------------------------------------------------------------
/test/PlcInterface.OpcUa.OpcServer/OPCServer/Alarms and Conditions/Alarms and Conditions.ac:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/.github/release.yml:
--------------------------------------------------------------------------------
1 | changelog:
2 | categories:
3 | - title: 🏕 Features
4 | labels:
5 | - '*'
6 | exclude:
7 | labels:
8 | - dependencies
9 | - title: 👒 Dependencies
10 | labels:
11 | - dependencies
12 |
--------------------------------------------------------------------------------
/src/PlcInterface.Ads/IAdsPlcConnection.cs:
--------------------------------------------------------------------------------
1 | using TwinCAT.Ads;
2 |
3 | namespace PlcInterface.Ads;
4 |
5 | ///
6 | /// The Ads implementation of a .
7 | ///
8 | public interface IAdsPlcConnection : IPlcConnection
9 | {
10 | }
11 |
--------------------------------------------------------------------------------
/src/PlcInterface.OpcUa/IOpcPlcConnection.cs:
--------------------------------------------------------------------------------
1 | using Opc.Ua.Client;
2 |
3 | namespace PlcInterface.OpcUa;
4 |
5 | ///
6 | /// The Opc implementation of a .
7 | ///
8 | public interface IOpcPlcConnection : IPlcConnection
9 | {
10 | }
11 |
--------------------------------------------------------------------------------
/test/PlcInterface.OpcUa.OpcServer/OPCServer/Historical Access/Historical Access.opcuaha:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/test/PlcInterface.Abstraction/PlcInterface.Abstraction.Tests.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/test/PlcInterface.Ads.IntegrationTests/DummyTest.cs:
--------------------------------------------------------------------------------
1 | namespace PlcInterface.Ads.IntegrationTests;
2 |
3 | [TestClass]
4 | public class DummyTest
5 | {
6 | [TestMethod]
7 | [Description("This is an always passing test to make sure at least 1 test succeed")]
8 | public void FilterBypassTest() => Thread.Sleep(100);
9 | }
10 |
--------------------------------------------------------------------------------
/test/PlcInterface.Opc.IntegrationTests/DummyTest.cs:
--------------------------------------------------------------------------------
1 | namespace PlcInterface.OPC.IntegrationTests;
2 |
3 | [TestClass]
4 | public class DummyTest
5 | {
6 | [TestMethod]
7 | [Description("This is an always passing test to make sure at least 1 test succeed")]
8 | public void FilterBypassTest() => Thread.Sleep(100);
9 | }
10 |
--------------------------------------------------------------------------------
/version.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
3 | "version": "2.7",
4 | "publicReleaseRefSpec": [
5 | "^refs/tags/v\\d+\\.\\d+"
6 | ],
7 | "release": {
8 | "tagName": "v{version}"
9 | },
10 | "inherit": false
11 | }
12 |
--------------------------------------------------------------------------------
/test/PlcInterface.OpcUa.OpcServer/OPCServer/Resources/English (United States).reslang:
--------------------------------------------------------------------------------
1 |
2 |
3 | defaultMessage in: English (United States) - requested id was not found
4 |
--------------------------------------------------------------------------------
/test/TestUtilities/TestUtilities.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | false
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/src/PlcInterface.Abstraction/SymbolException.cs:
--------------------------------------------------------------------------------
1 | namespace PlcInterface;
2 |
3 | ///
4 | /// Represents error that occur during symbol handling.
5 | ///
6 | ///
7 | /// Initializes a new instance of the class.
8 | ///
9 | /// The message that describes the error.
10 | public sealed class SymbolException(string message) : Exception(message);
11 |
--------------------------------------------------------------------------------
/test/PlcInterface.Ads.IntegrationTests/Settings.cs:
--------------------------------------------------------------------------------
1 | using System.Globalization;
2 |
3 | namespace PlcInterface.Ads.IntegrationTests;
4 |
5 | internal static class Settings
6 | {
7 | public static string AmsNetId
8 | => "172.99.0.2.1.1";
9 |
10 | public static int Port
11 | => 851;
12 |
13 | public static string RootVariable
14 | => $"AdsNet{Environment.Version.Major.ToString(CultureInfo.InvariantCulture)}";
15 | }
16 |
--------------------------------------------------------------------------------
/test/PlcInterface.Opc.IntegrationTests/Settings.cs:
--------------------------------------------------------------------------------
1 | using System.Globalization;
2 |
3 | namespace PlcInterface.Opc.IntegrationTests;
4 |
5 | internal static class Settings
6 | {
7 | public static string OpcIp
8 | => "172.30.70.5";
9 |
10 | public static int OpcPort
11 | => 4840;
12 |
13 | public static string RootVariable
14 | => $"PLC1.OpcNet{Environment.Version.Major.ToString(CultureInfo.InvariantCulture)}";
15 | }
16 |
--------------------------------------------------------------------------------
/test/PlcInterface.Ads.PLC/PLC_Main/DUTs/TestEnum.TcDUT:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
14 |
15 |
--------------------------------------------------------------------------------
/src/PlcInterface.OpcUa/OpcSymbolHandlerOptions.cs:
--------------------------------------------------------------------------------
1 | namespace PlcInterface.OpcUa;
2 |
3 | ///
4 | /// Settings for the .
5 | ///
6 | public class OpcSymbolHandlerOptions
7 | {
8 | ///
9 | /// Gets or sets the path to the root node.
10 | ///
11 | ///
12 | /// Sub items are separated by a '.'.
13 | ///
14 | public string RootVariable { get; set; } = string.Empty;
15 | }
16 |
--------------------------------------------------------------------------------
/test/PlcInterface.Ads.PLC/PLC_Main/GVLs/AdsNet9.TcGVL:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
12 |
13 |
--------------------------------------------------------------------------------
/test/PlcInterface.Ads.PLC/PLC_Main/DUTs/SymbolTest.TcDUT:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
12 |
13 |
--------------------------------------------------------------------------------
/src/PlcInterface.OpcUa/TreeBrowser.Logging.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.Logging;
2 |
3 | namespace PlcInterface.OpcUa;
4 |
5 | ///
6 | /// Logging source generator methods.
7 | ///
8 | internal partial class TreeBrowser
9 | {
10 | [LoggerMessage(EventId = 100, Level = LogLevel.Warning, Message = "Failed to browse symbols (Error: {StatusCode}), changing chunk size {OldSize} -> {NewSize}")]
11 | private partial void LogBrowseFailed(uint statusCode, int oldSize, int newSize);
12 | }
13 |
--------------------------------------------------------------------------------
/test/PlcInterface.OpcUa.Tests/PlcInterface.OpcUa.Tests.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/test/PlcInterface.Ads.PLC/PLC_Main/GVLs/AdsNet8.TcGVL:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
12 |
13 |
--------------------------------------------------------------------------------
/src/PlcInterface.Ads/ISymbolLoaderFactory.cs:
--------------------------------------------------------------------------------
1 | using TwinCAT;
2 | using TwinCAT.Ads.TypeSystem;
3 | using TwinCAT.TypeSystem;
4 |
5 | namespace PlcInterface.Ads;
6 |
7 | ///
8 | /// An abstraction layer over the static class .
9 | ///
10 | public interface ISymbolLoaderFactory
11 | {
12 | ///
13 | public ISymbolLoader Create(IConnection connection, ISymbolLoaderSettings settings);
14 | }
15 |
--------------------------------------------------------------------------------
/src/PlcInterface.Ads/TwincatAbstractions/ISumSymbolRead.cs:
--------------------------------------------------------------------------------
1 | using TwinCAT.Ads.SumCommand;
2 |
3 | namespace PlcInterface.Ads.TwinCATAbstractions;
4 |
5 | ///
6 | /// A Abstraction layer over .
7 | ///
8 | public interface ISumSymbolRead
9 | {
10 | ///
11 | public object[] Read();
12 |
13 | ///
14 | public Task