|
APIs, concepts, guides, and more
|
Learn RapidCode Python with these sample applications.
These Python 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.
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.
| Python (Windows) | Python (Linux) |
|---|---|
| 3.10 | 3.9 / 3.10 / 3.11 |
Verify the version by running:
Note: You may consider uninstalling unnecessary python versions to avoid conflicts. If you need support for another Python version, contact tech@roboticsys.com.
| NumPy (Windows) | NumPy (Linux) |
|---|---|
| 1.22 | 1.23 / 1.24 / 1.25 / 1.26 |
Install by running:
| Windows path | Linux path |
|---|---|
| C:\RSI\X.X.X\examples\python | /rsi/examples/python |
| General | |
|---|---|
| _constants.py | Common constants for all sample apps (RMP path, node name, etc) |
| _helpers.py | Helper functions and utilities used across sample applications |
| _config.py | Central configuration helpers (e.g., setup_controller, configure_hardware_axes) |
| _imports.py | Finds our RapidCode library and imports it for our sample apps. Do not edit this file |
Edit _constants.py before running the samples:
| Constant | Windows | Linux | Value |
|---|---|---|---|
| RMP_PATH | ✔️ | ✔️ | RMP installation path. Usually /rsi (Linux) or C:\RSI\X.X.X (Windows) |
| RMP_NODE_NAME | ✔️ | INtime node name (usually NodeA) | |
| RMP_NIC_PRIMARY | ✔️ | The name of the primary network card (only required for physical axes) | |
| RMP_CPU_AFFINITY | ✔️ | Isolated CPU core you want to use. Find it with cat /sys/devices/system/cpu/isolated | |
| USE_HARDWARE | ✔️ | ✔️ | Start with false to test your sample app with phantom axes. When you're ready to use physical motors, see the "Run with Hardware" section below |
| Windows path | Linux path |
|---|---|
| C:\RSI\X.X.X\examples\python | /rsi/examples/python |
Run a sample:
On Linux you can run python3 controller-create.py.
If you'd like to have autocomplete available in VSCode for the RapidCode API, make sure that you:
Some sample apps (e.g., axis-motion.py) can be run with hardware. Use the following steps to do so.
Note: For more info on configuring hardware axes, see our Concepts > Configuration documentation