Beckhoff.TwinCAT.Ads.Server 5.0.0-preview6

The Beckhoff.TwinCAT.AdsServer Package can be used to implement your own ADS Server.

This is a prerelease version of Beckhoff.TwinCAT.Ads.Server.
Install-Package Beckhoff.TwinCAT.Ads.Server -Version 5.0.0-preview6
dotnet add package Beckhoff.TwinCAT.Ads.Server --version 5.0.0-preview6
<PackageReference Include="Beckhoff.TwinCAT.Ads.Server" Version="5.0.0-preview6" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Beckhoff.TwinCAT.Ads.Server --version 5.0.0-preview6
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Description

The package 'Beckhoff.TwinCAT.Ads.Server' contains the base framework to create your own ADS Server / virtual ADS Device.

Requirements

  • .NET Core 3.0, .NET Framework 4.61 or .NET Standard 2.0 compatible SDK or later
  • Latest TwinCAT 3.1.4024 Build
  • or alternatively for systems where a TwinCAT installation is not running the Nuget package 'Beckhoff.TwinCAT.Ads.AdsRouterConsole'.
    to route ADS communication.
  • Installed Nuget package manager (for systems without Visual Studio installation)

Installation

System with TwinCAT System Service (TCP Loopback enabled, Versions 4024.0 and 4025.5)
  1. Running TwinCAT 3.1.4024 Installation

  2. Stop TwinCAT System Service

  3. Enable TCP Loopback for TwinCAT 3.1.4024.0 or 3.1.4024.4 via regkey:
    32-Bit Windows Operating System:

     HKEY_LOCAL_MACHINE\SOFTWARE\Beckhoff\TwinCAT3\System\EnableAmsTcpLoopbackDWORD (1)
    

    64-Bit Windows Operating System:

     HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Beckhoff\TwinCAT3\System\EnableAmsTcpLoopback	DWORD(1)
    

    Systems >= 3.1.4024.5 support TCPLoopback out of the box. No registry changes necessary.

  4. Restart TwinCAT System Service

First Steps

Create your customized ADS Server by deriving the TwinCAT.Ads.Server.AdsServer class. Fill the virtual handlers with your own
code.

using Microsoft.Extensions.Logging;
using System;
using System.Buffers.Binary;
using System.Collections.Concurrent;
using System.Threading;
using System.Threading.Tasks;
using TwinCAT.Ads;
using TwinCAT.Ads.Server;

namespace TestServer
{
    /*
     * Extend the AdsServer class to implement your own ADS server.
     */
    public class AdsSampleServer : AdsServer
    {
        /// <summary>
        /// Fixed ADS Port (to be changed ...)
        /// </summary>
        const ushort ADS_PORT = 42;

        /// <summary>
        /// Fixed Name for the ADS Port (change this ...)
        /// </summary>
        const string ADS_PORT_NAME = "AdsSampleServer_Port42";


        /// <summary>
        /// Logger
        /// </summary>
        private ILogger _logger;

        /* Instantiate an ADS server with a fix ADS port assigned by the ADS router.
        */


        public AdsSampleServer(ILogger logger) : base(ADS_PORT, ADS_PORT_NAME)
        {
            _logger = logger;
        }

        // Override Functions to implement customized Server
        ....
    }
}

VersionHistory

5.0.0-preview6

5.0.0-preview5

Breaking Change: Removing the explicit .net core 2.0 platform support, .NET Standard 2.0 should be used instead.

5.0.0-preview4

5.0.0-preview3

Enh: Framework dependency changed Net48 --> Net461
Enh: Adding Framework target netcoreapp2.0
Enh: Optimizing Nuget Package dependencies
Fix: TcpHeader wrong Frame size (Int16 overflow) with frame size > 65535 (large data packets)
Breaking changes: AdsServer interfaces refactored, ReadLength parameters changed type uint --> int, Memory --> ReadOnlyMemory wherever possible.\

5.0.0-beta9

Enh: Referencing .NET Core 3.0 instead of .NET Core 2.2
Fix: Fixing Buffer Issue in AdsServer.AddDeviceNotificationRequest\

5.0.0-beta8

Fix: Fixed port AdsServer forgets port with Disconnect() and ConnectServer sequence (uses unfixed port).\

5.0.0-beta7

BreakingChange: TwinCAT.Ads.Server.TcAdsNotificationSample renamed to TwinCAT.Ads.Server.NotificationDataSample
BreakingChange: Refactoring AdsServer Interfaces. Optimizing Method parameters from byte[] + length to Memory<byte> to prevent multiple array copies (especially on NotificationHandling)
Doc: Documentation for creating a custom ADS Server with .NET Core\

5.0.0-beta6

Enh: AmsServerNet.DefaultRouterEndPoint can be used to separate Router and AmsServer on different systems (Docker, Virtualization)\

Description

The package 'Beckhoff.TwinCAT.Ads.Server' contains the base framework to create your own ADS Server / virtual ADS Device.

Requirements

  • .NET Core 3.0, .NET Framework 4.61 or .NET Standard 2.0 compatible SDK or later
  • Latest TwinCAT 3.1.4024 Build
  • or alternatively for systems where a TwinCAT installation is not running the Nuget package 'Beckhoff.TwinCAT.Ads.AdsRouterConsole'.
    to route ADS communication.
  • Installed Nuget package manager (for systems without Visual Studio installation)

Installation

System with TwinCAT System Service (TCP Loopback enabled, Versions 4024.0 and 4025.5)
  1. Running TwinCAT 3.1.4024 Installation

  2. Stop TwinCAT System Service

  3. Enable TCP Loopback for TwinCAT 3.1.4024.0 or 3.1.4024.4 via regkey:
    32-Bit Windows Operating System:

     HKEY_LOCAL_MACHINE\SOFTWARE\Beckhoff\TwinCAT3\System\EnableAmsTcpLoopbackDWORD (1)
    

    64-Bit Windows Operating System:

     HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Beckhoff\TwinCAT3\System\EnableAmsTcpLoopback	DWORD(1)
    

    Systems >= 3.1.4024.5 support TCPLoopback out of the box. No registry changes necessary.

  4. Restart TwinCAT System Service

First Steps

Create your customized ADS Server by deriving the TwinCAT.Ads.Server.AdsServer class. Fill the virtual handlers with your own
code.

using Microsoft.Extensions.Logging;
using System;
using System.Buffers.Binary;
using System.Collections.Concurrent;
using System.Threading;
using System.Threading.Tasks;
using TwinCAT.Ads;
using TwinCAT.Ads.Server;

namespace TestServer
{
    /*
     * Extend the AdsServer class to implement your own ADS server.
     */
    public class AdsSampleServer : AdsServer
    {
        /// <summary>
        /// Fixed ADS Port (to be changed ...)
        /// </summary>
        const ushort ADS_PORT = 42;

        /// <summary>
        /// Fixed Name for the ADS Port (change this ...)
        /// </summary>
        const string ADS_PORT_NAME = "AdsSampleServer_Port42";


        /// <summary>
        /// Logger
        /// </summary>
        private ILogger _logger;

        /* Instantiate an ADS server with a fix ADS port assigned by the ADS router.
        */


        public AdsSampleServer(ILogger logger) : base(ADS_PORT, ADS_PORT_NAME)
        {
            _logger = logger;
        }

        // Override Functions to implement customized Server
        ....
    }
}

VersionHistory

5.0.0-preview6

5.0.0-preview5

Breaking Change: Removing the explicit .net core 2.0 platform support, .NET Standard 2.0 should be used instead.

5.0.0-preview4

5.0.0-preview3

Enh: Framework dependency changed Net48 --> Net461
Enh: Adding Framework target netcoreapp2.0
Enh: Optimizing Nuget Package dependencies
Fix: TcpHeader wrong Frame size (Int16 overflow) with frame size > 65535 (large data packets)
Breaking changes: AdsServer interfaces refactored, ReadLength parameters changed type uint --> int, Memory --> ReadOnlyMemory wherever possible.\

5.0.0-beta9

Enh: Referencing .NET Core 3.0 instead of .NET Core 2.2
Fix: Fixing Buffer Issue in AdsServer.AddDeviceNotificationRequest\

5.0.0-beta8

Fix: Fixed port AdsServer forgets port with Disconnect() and ConnectServer sequence (uses unfixed port).\

5.0.0-beta7

BreakingChange: TwinCAT.Ads.Server.TcAdsNotificationSample renamed to TwinCAT.Ads.Server.NotificationDataSample
BreakingChange: Refactoring AdsServer Interfaces. Optimizing Method parameters from byte[] + length to Memory<byte> to prevent multiple array copies (especially on NotificationHandling)
Doc: Documentation for creating a custom ADS Server with .NET Core\

5.0.0-beta6

Enh: AmsServerNet.DefaultRouterEndPoint can be used to separate Router and AmsServer on different systems (Docker, Virtualization)\

Release Notes

Preview version of the Beckhoff.TwinCAT.Ads 5.0.0 Version branch. Don't use for productive code.

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
5.0.0-preview6 21 3/23/2020
5.0.0-preview5 107 3/6/2020
5.0.0-preview4 661 12/12/2019