Skip to content

SimmelFlo/PlcTestSuite_Cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PlcTestSuite_Cli

Version: 1.0.4

A .NET global tool for triggering PlcTestSuite test execution from the command line via the TwinCAT ADS protocol.

Quick Start

Prerequisites: .NET 8.0+ Runtime, TwinCAT 3 with ADS, PlcTestSuite >= 1.1.1

Install:

dotnet tool install --global PlcTestSuite_Cli --version 1.0.4 --add-source "<path-to-nupkg-folder>"

Verify:

testsuite help

Commands

Test Execution

# Run all tests in a suite
testsuite run <TestSuiteName> [Port]

# Run a single test
testsuite rerun <TestSuiteName> <TestName> [Port]

Examples:

testsuite run GlobalTestSuite.TestSuite
testsuite run GlobalTestSuite.TestSuite 852
testsuite rerun GlobalTestSuite.TestSuite MAIN.Test_Counter_AddTwo

Parameters:

  • TestSuiteName: Fully qualified PLC test suite object (e.g., GlobalTestSuite.TestSuite)
  • TestName: Fully qualified test name (e.g., MAIN.Test_Counter_AddTwo)
  • Port: ADS port (default: 851)

Configuration

Manage connection settings for local or remote PLCs. Config stored in ~/.testsuite/config.json.

# Show current configuration
testsuite config show

# Set custom AmsNetId for remote PLC
testsuite config set-amsnetid <AmsNetId>

# Reset to local (default)
testsuite config reset

Example:

testsuite config set-amsnetid 192.168.1.100.1.1
testsuite run GlobalTestSuite.TestSuite  # Uses configured AmsNetId
testsuite config reset                    # Back to AmsNetId.Local

How It Works

Communicates with TwinCAT via ADS protocol, invoking RPC methods on PlcTestSuite objects:

  • run → calls ReRunTests()
  • rerun → calls ReRunIndividualTest(string testId)

Connection: Defaults to AmsNetId.Local. Configure custom AmsNetId via config command for remote PLCs.

Test Results: PlcTestSuite exports JUnit XML to C:\ProgramData\Beckhoff\TwinCAT\3.1\Boot\TEST_Result.xml

Requirements:

  • PlcTestSuite >= 1.1.1 library in PLC project
  • Test suite object exposing ReRunTests() and ReRunIndividualTest(string) methods
  • TwinCAT runtime running and accessible via ADS

Troubleshooting

Connection Failed:

  • Verify TwinCAT runtime is running
  • Check ADS port is correct (default: 851)
  • Verify test suite object name is correct
  • For remote: verify AmsNetId with testsuite config show, check routing and firewall (port 48898)

Method Invocation Failed:

  • Ensure PlcTestSuite >= 1.1.1
  • Verify test suite/test names are correct

Exit Codes: 0 = Success, 1 = Error

Examples

Local Testing:

testsuite run GlobalTestSuite.TestSuite
testsuite rerun GlobalTestSuite.TestSuite MAIN.Test_FailedTest

Remote PLC:

testsuite config set-amsnetid 192.168.1.100.1.1
testsuite run GlobalTestSuite.TestSuite
testsuite config reset

Uninstall:

dotnet tool uninstall --global PlcTestSuite_Cli

Related

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages