--- title: "Delsys API Python Example Code Overview" slug: "delsys-api-python-example-code-overview" description: "Set up and run Python Example Code for Delsys systems to stream, visualize EMG data, and export results to CSV for analysis." tags: ["Delsys API", "Python"] updated: 2026-10-06T09:44:33Z published: 2026-10-06T09:44:33Z canonical: "support.delsys.com/delsys-api-python-example-code-overview" --- > ## Documentation Index > Fetch the complete documentation index at: https://support.delsys.com/llms.txt > Use this file to discover all available pages before exploring further. # Delsys API Python Example Code Overview ### **Overview** This guide walks you through setting up and running the Delsys API Python Example Code, which enables direct communication with Delsys Trigno systems and integration with third-party software for data collection, visualization, and export. It is designed for developers and researchers to pair and configure Avanti-Style Sensors, stream and plot EMG data in real time, and export the results to CSV for analysis. You will learn how to install the required tools, activate your API license, set up the development environment, and run the demo application to acquire and save sensor data. #### Interactive Guide For a step-by-step walk-through on installation steps, please refer to the interactive guide below [Embedded content](https://ek7o0rcfvp0.typeform.com/to/pKLzas55) > [!NOTE] > Statement of Expectation > > *"Delsys will provide support for the API to the point where the Python Example code is running, and data can be visualized within the GUI. Delsys does not provide support for custom coding projects or assistance with troubleshooting errors within code outside the scope of the Python example code.”* --- ### **System Requirements** | **Material/Tool** | **Description** | | --- | --- | | **Software** | Delsys API 2.8.1+ Python 3.12.0+ VSCode 1.97 (recommended) | | **Hardware: System** | Trigno Centro Trigno Lite Trigno Research Base Stationn | | **Firmware: System** | Trigno Centro: 06-05-00 \| 04-01 + Trigno Lite: 02-02 + Trigno Research Base Station: Digital: 2919 \| 1506 \| 0806 \| 2008 \| 0000 Analog: 2919\| 1506 \| 0806 \| 2008\| 0901 | | **Hardware: Sensors** | Avanti-Style Sensors | | **Firmware: Sensors** | Avanti-Style Sensor: 40-49 Maize Sensor: 60-29 | | **Operating System** | Windows 11 | --- ## **Step-by-Step Instructions** ### **Step 1: Installation** 1. Download Example Code 1. Go to the [Delsys GitHub repository](https://github.com/delsys-inc/Example-Applications). 2. Click the green “Code” drop-down and select Download ZIP. 3. Ensure the entire .zip file is downloaded; individual files are not available. ![](https://cdn.us.document360.io/0adedc1d-5225-43a1-9673-53a5c8c15600/Images/Documentation/image(443).png) 1. Install Python 1. The Delsys API 2.8 + Python Example Code requires Python 3.12+. 2. Python 3.12+ can be downloaded from the [official Python 3.12.7 release page](https://www.python.org/downloads/release/python-3127/) 3. Ensure to install the 64-bit download. 4. During installation, make sure to check Add to PATH. 2. Install Visual Studio Code (optional but recommended) 1. Download Visual Studio Code via the [official Microsoft Store listing](https://apps.microsoft.com/detail/xp9khm4bk9fz7q) 3. . Unblock and Extract Files 1. Right-click the downloaded .zip → Properties → check Unblock → Apply → OK. 2. Right-click again → Extract All → choose destination folder. ![](https://cdn.us.document360.io/0adedc1d-5225-43a1-9673-53a5c8c15600/Images/Documentation/image(444).png) > [!WARNING] > Recommendation > > - Visual Studio Code is recommended for editing and debugging the Delsys API. The Delsys API can be run on any platform that supports running code. > - The following steps will be described using VS Code. ### **Step 2: Initial Setup** 1. Open Project in VS Code 1. In VS code: File → New Window → Open Folder. 2. Select the extracted Python folder from your directory. 2. Install Python Extension for VS Code 1. If prompted, install Pythonv2024.20. 2. If not prompted, search for Pythonv2024.20 in Extensions (on the left side menu) and install it manually 3. Set Up an Environment You can set up your environment using either the Virtual Environment method (recommended) or the Command Line method. **Option 1: Virtual Environment (Recommended)** 1. Click the Python version indicator in the bottom right of VS Code. 2. Select Create Virtual Environment → .venv. 3. Choose Python 3.12.x 64-bit (Global). 4. Verify that requirements.txt is checked, then click OK. **Option 2: Command Line Install** 1. Open the VS Code terminal (Terminal → New Terminal). 2. Run the following command: python -m pip install -r requirements.txt. ![](https://cdn.us.document360.io/0adedc1d-5225-43a1-9673-53a5c8c15600/Images/Documentation/API_Virtual_Environment 1(1).gif) > [!CAUTION] > Important > > - Using a virtual environment is recommended because it installs the Delsys API Python packages locally within your project. This prevents conflicts with other Python projects on your system and ensures that your project uses the correct package versions. ### **Step 3: Licensing** 1. Obtain License & Key 1. The Delsys API key/license is separate from the EMGworks and Trigno Discover license. Please contact Delsys Support to obtain a Delsys API license and key. 2. Insert License & Key 1. Open `TrignoBase.py` (under AeroPy) in VS Code 2. In the line mentioning “key”, paste the contents of DelsysAPI.key inside the quotes. 3. In the line mentioning “license", paste the contents of DelsysAPI.lic inside the quotes ![](https://cdn.us.document360.io/0adedc1d-5225-43a1-9673-53a5c8c15600/Images/Documentation/image(445).png) > [!CAUTION] > Important > > - The entire license and key string must be placed within the quotation marks to ensure the Delsys API can read and validate it correctly. Missing or misplaced characters will cause license and key errors. ### **Step 4: Triggering and Analog Inputs (Trigno Centro Required)** Navigate to the `DelsysPythonDemo.py` code and click the ”Run Python File” button in the top right corner. The Delsys GUI will display. Select "Display Plot" (optional) and "Connect" and the "Collect Data GUI" will display. ![](https://cdn.us.document360.io/0adedc1d-5225-43a1-9673-53a5c8c15600/Images/Documentation/2026-03-30_16-19-26(1).gif) **Triggering** 1. Navigate to the Centro Triggers tab to access trigger settings. 1. Start and Stop Output/Input triggers can be configured here. 2. Enable triggers by selecting the trigger header 3. Configure: 1. **BNC port number (channel)** 2. **Rising/Falling edge** 3. **Pulse voltage** ![](https://cdn.us.document360.io/0adedc1d-5225-43a1-9673-53a5c8c15600/Images/Documentation/image(447).png) > [!NOTE] > Information > > - The Sync Output Beacon option continuously outputs trigger pulses at the specified frequency during the trial. **Analog Inputs** 1. Access the **Analog Inputs** panel. 2. Set the number of analog channels by selecting the corresponding header. 3. Adjust voltage input range from dropdown. ![](https://cdn.us.document360.io/0adedc1d-5225-43a1-9673-53a5c8c15600/Images/Documentation/image(448).png) > [!NOTE] > Information > > Both Trigger and Analog Input settings should be configured before starting a data collection stream within the GUI. ### Step 5: Streaming Data 1. Navigate to the Trial Controls Tab 2. Once sensors have been paired [(See How to Activate and Pair Sensors article)](/v1/docs/how-to-activate-pair-a-sensor-in-trigno-discover) and configured, select "Start" and the data will start streaming and plotting, if "Display Plot" has been selected. ![](https://cdn.us.document360.io/0adedc1d-5225-43a1-9673-53a5c8c15600/Images/Documentation/2026-03-30_16-13-16.gif) > [!NOTE] > Information > > - Only EMG data is plotted by default in the Python Demo App. However, users can modify the code in `CollectionDataController.py` to visualize other channel types as needed. ### Step 6: CSV Export 1. To export to CSV, first stop the data collection, then click the “Export to CSV” button. 2. If the export is successful, the terminal will display "CSV Export: True". 3. The data file will be saved within the Python folder in your directory with the default name "data.csv". 4. To change the file name, close the Delsys GUI and navigate to the `CSVWriter.py` file under the Export section. Change the filename in line 5 and run the `CSVWriter.py` file. Navigate to the `DelsysPythonDemo.py` to load the GUI and start a new collection. > [!NOTE] > Important > > - The export CSV function is an example of how to save data. It is not an optimal project solution for saving data. ![](https://cdn.us.document360.io/0adedc1d-5225-43a1-9673-53a5c8c15600/Images/Documentation/image(449).png) > [!NOTE] > Information > > - The GUI needs to be closed out before renaming a trial for a new data file to be created. To save multiple trials of data streams, the filename needs to be changed. Otherwise, the same "data.csv" file will be overwritten. In addition, any exported API CSV file needs to be closed out. --- ## Troubleshooting Guide For a documented FAQ guide, please refer to the [Delsys Python Example: Getting Started Guide](https://ek7o0rcfvp0.typeform.com/to/pKLzas55). | **Issues** | **Solution** | | --- | --- | | Error: "Trigno system not found" when starting GUI | This error is due to a Trigno System not being plugged in via USB to the computer. The Trigno Research Base Station, Trigno Lite, or Trigno Centro needs to be plugged into the computer used for data collection. | | Error: "Base has out-of-date firmware” | There are three possible reasons for this error to occur: 1. This error can be due to the Trigno Research Base Station being on the wrong driver. The Windows PC needs to be on the 64-bit driver in order to communicate with the Delsys API and the Trigno Research Base Station. 2. Multiple open Delsys software instances can cause interference with one another. So, all other Delsys software should be closed. In addition, ensure that only one GUI window is open during use of the Delsys API, as multiple GUI windows will also cause this error. 3. If the firmware is out of date for the Trigno Research Base Station. To use the Delsys API you must be on the below firmware. Trigno Research Base Station: Digital: 2919 \| 1506 \| 0806 \| 2008 \| 0000 Analog: 2919\| 1506 \| 0806 \| 2008\| 0901 For more information on changing firmware and switching drivers, refer to our [How to Change USB Drivers](/v1/docs/how-to-change-usb-drivers-1) and [Trigno Compatibility Guide articles.](/v1/docs/trigno-compatibility-guide) | --- DOC-684-1-0 The Delsys Application Program Interface (API) is designed as a bridge between Delsys Trigno data and the expanding digital world, creating customizable real-time interfaces for research and industry projects across movement and robotic applications. Our flagship wireless EMG product line; includes systems, sensors, and software. The newer models of our Trigno wireless sensors. These sensors are magnet-activated and have a flat, LED arrow. They are fully compatible with Trigno Discover, the Delsys API, and EMGworks. They are also compatible with all of our Trigno systems. The latest flagship Trigno system. Can stream data from up to 32 sensors, has built-in triggering capabilities, and has analog inputs. A low-profile, portable, and budget-friendly Trigno system. Trigno Lite allows for data streaming from up to 4 sensors. Our older Trigno system. The Base Station contains 16 built-in charging slots and is compatible with our Trigger Module. There are two types of base stations: Analog Bases and Digital Bases. EMGworks is our legacy software package and includes Acquisition and Analysis Software. Our flagship data acquisition software, compatible with all of our Trigno Systems and Avanti-Style sensors. - For clients from Europe, the Middle East & Africa, contact Delsys Europe Support - [support@delsyseurope.com](mailto:support@delsyseurope.com) - +44 161 504 5066 - For clients from the rest of the world, contact Delsys Support - [support@delsys.com](mailto:support@delsys.com) - +1 508 545 8200