> For the complete documentation index, see [llms.txt](https://www.opal-rt.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.opal-rt.com/docs/cmde-add-on/get-started/run-a-simple-project.md).

# Run a Simple Project

In this tutorial, you will learn how to get started with the **CMDE Add-On** by building a simple project. The project simulates a cell monitoring device that communicates with an externally connected SPI master (BMS). While this example focuses on a basic setup, the steps can be easily adapted to other CMDE Add-On hardware configurations and device types.

{% stepper %}
{% step %}

## Create VeriStand project

1. **Create a VeriStand Project** by selecting **Default Project** and giving it a meaningful name.
2. In the **VeriStand Editor**, click **Configure…** to open the **System Explorer**.
   {% endstep %}

{% step %}

## Configure target settings

1. In the system definition tree of the VeriStand project, navigate to the **Controller** section.
2. Set the **Operating System** to *Linux\_x64*.
3. Configure the **IP Address** field

<figure><img src="https://2869406741-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fgtd2gZ5PvjsRaV45Czvu%2Fuploads%2FAFt08S9BxmRexWID3sZV%2Fimage.png?alt=media&amp;token=6451e96d-81f1-498b-86f8-a56f1e4d23b1" alt=""><figcaption></figcaption></figure>

4. If permissions are configured on your Real Time target, enter the credentials in the **Username** and **Password** fields. National Instruments targets are programmed with the following credentials by default: \
   **Username**: *admin*     **Password**: *\<blank>*
5. **Save** and close the System Definition.
   {% endstep %}

{% step %}

## Add the CMDE Add-On to the System Definition <a href="#heading-title-text" id="heading-title-text"></a>

1. In the **System Definition** tree, expand the nodes until you reach **Custom Devices**.
2. Right‑click **Custom Devices** and navigate to **OPAL‑RT → CMDE Add‑On**. Wait for the main page to load.
3. **Save** the System Definition.

The OPAL-RT CMDE Add-On for NI VeriStand is designed to **plug-in** to NI VeriStand via a **Custom Device***.*

<figure><img src="https://2869406741-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fgtd2gZ5PvjsRaV45Czvu%2Fuploads%2FHWGN2hxDbOqIPp0OlIE1%2Fimage.png?alt=media&amp;token=7e971c9e-c60b-4147-bcac-e0190ca0c6e3" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

## Select your hardware configuration

In the **Configuration** dropdown, select a **Hardware Configuration** based on the type of emulated device and the supported FPGA card.&#x20;

<figure><img src="https://2869406741-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fgtd2gZ5PvjsRaV45Czvu%2Fuploads%2FeaLeDKiMRO6MP5DCaGgG%2Fimage.png?alt=media&amp;token=ae71c094-f692-43d7-aa49-0cfb35e858f1" alt=""><figcaption></figcaption></figure>

Tate note of the **Target** name listed for the Bitfile.<br>
{% endstep %}

{% step %}

## Connect SPI Master

1. Locate the pin assignment information for the selected **Hardware Configuration**.
2. Take note of the connector and pin number for the SCK, CS, MISO, and MOSI signals on Port A.
3. Connect the SPI Master signals to the proper DI/O channel pins.

{% hint style="info" %}
Some systems may include mapping boxes or custom cabling on the PXI connector. In this case, refer to the system documentation to make the connections to the SPI Master
{% endhint %}
{% endstep %}

{% step %}

## &#x20;Create User Interface

1. In the VeriStand Editor, double click the Screen file (*.nivsscr*) to open the user interface.
2. Add a **Numeric Indicator** to the screen and map it to the **Last Command Received** channel of Device 0.
3. Click the indicator to display its Properties. Expand **Display Format** and choose the *Hexadecimal* option. Enable **Show radix**.
4. Add a **Numeric Control** to the screen and map it to the **Port A Enable** channel of Device 0.

<figure><img src="https://2869406741-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fgtd2gZ5PvjsRaV45Czvu%2Fuploads%2Fop99XD61OBdhk8cKn0sg%2Fimage.png?alt=media&amp;token=627acb4b-958d-4e8a-8e30-02655f032510" alt=""><figcaption></figcaption></figure>

1. **Save** the Screen file.
   {% endstep %}

{% step %}

## Deploy and test the VeriStand Project

1. In the VeriStand Editor, select **Idle >> Deploy**.
2. Set **Port A Enable** to 1.
3. Send a known command from the SPI Master and confirm that the correct hexadecimal value is displayed in the **Last Command Received** indicator.

<details>

<summary><strong>Example Sequence for ADBMS Devices</strong></summary>

The following sequence of commands is a simple example for retrieving the cell voltage measurements from a single ADBMS device (**ADBMS6815**, **ADBMS6830** and **ADBMS6832**)&#x20;

Depending on the device used, some commands might not be supported. Refer to the **Supported Commands** table on each device page under the [**Device Section**](https://www.opal-rt.com/docs/cmde-add-on/model-and-simulation/configure-devices-within-a-ring/device-section.md).

| Command                                                      | Hexadecimal Code              |
| ------------------------------------------------------------ | ----------------------------- |
| **Clear Cell Voltage Register Group (CLRCELL)**              | 0711 C9C0                     |
| **Soft Reset (SRST)**                                        | 0027 A7FA                     |
| **Reset Command Counter (RSTCC)**                            | 002E C4C6                     |
| **Start Cell Voltage ADC Conversion and Poll Status (ADCV)** | 0260 7C20                     |
| **Read Cell Voltage Register Group A (RDCVA)**               | 0004 07C2 0000 0000 0000 0000 |
| **Read Cell Voltage Register Group B (RDCVB)**               | 0006 9A94 0000 0000 0000 0000 |
| **Read Cell Voltage Register Group C (RDCVC)**               | 0008 5E52 0000 0000 0000 0000 |
| **Read Cell Voltage Register Group D (RDCVD)**               | 000A C304 0000 0000 0000 0000 |
| **Read Cell Voltage Register Group E (RDCVE)**               | 0009 D560 0000 0000 0000 0000 |
| **Read Cell Voltage Register Group F (RDCVF)**               | 000B 4836 0000 0000 0000 0000 |

{% hint style="info" %}
The Read Cell Voltage Register Group X (RDCVX) command can be used to retrieve the raw cell voltage measurement value from the corresponding register.
{% endhint %}

</details>

<details>

<summary><strong>Example Sequence for LTC Devices</strong></summary>

The following sequence of commands is a simple example for retrieving the cell voltage measurements from a single LTC device (**LTC6810**, **LTC6811** and **LTC6813**).

Depending on the device used, some commands might not be supported. Refer to the **Supported Commands** table on each device page under the [**Device Section**](https://www.opal-rt.com/docs/cmde-add-on/model-and-simulation/configure-devices-within-a-ring/device-section.md).

| Command                                                      | Hexadecimal Code              |
| ------------------------------------------------------------ | ----------------------------- |
| **Clear Cell Voltage Register Group (CLRCELL)**              | 0711 C9C0                     |
| **Start Cell Voltage ADC Conversion and Poll Status (ADCV)** | 02E0 3806                     |
| **Read Cell Voltage Register Group A (RDCVA)**               | 0004 07C2 0000 0000 0000 0000 |
| **Read Cell Voltage Register Group B (RDCVB)**               | 0006 9A94 0000 0000 0000 0000 |
| **Read Cell Voltage Register Group C (RDCVC)**               | 0008 5E52 0000 0000 0000 0000 |
| **Read Cell Voltage Register Group D (RDCVD)**               | 000A C304 0000 0000 0000 0000 |
| **Read Cell Voltage Register Group E (RDCVE)**               | 0009 D560 0000 0000 0000 0000 |
| **Read Cell Voltage Register Group F (RDCVF)**               | 000B 4836 0000 0000 0000 0000 |

{% hint style="info" %}
The Read Cell Voltage Register Group X (RDCVX) command can be used to retrieve the raw cell voltage measurement value from the corresponding register.
{% endhint %}

</details>
{% endstep %}
{% endstepper %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.opal-rt.com/docs/cmde-add-on/get-started/run-a-simple-project.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
