> 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/automation-api-and-scripting/orchestra-api-reference/rtapi-error-code.md).

# RTAPI Error Code

**RTAPIReturn\_t** defines the error codes returned by the Orchestra RTAPI. A text version description of these codes can be obtained by calling the `RTGetErrorMessage()` function.

<details>

<summary><strong>Enumeration RTAPIReturn_t</strong></summary>

The enumeration RTAPIReturn\_t contains the list of error codes returned by the RT-LAB Orchestra API.

{% code overflow="wrap" lineNumbers="true" %}

```c
typedef enum{ RTAPI_SUCCESS = 0, 
RTAPI_CONNECT_FAILED_TIMEOUT, 
RTAPI_CONNECT_FAILED_SHARED_MEMORY_FAILURE, 
RTAPI_CONNECT_FAILED_INVALID_DOMAIN_NAME, 
RTAPI_CONNECT_FAILED_INVALID_VERSION, 
RTAPI_CONNECT_FAILED_ALREADY_CONNECTED, 
RTAPI_CONNECT_FAILED_ANOTHER_SYNCHRONOUS_CONNECTION_EXISTS,
RTAPI_CONNECT_FAILED_INVALID_CARD, 
RTAPI_CONNECT_FAILED_CARD_NOT_FOUND, 
RTAPI_CONNECT_FAILED_CARD_INITIALIZATION_ERROR, 
RTAPI_CONNECT_FAILED_CARD_INIT_VISA_SYSTEM_ERROR, 
RTAPI_CONNECT_FAILED_CARD_FIND_PCI_RESSOURCE_ERROR, 
RTAPI_CONNECT_FAILED_CARD_OPEN_PCI_RESSOURCE_ERROR, 
RTAPI_CONNECT_FAILED_CARD_MAPPING_PCI_RESSOURCE_ERROR, 
RTAPI_CONNECT_FAILED_CARD_ENABLE_PCI_INTERRUPT_ERROR, 
RTAPI_CONNECT_FAILED_MEMORY_ALLOCATION_ERROR, 
RTAPI_CONNECT_NO_CONNECTION_AVAILABLE, 
RTAPI_DISCONNECT_FAILED_NOT_CONNECTED, 
RTAPI_PUBLISH_FAILED_NOT_CONNECTED, 
RTAPI_PUBLISH_FAILED_RTLAB_SUBSYSTEM_UNMAPPED,
RTAPI_PUBLISH_FAILED_INVALID_ITEM_LIST, 
RTAPI_PUBLISH_FAILED_INVALID_KEY, 
RTAPI_PUBLISH_FAILED_NEED_SUBSCRIBE_FIRST, 
RTAPI_PUBLISH_FAILED_NO_MULTIPLE_PUBLISHERS_ALLOWED, 
RTAPI_SUBSCRIBE_FAILED_NOT_CONNECTED, 
RTAPI_SUBSCRIBE_FAILED_RTLAB_SUBSYSTEM_UNMAPPED, 
RTAPI_SUBSCRIBE_FAILED_NEED_PUBLISH_FIRST, 
RTAPI_SUBSCRIBE_FAILED_INVALID_ITEM_LIST, 
RTAPI_SUBSCRIBE_FAILED_INVALID_KEY, 
RTAPI_GETKEY_FAILED_INVALID_ITEM_NAME, 
RTAPI_GETINFO_FAILED_INVALID_ITEM_NAME, 
RTLOCK_FAILED_NOT_CONNECTED, 
RTLOCK_FAILED_TIMEOUT, 
RTAPI_RFM_WRITE_ERROR, 
RTAPI_RFM_READ_ERROR, 
RTACTIVATEPRINTBUFFER_FAILED_NOT_CONNECTED, 
RTACTIVATEPRINTBUFFER_FAILED_COULD_NOT_ATTACH_TO_BUFFER, 
RTDEACTIVATEPRINTBUFFER_FAILED_NOT_CONNECTED, 
RTAPI_GETINSTANCEID_CONTAINER_IS_SMALL, 
RTAPI_GETINSTANCEID_CONTAINER_IS_NULL, 
RTAPI_PATH_EXCEEDS_MAX_SIZE, 
RTAPI_NAME_EXCEEDS_MAX_SIZE, 
RTAPI_FAILED_XML_PARSING, 
RTAPI_FAILED_STARTING_COMMUNICATION_PROCESS,
RTAPI_UNKNOWN_ERROR, 
RTAPI_WAIT_TO_GO_READY, 
RTAPI_WAIT_TO_GO_WAIT } 
RTAPIReturn_t;
```

{% endcode %}

</details>

| Code                                                                     | Description                                                                                                    |
| ------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------- |
| **RTAPI\_SUCCESS (0)**                                                   | Function call successful.                                                                                      |
| **RTAPI\_CONNECT\_FAILED\_TIMEOUT (1)**                                  | The memory segment is not accessible.                                                                          |
| **RTAPI\_CONNECT\_FAILED\_SHARED\_MEMORY\_FAILURE (2)**                  | Could not attach to the shared memory segment                                                                  |
| **RTAPI\_CONNECT\_FAILED\_INVALID\_DOMAIN\_NAME (3)**                    | Domain name argument is not defined in the DDF                                                                 |
| **RTAPI\_CONNECT\_FAILED\_INVALID\_VERSION (4)**                         | Invalid version between proxy and external component.                                                          |
| **RTAPI\_CONNECT\_FAILED\_ALREADY\_CONNECTED (5)**                       | Connection has already been established.                                                                       |
| **RTAPI\_CONNECT\_FAILED\_ANOTHER\_SYNCHRONOUS\_CONNECTION\_EXISTS (6)** | Another simulation component has already established a synchronous connection.                                 |
| **RTAPI\_CONNECT\_FAILED\_INVALID\_CARD (7)**                            | Invalid or unsupported reflective memory card name.                                                            |
| **RTAPI\_CONNECT\_FAILED\_CARD\_NOT\_FOUND (8)**                         | Reflective memory card could not be detected.                                                                  |
| **RTAPI\_CONNECT\_FAILED\_CARD\_INITIALIZATION\_ERROR (9)**              | Reflective memory card could not be initialized.                                                               |
| **RTAPI\_CONNECT\_FAILED\_CARD\_INIT\_VISA\_SYSTEM\_ERROR (10)**         | RTAPI\_CONNECT\_FAILED\_CARD\_FIND\_PCI\_RESSOURCE\_ERROR (1                                                   |
| **RTAPI\_CONNECT\_FAILED\_CARD\_FIND\_PCI\_RESSOURCE\_ERROR (11)**       | Failed to find RFM card in VISA PCI resources.                                                                 |
| **RTAPI\_CONNECT\_FAILED\_CARD\_OPEN\_PCI\_RESSOURCE\_ERROR (12)**       | Error during initialization of PCI RFM card.                                                                   |
| **RTAPI\_CONNECT\_FAILED\_CARD\_MAPPING\_PCI\_RESSOURCE\_ERROR (13)**    | Error during memory mapping of RFM card.                                                                       |
| **RTAPI\_CONNECT\_FAILED\_CARD\_ENABLE\_PCI\_INTERRUPT\_ERROR (14)**     | Failed to enabling interrupts on RFM card.                                                                     |
| **RTAPI\_CONNECT\_FAILED\_MEMORY\_ALLOCATION\_ERROR (15)**               | Error to allocate memory while connecting.                                                                     |
| **RTAPI\_CONNECT\_NO\_CONNECTION\_AVAILABLE (16)**                       | No more connection to proxy is available (no more connection key).                                             |
| **RTAPI\_DISCONNECT\_FAILED\_NOT\_CONNECTED (17)**                       | Connection has not previously been established.                                                                |
| **RTAPI\_PUBLISH\_FAILED\_NOT\_CONNECTED (18)**                          | Connection has not been previously established.                                                                |
| **RTAPI\_PUBLISH\_FAILED\_RTLAB\_SUBSYSTEM\_UNMAPPED (19)**              | Connection to the Orchestra framework has been lost.                                                           |
| **RTAPI\_PUBLISH\_FAILED\_INVALID\_ITEM\_LIST (20)**                     | Invalid number of items, or invalid item name.                                                                 |
| **RTAPI\_PUBLISH\_FAILED\_INVALID\_KEY (21)**                            | Invalid item key.                                                                                              |
| **RTAPI\_PUBLISH\_FAILED\_NEED\_SUBSCRIBE\_FIRST (22)**                  | Connected simulation component doesn’t have states, cannot publish first.                                      |
| **RTAPI\_PUBLISH\_FAILED\_NO\_MULTIPLE\_PUBLISHERS\_ALLOWED (23)**       | The Quality Of Service attributes for the current domain indicate that only one publisher is allowed.          |
| RTAPI\_SUBSCRIBE\_FAILED\_NOT\_CONNECTED (24)                            | Connection has not been previously established.                                                                |
| **RTAPI\_SUBSCRIBE\_FAILED\_RTLAB\_SUBSYSTEM\_UNMAPPED (25)**            | Connection to the Orchestra framework has been lost.                                                           |
| **RTAPI\_SUBSCRIBE\_FAILED\_NEED\_PUBLISH\_FIRST (26)**                  | Connected simulation component has states, therefore it cannot subscribe first.                                |
| **RTAPI\_SUBSCRIBE\_FAILED\_INVALID\_ITEM\_LIST (27)**                   | Invalid number of items, or invalid item name.                                                                 |
| **RTAPI\_SUBSCRIBE\_FAILED\_INVALID\_KEY (28)**                          | Invalid item key.                                                                                              |
| **RTAPI\_GETKEY\_FAILED\_INVALID\_ITEM\_NAME (29)**                      | Item lookup failed, invalid item name.                                                                         |
| **RTAPI\_GETINFO\_FAILED\_INVALID\_ITEM\_NAME (30)**                     | Item data information retrieval failed, invalid item name.                                                     |
| **RTLOCK\_FAILED\_NOT\_CONNECTED (31)**                                  | Locking/unlocking failed, connection has not been previously established.                                      |
| **RTLOCK\_FAILED\_TIMEOUT (32)**                                         | Timeout waiting for the lock.                                                                                  |
| **RTAPI\_RFM\_WRITE\_ERROR (33)**                                        | Failed to write data in RFM card.                                                                              |
| **RTAPI\_RFM\_READ\_ERROR (34)**                                         | Failed to read data in RFM card.                                                                               |
| **RTACTIVATEPRINTBUFFER\_FAILED\_NOT\_CONNECTED (35)**                   | Connection to the Orchestra framework has not been previously established.                                     |
| **RTACTIVATEPRINTBUFFER\_FAILED\_COULD\_NOT\_ATTACH\_TO\_BUFFER (36)**   | Could not establish a connection with the OpalPrint buffer.                                                    |
| **RTDEACTIVATEPRINTBUFFER\_FAILED\_NOT\_CONNECTED (37)**                 | Connection to the Orchestra framework has not been previously established.                                     |
| **RTAPI\_NAME\_EXCEEDS\_MAX\_SIZE (41)**                                 | Provided instanceID is too long,                                                                               |
| **RTAPI\_FAILED\_XML\_PARSING (42)**                                     | DDF file couldn't be parsed correctly,                                                                         |
| **RTAPI\_FAILED\_STARTING\_COMMUNICATION\_PROCESS (43)**                 | External communication process was not started correctly - the whole Orchestra process might need to be reset, |
| **RTAPI\_UNKNOWN\_ERROR (44)**                                           | Failed with unknown error.                                                                                     |
| **RTAPI\_WAIT\_TO\_GO\_READY (45)**                                      | Domain is connected and either asynchronous or synchronous with synchronization mechanism operational,         |
| **RTAPI\_WAIT\_TO\_GO\_WAIT (46)**                                       | Domain may not be connected or synchronous with unresponsive synchronization mechanism.                        |


---

# 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/automation-api-and-scripting/orchestra-api-reference/rtapi-error-code.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.
