AAComm

AAComm is a C# .NET API for PC-to-Controller communications, supporting a wide range of .NET targets and Windows platforms.

Overview

AAComm provides a robust interface for communicating with motion controllers from .NET applications. It is designed for both high-level and low-level control, supporting multiple communication channels and controller types.

  • Supported platforms: Windows 7 or later
  • Supported frameworks: .NET Framework 4.8, .NET 8.0
  • Required files: AAComm.dll, AACommServer.exe, AACommServerAPI.dll
  • Documentation: API documentation is available via IntelliSense (XML doc comments included with the package).

System Requirements

  • Microsoft Windows 7 or later
  • .NET Framework 4.8 or .NET 8.0
  • Visual Studio 2019 or later (other IDEs may be used, but are not officially supported)

Installation

Install the NuGet package from nuget.org: .dotnet add package Agito.AAComm Or via the NuGet Package Manager in Visual Studio.

Note:
AACommServer.exe and AACommServerAPI.dll are automatically copied to your output directory when using the NuGet package. For manual referencing, copy these files explicitly.

Getting Started

  1. Create a new C# project.
  2. Add the Agito.AAComm NuGet package.
  3. For Windows: Ensure AACommServer.exe and AACommServerAPI.dll are in your output directory, or specify the executable path when calling AAComm.StartAACommServer().
  4. For non-Windows: Specify the full path to the AACommServer executable when starting the server.

Usage Example

Below is a minimal example demonstrating how to start the AAComm server, connect to a controller, and send/receive messages:

using AAComm;
using AAComm.Services;
using AAComm.Shared;

string aacs = CommAPI.StartAACommServer();
Console.WriteLine($"AACommServer started: {(string.IsNullOrEmpty(aacs) ? "OK" : aacs)}");

var api = new CommAPI();
var cd = new ConnectionData
{
    ControllerType = ProductTypes.AGD200_AGC300_ID,
    CommChannelType = ChannelType.Ethernet,
    Rs232_PortName = "COM7",
};

var res = api.Connect(cd);
Console.WriteLine($"Connect Result: {res}");

if (res != ConnectResult.Success)
{
    res = api.Connect(cd, true);
    Console.WriteLine($"FORCE Connect Result: {res}");

    if (res != ConnectResult.Success)
    {
        OnExit();
        return;
    }
}

var msgRes = api.SendReceive(new AACommMessage("APos"));
Console.WriteLine($"SYNC: APos = {msgRes.MsgReceived}");

api.Send(new AACommMessage(OnReceive, "APos"));
//wait for async response at OnReceive callback

OnExit();
api.Disconnect();

void OnExit()
{
    Console.WriteLine("press any key to exit");
    Console.ReadKey();
    api.CloseAACommServer();
}

void OnReceive(object? sender, AACommEventArgs e)
{
    Console.WriteLine($"ASYNC: APos = {e.MsgReceived}");
}

API Documentation

API documentation is available via IntelliSense. XML doc comments are included with the NuGet package.

Release Notes

See CHANGELOG.md for detailed release notes and version history.

License

This software is licensed under the MIT License. See the NuGet package metadata for details.


For further information, consult the included documentation or contact Agito support.