Documentation Home Page RT-LAB Home Page
Pour la documentation en FRANÇAIS, utilisez l'outil de traduction de votre navigateur Chrome, Edge ou Safari. Voir un exemple.

RT-LAB API | ORCHESTRA

This chapter serves as an introduction to the RT-LAB Orchestra Application Programming Interface (RTAPI). Refer to the RT-LAB Connectivity chapter of the RT-LAB user guide for a general description of RT-LAB Orchestra, and for the definition of the terms used below.

The RTAPI is used by a C code External Component to exchange data with a domain created by an RTLAB framework. The data exchange within an RT-LAB Orchestra co-simulation follows a publish/subscribe mechanism. The exchanged data is referred to as a list of data items names whose union forms a domain.

Data items are published (sent to an RT-LAB framework) and subscribed to (received from an RT-LAB framework) by calling RTPublish() and RTSubscribe() respectively. The data exchange can be synchronous or asynchronous, as specified in the DDF. For a synchronous connection, calls to RTPublish() and RTSubscribe() must be enclosed in calls to functions that provide a locking mechanism.

Prior to exchanging data, a connection to a domain must be established by calling RTConnect().

Disconnection from a domain is performed by calling RTDisconnect().



NOTE:

  • The RTAPI is C only, so that it can be compiled by C only client code.
  • The RTAPI assumes that the client code calling it is single threaded.
  • Any error in publishing and subscribing with a domain will disconnect the C code External Component from the RT-LAB Orchestra co-simulation.




Examples
A C code sample that contains calls to the RTAPI is provided in the RT-LAB distribution under the directory <RT-LAB installation dir>\Examples\Features\Orchestra\C_Code\src.



OPAL-RT TECHNOLOGIES, Inc. | 1751, rue Richardson, bureau 1060 | Montréal, Québec Canada H3K 1G6 | opal-rt.com | +1 514-935-2323