> 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/rt-lab/simulink-blocks-reference/rt-lab-library/opparametermanager.md).

# OpParameterManager

## Description

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-8c33fc6853a6f1b8dbca9946aa9ac7795ea1ae60%2FRTL_op_parameter_manager_block.png?alt=media" alt=""><figcaption></figcaption></figure>

The **OpParameterManager** block, located in the **RT-LAB/Data logging** library, manages saving and reloading a subset of model signals (parameters) as a single MATLAB variable in a mat-file.

The file name and variable name are specified in the block mask. The size of the saved variable equals the number of parameters plus 1. The first element is unused to maintain compatibility with the **OpFromFile** block, in which the first element is the time value.

During model initialization, an asynchronous application starts to read the specified file, save parameters to the file, and reload values saved in the file. Save and reload actions are performed based on the first two inputs, as described in the Inputs section.

## Mask parameters

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-29ff265d9e85475e35b7fac6dc06430408784b1c%2FRTL_op_parameter_manager_mask.png?alt=media" alt="" width="329"><figcaption></figcaption></figure>

<table><thead><tr><th width="251.39996337890625">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Controller ID</strong></td><td><p>Positive, nonzero integer identifying the asynchronous application controller.</p><p>Two OpParameterManager blocks cannot share the same Controller ID.</p></td></tr><tr><td><strong>Filename</strong></td><td>Name of the file that will be read at initialization and later used to save or reload parameters. If the file is not found in the model directory on the simulator, initial parameter values are set to 0, and the file will be created at the first save request. The file is written in the Matlab-4 format.</td></tr><tr><td><strong>Variable name</strong></td><td>Name of the Matlab variable in which the parameters are grouped. This name is only necessary to create a Matlab compatible file format.</td></tr><tr><td><strong>Number of signals</strong></td><td>Specifies the number of parameters to be saved or read. This number must be equal to the size of the Data input and of the Data_out output of the block.</td></tr><tr><td><strong>Trigger</strong></td><td>Options for triggering a save or reload action. Rising Edge: a rising edge on the Data_ready line triggers the action. Level: the action is performed at each time step while the Data_ready line is asserted.</td></tr></tbody></table>

## Inputs

<table><thead><tr><th width="250.5999755859375">Input</th><th>Description</th></tr></thead><tbody><tr><td><strong>Data_ready</strong></td><td>When asserted, triggers saving or reloading of the data connected to the Data input. The action depends on the value of the Save_Reload line when Data_ready is asserted.</td></tr><tr><td><strong>Save_Reload</strong></td><td>Sets the action performed when Data_ready is asserted: 1 to save data to file; 2 to read data from file.</td></tr><tr><td><strong>Data</strong></td><td>Input signal vector.</td></tr></tbody></table>

## Outputs

<table><thead><tr><th width="250.59991455078125">Output</th><th>Description</th></tr></thead><tbody><tr><td><strong>Error</strong></td><td><p>Error status of the last saving or reloading action. Values:</p><p>0 — No error occurred;</p><p>-1 — The file could not be opened for writing during a 'save' request;</p><p>-2 — The Save_Reload input was not equal to 1 or 2 when the Data_ready line was asserted;</p><p>-3 — The file could not be opened during a 'reload' request.</p></td></tr><tr><td><strong>Data_out</strong></td><td>Output signal vector.</td></tr></tbody></table>

## Characteristics and limitations

<table><thead><tr><th width="250.5999755859375">Characteristic</th><th>Value</th></tr></thead><tbody><tr><td>Direct Feedthrough</td><td>No</td></tr><tr><td>Discrete sample time</td><td>Yes</td></tr><tr><td>XHP support</td><td>Yes (Partial XHP only)</td></tr><tr><td>Work offline</td><td>No</td></tr></tbody></table>


---

# 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/rt-lab/simulink-blocks-reference/rt-lab-library/opparametermanager.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.
