> 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/pe-add-on-opal-rt/simulation-control-monitoring-and-logging/display-simulated-signals-using-waveforms/log-waveform-data-to-a-file.md).

# Log Waveform Data to a File

The **Waveform Data Logger Custom Device** is an open-source tool freely available for users to download online. It can be deployed in a VeriStand project alongside the Power Electronics Add-On to record **Waveform channel data** to a file during execution.

{% hint style="danger" %}
The Waveform Data Logger Custom Device is not developed, maintained, or supported by OPAL-RT. For any issues or questions related it its use, please contact [**National Instruments Support**.](https://www.ni.com/en-ca/support.html)
{% endhint %}

## Installing the Waveform Data Logger Custom Device

Download and install the [Waveform Data Logger Custom Device](https://github.com/NIVeriStandAdd-Ons/Waveform-Data-Logger-Custom-Device/releases) from GitLab and select the latest build .*nipkg* file corresponding to your version of VeriStand.

Double-click the file to open it in the NI Package Manager and follow the installation prompts.

<figure><img src="https://1300141755-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCyfrFRdgX5VC5iwM13Zm%2Fuploads%2FjPiaadJmoHJsVW2YnMeC%2Fimage.png?alt=media&amp;token=d5e95a01-2501-4599-9b2c-06956ddc82d6" alt="" width="375"><figcaption></figcaption></figure>

## Logging Data to a File

The steps below describe how to add the Waveform Data Logger Custom Device to a VeriStand project alongside the Power Electronics Add-On.

{% hint style="danger" %}
Before completing these steps, the desired simulated signals must be mapped to VeriStand Waveform channels in the Power Electronics Add-On.
{% endhint %}

In the VeriStand System Definition tree, expand the items until the **Custom Devices** section is reached. Right-click the **Custom Devices** section and select **National Instruments >> Waveform Data Logger**.

In the **Waveform Data Logger page**, click **Add Log File**. Notice that a new item, *Waveform Log*, is added to the System Definition tree.

* In the **Log File Settings** **tab**, enter a **Log File Path**. This is the location on the target where the file will be saved.
* In the **Waveforms** tab and click the **Select Waveforms** button. Expand **Controller >> Custom Devices >> Power Electronics Add-On (OPAL-RT Circuit) >> Circuit >> Waveforms** and select the Waveform channels to log to the file.

<figure><img src="https://1300141755-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCyfrFRdgX5VC5iwM13Zm%2Fuploads%2FMEbjOaupm9OVBEiwQKpf%2FAddCustomDevice.gif?alt=media&amp;token=66237252-876c-47b9-8b9f-8b11c0352d62" alt=""><figcaption></figcaption></figure>

In the **System Definition tree**, expand **Waveform Data Logger >> Waveform Log >> Commands** to display the **Logging Enabled** channel. This channel must be set to TRUE to record data. If desired, it can be routed to a UI control and manipulated by the user at execution time.

**Save** the System Definition file and deploy the project to simulate and record data.

Customizations can be made in the Custom Device Configuration page to control start triggers, stop triggers, file sizes, and other logging options. At execution time, monitor the **File Status** and **Missed Samples** channels to ensure that data is being recorded as intended.

## **Transferring the File to the Host PC**

During execution, the Waveform signal data will be logged to a **TDMS file** stored on the real time target. Use FTP to transfer the file back to the Host PC and examine the results.

* Open a Windows Explorer window, and in the address bar enter *ftp:\\\\\<ip\_address>* to connect to the real time target. For more information about connecting to a target over FTP, refer to the National Instruments KB article [How can I Transfer Files over FTP to a Remote System?](https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000YIEiCAO\&l=en-CA)
* On the real time target, navigate to the file path configured in Step 4 above, and locate the TDMS log file.
* Copy and paste the file from the real time target to the Host PC

## **Processing Results**

TDMS is a custom National Instruments file type designed for storing and managing large amounts of data. More information about TDMS can be found on the National Instruments website:

* [The NI TDMS File Format](https://www.ni.com/en-ca/support/documentation/supplemental/06/the-ni-tdms-file-format.html)
* [What Are TDMS Files and How Can I Use Them in My LabVIEW Program?](https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019SWMSA2\&l=en-CA)

To quickly view the data in Microsoft Excel, consider installing the[ TDM Excel Add-In for Microsoft Excel](https://www.ni.com/en-ca/support/downloads/tools-network/download.tdm-excel-add-in-for-microsoft-excel.html#378046).


---

# 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/pe-add-on-opal-rt/simulation-control-monitoring-and-logging/display-simulated-signals-using-waveforms/log-waveform-data-to-a-file.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.
