APIs, concepts, guides, and more
πŸš€ Get started

Learn RapidCode C# with these sample applications.

C# Sample Apps

These C# examples, located in the examples/ folder under your RMP install directory (e.g., C:/RSI/X.X.X/examples/ or /rsi/examples/), show how to control the RMP EtherCAT motion controller with the RapidCode API. Use these projects to explore API features, validate configurations, and jump‑start your own apps.

⚠️ Important Note

These sample applications are provided to help you integrate the RMP motion controller into your own projects. They are not production-ready and may lack critical logic or safety mechanisms required for your specific application.

If you are working with real hardware, we strongly recommend wiring an external hardware emergency stop (e-stop) button. This safeguard is essential to protect both people and equipment, reducing the risk of injury or damage when using these sample applications.

βœ… Prerequisites

  • .NET 10 SDK
    • Download the latest version: Download .NET 10.0
    • Verify that it is correctly installed by running

      dotnet --version
      # The output should show version 10.x.x
  • RMP SDK - The RMP must be installed on your system
  • Physical hardware - If using physical hardware, it must be properly configured

πŸ“‚ Files

  1. Navigate to the sample apps folder
    1. Open your RMP installation folder (the default is C:/RSI/X.X.X)
    2. Click on the examples folder, then on C#, so that you are in <YOUR_RMP_FOLDER>/examples/C#
  2. Verify that you have the following helper files:
General
_constants.cs Common configuration file for all sample apps (RMP path, default axis index, etc)
_helpers.cs Helper functions and utilities used across sample applications
_setup.cs Gets your controller/system ready for sample apps. (create controller, setup axis, etc)
Directory.Build.targets MSBuild configuration that references RapidCode .NET dll and manages build settings

βš™οΈ Configure

  1. Update _constants.cs
    • Use settings for your machine and hardware (if you have any)
  2. Choose a sample app from one of the other .cs files

πŸš€ Run a sample app

  1. Open Powershell
  2. Navigate to the sample apps folder

    cd <YOUR_RMP_FOLDER>\examples\C#

    For example:

    cd C:\RSI\10.7.2\examples\C#
  3. Clean existing builds
    dotnet clean _setup.cs
    • If encountering bugs, try repeating this step
  4. Run _setup.cs
    dotnet run _setup.cs --no-cache
    • If encountering bugs, try repeating this step
  5. Run a sample app

    For example:

    dotnet run axis-config-settling.cs --no-cache

πŸ› Debugging in VS Code

If you wish to debug the sample apps with breakpoints and step-through debugging:

  1. Install the C# Dev Kit extension
    • Open VS Code
    • Go to Extensions (Ctrl+Shift+X)
    • Search for "C# Dev Kit" and install it
    • Or install directly: C# Dev Kit
  2. Open the sample file
    • Open the .cs file you want to debug in VS Code
  3. Set breakpoints
    • Click in the left margin next to line numbers to add breakpoints
  4. Start debugging
    • Press F5 or click "Run and Debug" from the sidebar
    • The debugger will stop at your breakpoints, allowing you to inspect variables and step through code