AACommPy

Python wrapper for the Agito AAComm .NET communication library. Provides full access to AAComm's motion controller API with IDE IntelliSense support.

Requirements

  • Python >= 3.10
  • Windows (Linux support planned)
  • .NET Framework 4.8 and/or .NET 6.0/8.0 runtime

Installation

pip install aacommpy

The AAComm NuGet package is downloaded automatically on first import.

To install a specific AAComm version manually:

aacommpy install --version 11.1.0

Quick Start

from aacommpy import CommAPI, Services, Shared, AACOMM_SERVER_EXE_PATH

# Start server
CommAPI.StartAACommServer(AACOMM_SERVER_EXE_PATH)

# Configure connection
api = CommAPI()
cData = Services.ConnectionData()
cData.ControllerType = Shared.ProductTypes.AGM800_ID
cData.CommChannelType = Shared.ChannelType.Ethernet
cData.ET_IP_1 = 172
cData.ET_IP_2 = 1
cData.ET_IP_3 = 1
cData.ET_IP_4 = 101
cData.ET_Port = 50000

# Connect
result = api.Connect(cData)
print(f"Connected: {api.IsConnected}")

# Communicate
msg = Services.AACommMessage()
msg.MessageStr = "ASpeed"
reply = api.SendReceive(msg)
print(f"Speed: {reply.ReplyStr}")

# Disconnect
api.Disconnect()
api.CloseAACommServer(False)

.NET Framework Selection

AAComm supports multiple .NET targets. Switch with:

aacommpy dotnetfw --netfw net48    # .NET Framework 4.8 (default)
aacommpy dotnetfw --netfw net6.0   # .NET 6.0
aacommpy dotnetfw --netfw net8.0   # .NET 8.0

The runtime (netfx or coreclr) is configured automatically based on your selection.

Check installed .NET versions:

aacommpy dotnetfw --check

CLI Commands

Command Description
aacommpy install [--version X.Y.Z] Download and install AAComm NuGet package
aacommpy version Show installed AAComm version
aacommpy update Update to latest AAComm version
aacommpy dotnetfw --netfw {net48,net6.0,net8.0} Switch .NET target framework
aacommpy dotnetfw --check List installed .NET runtimes

IntelliSense

AACommPy ships with type stubs (.pyi) for full IDE autocomplete and type checking. Supported in VS Code (Pylance), Visual Studio, and PyCharm.

To regenerate stubs after updating AAComm:

python generate_stubs.py

API Reference

The package exposes these AAComm namespaces:

Import Contents
CommAPI Main communication API (connect, send, receive, disconnect)
CommAPIWrapper Singleton wrapper for single-client usage
Services ConnectionData, AACommMessage, AllStatInterpreter, ControllerMessagesContainer, ...
Shared ChannelType, ProductTypes, ConnectResult, MessageType, ...
Extensions AACommDownloadFW, AACommDownloadUP, AACommDownloadFPGA, data recording, ...

All types are .NET objects accessed via pythonnet. See the AAComm documentation for full API details.