> 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/opsharedmemoryread.md).

# OpSharedMemoryRead

## Description

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

The **OpSharedMemoryRead** block, located in the **RT-LAB/Communication/SharedMemory** library, reads data from shared memory. Use it in a Master or Slave subsystem with the OpSharedMemoryCtrl block to communicate with shared memory in memory or on a physical address.

## Mask parameters

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

<table><thead><tr><th width="252.20001220703125">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Controller ID</strong></td><td>Specifies the controller ID of the OpSharedMemoryCtrl that the Read block will use.</td></tr><tr><td><strong>Offset</strong></td><td>Specifies the starting memory offset in global Shared Memory space for this block.</td></tr><tr><td><strong>Memory access size</strong></td><td>Specifies the size of each read access to the memory. Each size corresponds to a specific amount of data read:</td></tr></tbody></table>

| Memory size access      | data read            |
| ----------------------- | -------------------- |
| byte                    | 8 bits integer data  |
| word                    | 16 bits integer data |
| long word               | 32 bits integer data |
| float single precision  | 32 bits float data   |
| double-double precision | 64 bits float data   |

## Inputs

This block has no inputs.

## Outputs

<table><thead><tr><th width="249.79998779296875">Output</th><th>Description</th></tr></thead><tbody><tr><td><strong>Data</strong></td><td>Outputs data read from shared memory using the controller-specified address plus the offset. Use a demux to set the number of outputs.</td></tr></tbody></table>

## Characteristics and limitations

| Characteristic       | Value |
| -------------------- | ----- |
| Direct Feedthrough   | N/A   |
| Discrete sample time | Yes   |
| XHP support          | Yes   |
| Work offline         | No    |


---

# 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/opsharedmemoryread.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.
