TestSuite.mp4
A Windows Forms application for discovering, managing, and executing Beckhoff TwinCAT PLC test suites via the ADS (Automation Device Specification) protocol.
PlcTestSuite_UI provides a graphical interface to interact with PLC test suites created using the PlcTestSuite library. The application automatically discovers test suites across multiple TwinCAT PLC runtimes and displays their tests, execution status, and event history.
- Windows Operating System - Windows 10 or later
- .NET 8.0 Runtime - Download here
- TwinCAT XAE/XAR - TwinCAT 3 installation with ADS router running
- Visual Studio 2022 (for development) - Community edition or higher
The following packages are automatically restored during build:
Beckhoff.TwinCAT.Ads(v7.0.132) - TwinCAT ADS communicationMicrosoft.Extensions.Logging.Abstractions- Logging infrastructure- Additional TwinCAT and system dependencies
Your TwinCAT PLC project must use the PlcTestSuite library:
Note: PlcTestSuite v1.1.1 or greater is required.
- Install the PlcTestSuite library in your TwinCAT project
- Create test suites that implement the
Tc3_PlcTestSuite.I_TestSuiteinterface - Define tests within your test suite using the PlcTestSuite framework
- Ensure your PLC runtime is active on one of the supported ports (851-859)
- Download the latest release from the releases page
- Extract the ZIP file to a folder
- Run
PlcTestSuite_UI.exe
# Clone the repository
git clone <repository-url>
cd PlcTestSuite_UI
# Restore dependencies
dotnet restore PlcTestSuite_UI.csproj
# Build the project
dotnet build PlcTestSuite_UI.csproj --configuration Release
# Run the application
dotnet run --project PlcTestSuite_UI.csproj# Publish for Windows x64
dotnet publish PlcTestSuite_UI.csproj --configuration Release --runtime win-x64
# Publish for Windows x86
dotnet publish PlcTestSuite_UI.csproj --configuration Release --runtime win-x86
# The executable will be in: bin/Release/net8.0-windows/win-x64/publish/-
Launch the Application
- Start PlcTestSuite_UI.exe
- The application opens with a dark theme interface
-
Configure AMS Net-ID (Optional)
- By default, the application connects to the local TwinCAT runtime
- To connect to a remote PLC, enter the AMS Net-ID in the format:
192.168.1.84.1.1 - Leave as "local" for local TwinCAT runtime
-
Discover Test Suites
- Click the "π Refresh" button
- The application scans TwinCAT ports 851-859
- Discovered test suites appear in the "Available Test Suites" list
- Format:
ProjectName: TestSuiteInstancePath
-
View Tests
- Select a test suite from the list
- Tests are displayed in the main view with:
- Test Name - The identifier of the test
- Status - Current state (Init, Running, OK, Failed)
- Duration - Execution time in seconds
- Test suite statistics appear on the right:
- Total Tests
- Passed Tests
- Failed Tests
- Total Duration
-
Filter Tests
- Enter text in the "Filter tests..." box
- The test list updates in real-time to show matching tests
- Clear the filter to show all tests
-
View Event History
- The bottom panel displays event log entries from the TwinCAT Event Logger
- Shows timestamp, event type, source, and message
The application discovers test suites by:
- Connecting to each PLC runtime port (851-859)
- Loading the symbol tree from the PLC
- Recursively searching for types with the
Tc3_PlcTestSuite.I_TestSuiteattribute - Reading the TwinCAT project name and instance path
- Local Runtime: Enter "local" or leave empty
- Remote Runtime: Enter the full AMS Net-ID (e.g.,
192.168.1.84.1.1) - Invalid entries automatically default to "local"
- Valid format: Six numbers separated by dots
- Automatic Discovery - Scans multiple PLC runtime ports (851-859)
- Real-time Updates - View current test status and execution times
- Test Filtering - Quickly find specific tests by name
- Event Logging - Monitor TwinCAT event logger messages
- Remote Connection - Connect to remote PLCs via AMS Net-ID
- Dark Theme UI - Modern interface inspired by Beckhoff branding
- Multi-Runtime Support - Handle multiple PLC runtimes simultaneously
PlcTestSuite_UI/
βββ PlcTestSuite.cs # Main form logic and ADS communication
βββ PlcTestSuite.Designer.cs # UI layout and controls
βββ PlcTestSuite.resx # Form resources
βββ Program.cs # Application entry point
βββ PlcTestSuite_UI.csproj # Project configuration
- AdsClient - Handles ADS communication with TwinCAT runtimes
- SymbolLoader - Loads PLC symbols for test suite discovery
- TcEventLogger - Monitors TwinCAT event logger
- TestSuiteDef - Data structure for discovered test suites
- User clicks Refresh β Scan ports 851-859
- For each port:
- Connect to AmsNetId (local or remote) on port
- Load PLC symbols
- Recursively search for test suite types
- Store discovered test suites
- Disconnect
- User selects test suite β Connect and read test collection
- Display tests with status and duration
- Filter tests in real-time based on user input
This UI is designed to work with the PlcTestSuite library by SimmelFlo.
In your TwinCAT PLC project:
PROGRAM MyTestSuite IMPLEMENTS Tc3_PlcTestSuite.I_TestSuite
VAR
TestSuite : FB_TestSuite;
TestCollection : ARRAY[0..99] OF FB_TestCase;
END_VAR
// Define and register your tests
TestSuite.AddTest(TestCollection[0], 'TestName1');
TestSuite.AddTest(TestCollection[1], 'TestName2');
// ...
// Execute the test suite
TestSuite.Execute();
Your test suite must:
- Implement the
Tc3_PlcTestSuite.I_TestSuiteinterface - Have a
TestCollectionarray of test cases - Include
_TestId,_State, andDurationproperties for each test
Refer to the PlcTestSuite documentation for detailed implementation instructions.
- Verify TwinCAT runtime is active
- Check AMS Net-ID is correct (use "local" for local runtime)
- Ensure ADS router is running
- Check firewall settings allow ADS communication (TCP port 48898)
- Verify your test suite implements
Tc3_PlcTestSuite.I_TestSuite - Check the PLC project is running on ports 851-859
- Ensure the test suite attribute is properly set
- Verify PlcTestSuite library is correctly installed in TwinCAT
- Ensure the test suite has a
TestCollectionarray - Check test cases have
_TestId,_State, andDurationproperties - Verify the selected test suite is active
- Verify .NET 8.0 Runtime is installed
- Check TwinCAT ADS libraries are installed
- Try running as Administrator
- Target Framework: net8.0-windows
- Output Type: Windows Application (WinExe)
- Language Version: C# 12.0
- Nullable: Enabled
# Debug build
dotnet build PlcTestSuite_UI.csproj
# Release build
dotnet build PlcTestSuite_UI.csproj --configuration Release
# Clean build artifacts
dotnet clean PlcTestSuite_UI.csproj- Dark theme color scheme (Beckhoff red: RGB(204, 0, 0))
- Async/await patterns for non-blocking operations
- Exception handling with fallback to local connection
- Consolas font for test/event lists (monospace)
- Segoe UI for UI labels and buttons
Initial release with automatic test suite discovery, real-time test status tracking, test filtering, TwinCAT Event Logger integration, and remote PLC connection support via AMS Net-ID. Built with .NET 8.0 and Beckhoff.TwinCAT.Ads v7.0.132.
Features:
- Automatic test suite discovery (TwinCAT ports 851-859)
- Real-time test status and duration display
- Test filtering with live search
- Remote PLC connection via AMS Net-ID
- Event history monitoring
- Dark theme UI with Beckhoff branding
[Specify your license here]
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Submit a pull request
- Built with .NET 8.0
- Uses Beckhoff TwinCAT.Ads
- Designed for PlcTestSuite by SimmelFlo
For issues related to:
- PlcTestSuite_UI: Open an issue in this repository
- PlcTestSuite Library: Visit https://github.com/SimmelFlo/PlcTestSuite
- TwinCAT ADS: Consult Beckhoff documentation